Skip to content

Commit

Permalink
lib: mgmtd: use less common macro scoped variable names
Browse files Browse the repository at this point in the history
- ran into problem with darr macros and nested macros using the same name
variables as passed in variables in an out scope. Make these macro scoped
variables more unique as well.

Signed-off-by: Christian Hopps <[email protected]>
  • Loading branch information
choppsv1 committed Dec 16, 2024
1 parent 73e54e4 commit a65cdb6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/mgmt_msg_native.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ extern int vmgmt_msg_native_send_error(struct msg_conn *conn,
*/
#define mgmt_msg_native_alloc_msg(msg_type, var_len, mem_type) \
({ \
uint8_t *buf = NULL; \
(msg_type *)darr_append_nz_mt(buf, \
uint8_t *__nam_buf = NULL; \
(msg_type *)darr_append_nz_mt(__nam_buf, \
sizeof(msg_type) + (var_len), \
mem_type); \
})
Expand Down Expand Up @@ -590,10 +590,10 @@ extern int vmgmt_msg_native_send_error(struct msg_conn *conn,
*/
#define mgmt_msg_native_append(msg, data, len) \
({ \
uint8_t **darrp = mgmt_msg_native_get_darrp(msg); \
uint8_t *p = darr_append_n(*darrp, len); \
memcpy(p, data, len); \
p; \
uint8_t **__na_darrp = mgmt_msg_native_get_darrp(msg); \
uint8_t *__na_p = darr_append_n(*__na_darrp, len); \
memcpy(__na_p, data, len); \
__na_p; \
})

/**
Expand All @@ -611,8 +611,8 @@ extern int vmgmt_msg_native_send_error(struct msg_conn *conn,
*/
#define mgmt_msg_native_add_str(msg, s) \
do { \
int __len = strlen(s) + 1; \
mgmt_msg_native_append(msg, s, __len); \
int __nas_len = strlen(s) + 1; \
mgmt_msg_native_append(msg, s, __nas_len); \
} while (0)

/**
Expand Down

0 comments on commit a65cdb6

Please sign in to comment.