clang-tidy: add most bugprone warnings
[lttng-tools.git] / src / common / runas.cpp
index d253ee0544e5317183b1a01becfc87a11cbd5ed5..7651470c8c57336f5f2c995c886d60f02e143e78 100644 (file)
@@ -177,30 +177,31 @@ struct run_as_ret {
        bool _error;
 } LTTNG_PACKED;
 
-#define COMMAND_IN_FDS(data_ptr)                                                         \
-       ({                                                                               \
-               int *fds = NULL;                                                         \
-               if (command_properties[data_ptr->cmd].in_fds_offset != -1) {             \
-                       fds = (int *) ((char *) data_ptr +                               \
-                                      command_properties[data_ptr->cmd].in_fds_offset); \
-               }                                                                        \
-               fds;                                                                     \
+#define COMMAND_IN_FDS(data_ptr)                                                           \
+       ({                                                                                 \
+               int *fds = NULL;                                                           \
+               if (command_properties[(data_ptr)->cmd].in_fds_offset != -1) {             \
+                       fds = (int *) ((char *) (data_ptr) +                               \
+                                      command_properties[(data_ptr)->cmd].in_fds_offset); \
+               }                                                                          \
+               fds;                                                                       \
        })
 
-#define COMMAND_OUT_FDS(cmd, ret_ptr)                                                              \
-       ({                                                                                         \
-               int *fds = NULL;                                                                   \
-               if (command_properties[cmd].out_fds_offset != -1) {                                \
-                       fds = (int *) ((char *) ret_ptr + command_properties[cmd].out_fds_offset); \
-               }                                                                                  \
-               fds;                                                                               \
+#define COMMAND_OUT_FDS(cmd, ret_ptr)                                           \
+       ({                                                                      \
+               int *fds = NULL;                                                \
+               if (command_properties[cmd].out_fds_offset != -1) {             \
+                       fds = (int *) ((char *) (ret_ptr) +                     \
+                                      command_properties[cmd].out_fds_offset); \
+               }                                                               \
+               fds;                                                            \
        })
 
-#define COMMAND_IN_FD_COUNT(data_ptr) ({ command_properties[data_ptr->cmd].in_fd_count; })
+#define COMMAND_IN_FD_COUNT(data_ptr) ({ command_properties[(data_ptr)->cmd].in_fd_count; })
 
 #define COMMAND_OUT_FD_COUNT(cmd) ({ command_properties[cmd].out_fd_count; })
 
-#define COMMAND_USE_CWD_FD(data_ptr) command_properties[data_ptr->cmd].use_cwd_fd
+#define COMMAND_USE_CWD_FD(data_ptr) command_properties[(data_ptr)->cmd].use_cwd_fd
 
 struct run_as_command_properties {
        /* Set to -1 when not applicable. */
This page took 0.023761 seconds and 4 git commands to generate.