clang-tidy: add most bugprone warnings
[lttng-tools.git] / src / common / lttng-elf.cpp
index 108686042db85ae66fb46b9383754be8ac7c5bdc..be1db0250ac02bae4af5cba422c52c3cb41a8132 100644 (file)
@@ -33,7 +33,7 @@
 #define NOTE_STAPSDT_SECTION_NAME      ".note.stapsdt"
 #define NOTE_STAPSDT_NAME              "stapsdt"
 #define NOTE_STAPSDT_TYPE              3
-#define MAX_SECTION_DATA_SIZE          512 * 1024 * 1024
+#define MAX_SECTION_DATA_SIZE          (512 * 1024 * 1024)
 
 #if BYTE_ORDER == LITTLE_ENDIAN
 #define NATIVE_ELF_ENDIANNESS ELFDATA2LSB
 #define NATIVE_ELF_ENDIANNESS ELFDATA2MSB
 #endif
 
-#define next_4bytes_boundary(x) (typeof(x)) ((((uint64_t) x) + 3) & ~0x03)
-
-#define bswap(x)                                   \
-       do {                                       \
-               switch (sizeof(x)) {               \
-               case 8:                            \
-                       x = be64toh((uint64_t) x); \
-                       break;                     \
-               case 4:                            \
-                       x = be32toh((uint32_t) x); \
-                       break;                     \
-               case 2:                            \
-                       x = be16toh((uint16_t) x); \
-                       break;                     \
-               case 1:                            \
-                       break;                     \
-               default:                           \
-                       abort();                   \
-               }                                  \
+#define next_4bytes_boundary(x) (typeof(x)) ((((uint64_t) (x)) + 3) & ~0x03)
+
+#define bswap(x)                                       \
+       do {                                           \
+               switch (sizeof(x)) {                   \
+               case 8:                                \
+                       (x) = be64toh((uint64_t) (x)); \
+                       break;                         \
+               case 4:                                \
+                       (x) = be32toh((uint32_t) (x)); \
+                       break;                         \
+               case 2:                                \
+                       (x) = be16toh((uint16_t) (x)); \
+                       break;                         \
+               case 1:                                \
+                       break;                         \
+               default:                               \
+                       abort();                       \
+               }                                      \
        } while (0)
 
 #define bswap_shdr(shdr)                    \
                (dst_ehdr).e_shstrndx = (src_ehdr).e_shstrndx;   \
        } while (0)
 
-#define copy_sym(src_sym, dst_sym)                   \
-       do {                                         \
-               dst_sym.st_name = src_sym.st_name;   \
-               dst_sym.st_info = src_sym.st_info;   \
-               dst_sym.st_other = src_sym.st_other; \
-               dst_sym.st_shndx = src_sym.st_shndx; \
-               dst_sym.st_value = src_sym.st_value; \
-               dst_sym.st_size = src_sym.st_size;   \
+#define copy_sym(src_sym, dst_sym)                       \
+       do {                                             \
+               (dst_sym).st_name = (src_sym).st_name;   \
+               (dst_sym).st_info = (src_sym).st_info;   \
+               (dst_sym).st_other = (src_sym).st_other; \
+               (dst_sym).st_shndx = (src_sym).st_shndx; \
+               (dst_sym).st_value = (src_sym).st_value; \
+               (dst_sym).st_size = (src_sym).st_size;   \
        } while (0)
 
 #ifndef ELFCLASSNUM
This page took 0.025664 seconds and 4 git commands to generate.