aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2025-02-12 16:33:32 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2025-02-12 16:33:32 -0500
commit4e8732a2ad94982dcde175a6518da33021d2b6e8 (patch)
tree15007ccd3d06e41060b26f36fca3da24023f550e /src/lib
parentafecc407fd0d36061169ae64164703382656cafe (diff)
downloadstasis-4e8732a2ad94982dcde175a6518da33021d2b6e8.tar.gz
Encapsulate macro arguments in parentheses
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/core/include/conda.h2
-rw-r--r--src/lib/core/include/core.h3
-rw-r--r--src/lib/core/include/core_mem.h2
3 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/core/include/conda.h b/src/lib/core/include/conda.h
index b8d0caa..8b4a0bd 100644
--- a/src/lib/core/include/conda.h
+++ b/src/lib/core/include/conda.h
@@ -24,7 +24,7 @@
#define PKG_INDEX_PROVIDES_E_MANAGER_RUNTIME (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 3)
#define PKG_INDEX_PROVIDES_E_MANAGER_SIGNALED (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 4)
#define PKG_INDEX_PROVIDES_E_MANAGER_EXEC (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 5)
-#define PKG_INDEX_PROVIDES_FAILED(ECODE) (ECODE <= PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET)
+#define PKG_INDEX_PROVIDES_FAILED(ECODE) ((ECODE) <= PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET)
struct MicromambaInfo {
char *micromamba_prefix; //!< Path to write micromamba binary
diff --git a/src/lib/core/include/core.h b/src/lib/core/include/core.h
index 362ac8d..f0586fa 100644
--- a/src/lib/core/include/core.h
+++ b/src/lib/core/include/core.h
@@ -26,7 +26,7 @@
#define COE_CHECK_ABORT(COND, MSG) \
do {\
- if (!globals.continue_on_error && COND) { \
+ if (!globals.continue_on_error && (COND)) { \
msg(STASIS_MSG_ERROR, MSG ": Aborting execution (--continue-on-error/-C is not enabled)\n"); \
exit(1); \
} \
@@ -76,7 +76,6 @@ extern const char *VERSION;
extern const char *AUTHOR;
extern const char *BANNER;
-
/**
* Free memory allocated in global configuration structure
*/
diff --git a/src/lib/core/include/core_mem.h b/src/lib/core/include/core_mem.h
index bd50e9d..362715f 100644
--- a/src/lib/core/include/core_mem.h
+++ b/src/lib/core/include/core_mem.h
@@ -5,7 +5,7 @@
#include "environment.h"
#include "strlist.h"
-#define guard_runtime_free(X) do { if (X) { runtime_free(X); X = NULL; } } while (0)
+#define guard_runtime_free(X) do { if (X) { runtime_free(X); (X) = NULL; } } while (0)
#define guard_strlist_free(X) do { if ((*X)) { strlist_free(X); (*X) = NULL; } } while (0)
#define guard_free(X) do { if (X) { free(X); X = NULL; } } while (0)
#define GENERIC_ARRAY_FREE(ARR) do { \