|
@@ -73,19 +73,18 @@ typedef int *dead_t;
|
|
|
/**
|
|
/**
|
|
|
* Initializes a dead variable.
|
|
* Initializes a dead variable.
|
|
|
*/
|
|
*/
|
|
|
-#define DEAD_INIT(ptr) ({ptr = NULL;})
|
|
|
|
|
|
|
+#define DEAD_INIT(ptr) { ptr = NULL; }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Kills the dead variable,
|
|
* Kills the dead variable,
|
|
|
*/
|
|
*/
|
|
|
-#define DEAD_KILL(ptr) ({if (ptr) *(ptr) = 1;})
|
|
|
|
|
|
|
+#define DEAD_KILL(ptr) { if (ptr) *(ptr) = 1; }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Kills the dead variable with the given value, or does nothing
|
|
* Kills the dead variable with the given value, or does nothing
|
|
|
- * if the value is 0. The value will seen by {@link DEAD_LEAVE} and
|
|
|
|
|
- * {@link DEAD_KILLED}.
|
|
|
|
|
|
|
+ * if the value is 0. The value will seen by {@link DEAD_KILLED}.
|
|
|
*/
|
|
*/
|
|
|
-#define DEAD_KILL_WITH(ptr, val) ({if (ptr) *(ptr) = (val);})
|
|
|
|
|
|
|
+#define DEAD_KILL_WITH(ptr, val) { if (ptr) *(ptr) = (val); }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Declares dead catching variables.
|
|
* Declares dead catching variables.
|
|
@@ -96,24 +95,22 @@ typedef int *dead_t;
|
|
|
* Enters a dead catching using already declared dead catching variables.
|
|
* Enters a dead catching using already declared dead catching variables.
|
|
|
* The dead variable must have been initialized with {@link DEAD_INIT},
|
|
* The dead variable must have been initialized with {@link DEAD_INIT},
|
|
|
* and {@link DEAD_KILL} must not have been called yet.
|
|
* and {@link DEAD_KILL} must not have been called yet.
|
|
|
- * {@link DEAD_LEAVE} must be called before the current scope is left.
|
|
|
|
|
|
|
+ * {@link DEAD_LEAVE2} must be called before the current scope is left.
|
|
|
*/
|
|
*/
|
|
|
-#define DEAD_ENTER2(ptr) {__dead = 0; __prev_ptr = ptr; ptr = &__dead;}
|
|
|
|
|
|
|
+#define DEAD_ENTER2(ptr) { __dead = 0; __prev_ptr = ptr; ptr = &__dead; }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Declares dead catching variables and enters a dead catching.
|
|
* Declares dead catching variables and enters a dead catching.
|
|
|
* The dead variable must have been initialized with {@link DEAD_INIT},
|
|
* The dead variable must have been initialized with {@link DEAD_INIT},
|
|
|
* and {@link DEAD_KILL} must not have been called yet.
|
|
* and {@link DEAD_KILL} must not have been called yet.
|
|
|
- * {@link DEAD_LEAVE} must be called before the current scope is left.
|
|
|
|
|
|
|
+ * {@link DEAD_LEAVE2} must be called before the current scope is left.
|
|
|
*/
|
|
*/
|
|
|
#define DEAD_ENTER(ptr) DEAD_DECLARE DEAD_ENTER2(ptr)
|
|
#define DEAD_ENTER(ptr) DEAD_DECLARE DEAD_ENTER2(ptr)
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Leaves a dead catching.
|
|
* Leaves a dead catching.
|
|
|
- * Returns 1 if {@link DEAD_KILL} was called for the dead variable, 0 otherwise.
|
|
|
|
|
- * Must be called after entering a dead catching and before leaving it.
|
|
|
|
|
*/
|
|
*/
|
|
|
-#define DEAD_LEAVE(ptr) ({if (!__dead) ptr = __prev_ptr; if (__prev_ptr) *__prev_ptr = __dead; __dead;})
|
|
|
|
|
|
|
+#define DEAD_LEAVE2(ptr) { if (!__dead) ptr = __prev_ptr; if (__prev_ptr) *__prev_ptr = __dead; }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Returns 1 if {@link DEAD_KILL} was called for the dead variable, 0 otherwise.
|
|
* Returns 1 if {@link DEAD_KILL} was called for the dead variable, 0 otherwise.
|
|
@@ -122,9 +119,9 @@ typedef int *dead_t;
|
|
|
#define DEAD_KILLED (__dead)
|
|
#define DEAD_KILLED (__dead)
|
|
|
|
|
|
|
|
#define DEAD_DECLARE_N(n) int __dead##n; dead_t __prev_ptr##n;
|
|
#define DEAD_DECLARE_N(n) int __dead##n; dead_t __prev_ptr##n;
|
|
|
-#define DEAD_ENTER2_N(n, ptr) {__dead##n = 0; __prev_ptr##n = ptr; ptr = &__dead##n;}
|
|
|
|
|
|
|
+#define DEAD_ENTER2_N(n, ptr) { __dead##n = 0; __prev_ptr##n = ptr; ptr = &__dead##n;}
|
|
|
#define DEAD_ENTER_N(n, ptr) DEAD_DECLARE_N(n) DEAD_ENTER2_N(n, ptr)
|
|
#define DEAD_ENTER_N(n, ptr) DEAD_DECLARE_N(n) DEAD_ENTER2_N(n, ptr)
|
|
|
-#define DEAD_LEAVE_N(n, ptr) ({if (!__dead##n) ptr = __prev_ptr##n; if (__prev_ptr##n) *__prev_ptr##n = __dead##n; __dead##n;})
|
|
|
|
|
|
|
+#define DEAD_LEAVE2_N(n, ptr) { if (!__dead##n) ptr = __prev_ptr##n; if (__prev_ptr##n) *__prev_ptr##n = __dead##n; }
|
|
|
#define DEAD_KILLED_N(n) (__dead##n)
|
|
#define DEAD_KILLED_N(n) (__dead##n)
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|