diff --git a/lib/include/laika.h b/lib/include/laika.h index 9216b39..7eef660 100644 --- a/lib/include/laika.h +++ b/lib/include/laika.h @@ -15,7 +15,7 @@ #ifdef DEBUG #define LAIKA_DEBUG(...) printf("[~] " __VA_ARGS__); fflush(stdout); #else -#define LAIKA_DEBUG(...) +#define LAIKA_DEBUG(...) ((void)0) /* no op */ #endif #endif \ No newline at end of file diff --git a/lib/include/lerror.h b/lib/include/lerror.h index f4f388d..c1edddb 100644 --- a/lib/include/lerror.h +++ b/lib/include/lerror.h @@ -29,7 +29,7 @@ else \ exit(1); \ } while(0); -#define LAIKA_WARN(...) +#define LAIKA_WARN(...) ((void)0) /* no op */ #else #define LAIKA_ERROR(...) do { \ printf("[ERROR] : " __VA_ARGS__); \ diff --git a/lib/include/lmem.h b/lib/include/lmem.h index 9fe17c6..33f741b 100644 --- a/lib/include/lmem.h +++ b/lib/include/lmem.h @@ -11,8 +11,7 @@ #define ENDVLA(var) laikaM_free(var); #else #define VLA(type, var, sz) type var[sz]; -/* stubbed */ -#define ENDVLA(var) +#define ENDVLA(var) ((void)0) /* no op */ #endif #define laikaM_malloc(sz) laikaM_realloc(NULL, sz) @@ -25,20 +24,20 @@ } /* moves array elements above indx down by numElem, removing numElem elements at indx */ -#define laikaM_rmvarray(buf, count, indx, numElem) { \ +#define laikaM_rmvarray(buf, count, indx, numElem) do { \ int _i, _sz = ((count-indx)-numElem); \ for (_i = 0; _i < _sz; _i++) \ buf[indx+_i] = buf[indx+numElem+_i]; \ count -= numElem; \ -} +} while(0); /* moves array elements above indx up by numElem, inserting numElem elements at indx */ -#define laikaM_insertarray(buf, count, indx, numElem) { \ +#define laikaM_insertarray(buf, count, indx, numElem) do { \ int _i; \ for (_i = count; _i > indx; _i--) \ buf[_i] = buf[_i-1]; \ count += numElem; \ -} +} while(0); void *laikaM_realloc(void *buf, size_t sz);