Commit f66c3849 authored by Bernhard Link's avatar Bernhard Link

new ASSERT_NOT_NOTHING

parent 50fb67a4
...@@ -10,6 +10,7 @@ bool interrupted(void); ...@@ -10,6 +10,7 @@ bool interrupted(void);
/* retvalue is simply an int. /* retvalue is simply an int.
* just named to show it follows the given semantics */ * just named to show it follows the given semantics */
/*@numabstract@*/ enum retvalue_enum { /*@numabstract@*/ enum retvalue_enum {
RET_ERROR_INTERNAL = -12,
RET_ERROR_BZ2 = -11, RET_ERROR_BZ2 = -11,
RET_ERROR_Z = -10, RET_ERROR_Z = -10,
RET_ERROR_INTERRUPTED = -9, RET_ERROR_INTERRUPTED = -9,
...@@ -46,6 +47,8 @@ typedef enum retvalue_enum retvalue; ...@@ -46,6 +47,8 @@ typedef enum retvalue_enum retvalue;
// TODO: to be implemented... // TODO: to be implemented...
#define RET_DBERR(e) RET_ERROR #define RET_DBERR(e) RET_ERROR
#define ASSERT_NOT_NOTHING(r) {assert( r != RET_NOTHING ); if ( r == RET_NOTHING ) r = RET_ERROR_INTERNAL; }
#define EXIT_RET(ret) (RET_WAS_NO_ERROR(ret)?((nothingiserror&&ret==RET_NOTHING)?EXIT_FAILURE:EXIT_SUCCESS):(int)ret) #define EXIT_RET(ret) (RET_WAS_NO_ERROR(ret)?((nothingiserror&&ret==RET_NOTHING)?EXIT_FAILURE:EXIT_SUCCESS):(int)ret)
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment