Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c713bce9 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Fix misc-macro-parentheses warnings in init and other core modules.

Bug: 28705665
Change-Id: Ice67cebb8c42538f8fb9cf1756678f41a9d68a31
parent 9b0eb7cd
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -194,13 +194,13 @@ class ErrnoRestorer {

// Helper for CHECK_STRxx(s1,s2) macros.
#define CHECK_STROP(s1, s2, sense)                                         \
  if (LIKELY((strcmp(s1, s2) == 0) == sense))                              \
  if (LIKELY((strcmp(s1, s2) == 0) == (sense)))                            \
    ;                                                                      \
  else                                                                     \
    ABORT_AFTER_LOG_FATAL                                                  \
    LOG(FATAL) << "Check failed: "                                         \
               << "\"" << s1 << "\""                                       \
               << (sense ? " == " : " != ") << "\"" << s2 << "\""
               << "\"" << (s1) << "\""                                     \
               << ((sense) ? " == " : " != ") << "\"" << (s2) << "\""

// Check for string (const char*) equality between s1 and s2, LOG(FATAL) if not.
#define CHECK_STREQ(s1, s2) CHECK_STROP(s1, s2, true)
@@ -213,7 +213,7 @@ class ErrnoRestorer {
    if (rc != 0) {                                                     \
      errno = rc;                                                      \
      ABORT_AFTER_LOG_FATAL                                            \
      PLOG(FATAL) << #call << " failed for " << what; \
      PLOG(FATAL) << #call << " failed for " << (what);                \
    }                                                                  \
  } while (false)

+2 −2
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@

#include <sys/cdefs.h>

#define FS_MGR_SETUP_VERITY_DISABLED -2
#define FS_MGR_SETUP_VERITY_FAIL -1
#define FS_MGR_SETUP_VERITY_DISABLED (-2)
#define FS_MGR_SETUP_VERITY_FAIL (-1)
#define FS_MGR_SETUP_VERITY_SUCCESS 0

__BEGIN_DECLS
+3 −3
Original line number Diff line number Diff line
@@ -80,11 +80,11 @@ void fs_mgr_free_fstab(struct fstab *fstab);
#define FS_MGR_MNTALL_DEV_NEEDS_ENCRYPTION 2
#define FS_MGR_MNTALL_DEV_MIGHT_BE_ENCRYPTED 1
#define FS_MGR_MNTALL_DEV_NOT_ENCRYPTED 0
#define FS_MGR_MNTALL_FAIL -1
#define FS_MGR_MNTALL_FAIL (-1)
int fs_mgr_mount_all(struct fstab *fstab);

#define FS_MGR_DOMNT_FAILED -1
#define FS_MGR_DOMNT_BUSY -2
#define FS_MGR_DOMNT_FAILED (-1)
#define FS_MGR_DOMNT_BUSY (-2)
int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device,
                    char *tmp_mount_point);
int fs_mgr_do_tmpfs_mount(char *n_name);
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ static void parse_line_device(struct parse_state *state, int nargs, char **args)
#include "ueventd_keywords.h"

#define KEYWORD(symbol, flags, nargs) \
    [ K_##symbol ] = { #symbol, nargs + 1, flags, },
    [ K_##symbol ] = { #symbol, (nargs) + 1, flags, },

static struct {
    const char *name;
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#define UTF16_REPLACEMENT_CHAR 0xfffd

/* Clever trick from Dianne that returns 1-4 depending on leading bit sequence*/
#define UTF8_SEQ_LENGTH(ch) (((0xe5000000 >> ((ch >> 3) & 0x1e)) & 3) + 1)
#define UTF8_SEQ_LENGTH(ch) (((0xe5000000 >> (((ch) >> 3) & 0x1e)) & 3) + 1)

/* note: macro expands to multiple lines */
#define UTF8_SHIFT_AND_MASK(unicode, byte)  \
Loading