Skip to content

Commit 79913d6

Browse files
committed
fix macroses
1 parent 5b0dba6 commit 79913d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tempesta_fw/str.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ typedef struct tfwstr_t {
219219
#define TFW_STR_STRING(val) ((TfwStr){.data = (val), NULL, \
220220
sizeof(val) - 1, 0, 0, 0})
221221
#define DEFINE_TFW_STR(name, val) TfwStr name = TFW_STR_STRING(val)
222-
#define TFW_STR_FROM_CSTR(s) ((TfwStr){.data = (char*)s, \
222+
#define TFW_STR_FROM_CSTR(s) ((TfwStr){.data = (char*)(s), \
223223
NULL, strlen(s), 0, 0, 0})
224224

225225
/* Use this with "%.*s" in printing calls. */
226226
#define PR_TFW_STR(s) (int)min(20UL, (s)->len), (s)->data
227227

228-
#define TFW_STR_INIT(s) memset(s, 0, sizeof(TfwStr))
228+
#define TFW_STR_INIT(s) memset((s), 0, sizeof(TfwStr))
229229

230230
#define TFW_STR_EMPTY(s) (!((s)->nchunks | (s)->len))
231231
#define TFW_STR_PLAIN(s) (!((s)->nchunks))
@@ -236,7 +236,7 @@ typedef struct tfwstr_t {
236236
#define TFW_STR_CHUNK(s, c) (!TFW_STR_PLAIN(s) \
237237
? ((c) >= (s)->nchunks \
238238
? NULL \
239-
: __TFW_STR_CH(s, (c))) \
239+
: __TFW_STR_CH((s), (c))) \
240240
: (!(c) ? s : NULL))
241241
/*
242242
* Get last/current chunk of @s.
@@ -266,7 +266,7 @@ typedef struct tfwstr_t {
266266
}
267267

268268
#define TFW_STR_FOR_EACH_CHUNK(c, s, end) \
269-
TFW_STR_FOR_EACH_CHUNK_INIT(c, s, end); \
269+
TFW_STR_FOR_EACH_CHUNK_INIT(c, (s), end); \
270270
for ( ; (c) < end; ++(c))
271271

272272
/* The same as above, but for duplicate strings. */

0 commit comments

Comments
 (0)