mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-03 15:58:23 +02:00
minor fixes for style
This commit is contained in:
parent
f0402f2773
commit
dcdcee5afa
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "Poco/Foundation.h"
|
#include "Poco/Foundation.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cstdlib>
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
#endif
|
#endif
|
||||||
@ -83,23 +84,26 @@ protected:
|
|||||||
//
|
//
|
||||||
#if defined(__KLOCWORK__) || defined(__clang_analyzer__)
|
#if defined(__KLOCWORK__) || defined(__clang_analyzer__)
|
||||||
|
|
||||||
|
|
||||||
// Short-circuit these macros when under static analysis.
|
// Short-circuit these macros when under static analysis.
|
||||||
// Ideally, static analysis tools should understand and reason correctly about
|
// Ideally, static analysis tools should understand and reason correctly about
|
||||||
// noreturn methods such as Bugcheck::bugcheck. In practice, they don't.
|
// noreturn methods such as Bugcheck::bugcheck(). In practice, they don't.
|
||||||
// Help them by turning these macros into 'abort' as described here:
|
// Help them by turning these macros into std::abort() as described here:
|
||||||
// https://developer.klocwork.com/documentation/en/insight/10-1/tuning-cc-analysis#Usingthe__KLOCWORK__macro
|
// https://developer.klocwork.com/documentation/en/insight/10-1/tuning-cc-analysis#Usingthe__KLOCWORK__macro
|
||||||
|
|
||||||
#include <cstdlib> // for abort
|
#include <cstdlib> // for abort
|
||||||
#define poco_assert_dbg(cond) do { if (!(cond)) abort(); } while (0)
|
#define poco_assert_dbg(cond) do { if (!(cond)) std::abort(); } while (0)
|
||||||
#define poco_assert_msg_dbg(cond, text) do { if (!(cond)) abort(); } while (0)
|
#define poco_assert_msg_dbg(cond, text) do { if (!(cond)) std::abort(); } while (0)
|
||||||
#define poco_assert(cond) do { if (!(cond)) abort(); } while (0)
|
#define poco_assert(cond) do { if (!(cond)) std::abort(); } while (0)
|
||||||
#define poco_assert_msg(cond, text) do { if (!(cond)) abort(); } while (0)
|
#define poco_assert_msg(cond, text) do { if (!(cond)) std::abort(); } while (0)
|
||||||
#define poco_check_ptr(ptr) do { if (!(ptr)) abort(); } while (0)
|
#define poco_check_ptr(ptr) do { if (!(ptr)) std::abort(); } while (0)
|
||||||
#define poco_bugcheck() do { abort(); } while (0)
|
#define poco_bugcheck() do { std::abort(); } while (0)
|
||||||
#define poco_bugcheck_msg(msg) do { abort(); } while (0)
|
#define poco_bugcheck_msg(msg) do { std::abort(); } while (0)
|
||||||
|
|
||||||
|
|
||||||
#else // defined(__KLOCWORK__) || defined(__clang_analyzer__)
|
#else // defined(__KLOCWORK__) || defined(__clang_analyzer__)
|
||||||
|
|
||||||
|
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
#define poco_assert_dbg(cond) \
|
#define poco_assert_dbg(cond) \
|
||||||
if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
|
if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
|
||||||
@ -131,8 +135,10 @@ protected:
|
|||||||
#define poco_bugcheck_msg(msg) \
|
#define poco_bugcheck_msg(msg) \
|
||||||
Poco::Bugcheck::bugcheck(msg, __FILE__, __LINE__)
|
Poco::Bugcheck::bugcheck(msg, __FILE__, __LINE__)
|
||||||
|
|
||||||
|
|
||||||
#endif // defined(__KLOCWORK__) || defined(__clang_analyzer__)
|
#endif // defined(__KLOCWORK__) || defined(__clang_analyzer__)
|
||||||
|
|
||||||
|
|
||||||
#define poco_unexpected() \
|
#define poco_unexpected() \
|
||||||
Poco::Bugcheck::unexpected(__FILE__, __LINE__);
|
Poco::Bugcheck::unexpected(__FILE__, __LINE__);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user