Skip to content

Commit 193f0aa

Browse files
committed
Wrap macro arguments in parentheses
1 parent c4708a0 commit 193f0aa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/MongoDB/Query.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ static bool php_phongo_query_opts_append_document(bson_t *opts, const char *opts
9999
}
100100

101101
#define PHONGO_QUERY_OPT_BOOL(opt, zarr, key) \
102-
if (zarr && php_array_existsc(zarr, key)) { \
103-
if (!BSON_APPEND_BOOL(intern->opts, (opt), php_array_fetchc_bool(zarr, key))) { \
102+
if ((zarr) && php_array_existsc((zarr), (key))) { \
103+
if (!BSON_APPEND_BOOL(intern->opts, (opt), php_array_fetchc_bool((zarr), (key)))) { \
104104
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error appending \"%s\" option", (opt)); \
105105
return false; \
106106
} \
107107
}
108108

109109
#define PHONGO_QUERY_OPT_DOCUMENT(opt, zarr, key) \
110-
if (zarr && php_array_existsc(zarr, key)) { \
110+
if ((zarr) && php_array_existsc((zarr), (key))) { \
111111
if (!php_phongo_query_opts_append_document(intern->opts, (opt), (zarr), (key) TSRMLS_CC)) { \
112112
return false; \
113113
} \
@@ -117,15 +117,15 @@ static bool php_phongo_query_opts_append_document(bson_t *opts, const char *opts
117117
* are not converting strings to 64-bit integers for 32-bit platforms. */
118118

119119
#define PHONGO_QUERY_OPT_INT64(opt, zarr, key) \
120-
if (zarr && php_array_existsc(zarr, key)) { \
121-
if (!BSON_APPEND_INT64(intern->opts, (opt), php_array_fetchc_long(zarr, key))) { \
120+
if ((zarr) && php_array_existsc((zarr), (key))) { \
121+
if (!BSON_APPEND_INT64(intern->opts, (opt), php_array_fetchc_long((zarr), (key)))) { \
122122
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error appending \"%s\" option", (opt)); \
123123
return false; \
124124
} \
125125
}
126126

127127
#define PHONGO_QUERY_OPT_STRING(opt, zarr, key) \
128-
if (zarr && php_array_existsc(zarr, key)) { \
128+
if ((zarr) && php_array_existsc((zarr), (key))) { \
129129
if (!php_phongo_query_opts_append_string(intern->opts, (opt), (zarr), (key) TSRMLS_CC)) { \
130130
return false; \
131131
} \

0 commit comments

Comments
 (0)