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

Commit f834d76b authored by Myles Watson's avatar Myles Watson Committed by android-build-merger
Browse files

Require a semicolon after ASSERT

am: 3d9b2f8b

Change-Id: I15734a820b5a67733babd0aae0263f8f97edc508
parents 7b8d3dc7 3d9b2f8b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ void Reactor::Stop() {
    LOG_WARN("not running, will stop once it's started");
  }
  auto control = eventfd_write(control_fd_, 1);
  ASSERT(control != -1)
  ASSERT(control != -1);
}

Reactor::Reactable* Reactor::Register(int fd, Closure on_read_ready, Closure on_write_ready) {
@@ -152,7 +152,7 @@ Reactor::Reactable* Reactor::Register(int fd, Closure on_read_ready, Closure on_
  };
  int register_fd;
  RUN_NO_INTR(register_fd = epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, fd, &event));
  ASSERT(register_fd != -1)
  ASSERT(register_fd != -1);
  return reactable;
}

+15 −13
Original line number Diff line number Diff line
@@ -39,8 +39,7 @@
/* syslog didn't work well here since we would be redefining LOG_DEBUG. */
#include <stdio.h>

#define LOGWRAPPER(fmt, args...) \
  fprintf(stderr, "%s - %s: " fmt "\n", LOG_TAG, __PRETTY_FUNCTION__, ##args)
#define LOGWRAPPER(fmt, args...) fprintf(stderr, "%s - %s: " fmt "\n", LOG_TAG, __PRETTY_FUNCTION__, ##args)

#define LOG_VERBOSE(...) LOGWRAPPER(__VA_ARGS__)
#define LOG_DEBUG(...) LOGWRAPPER(__VA_ARGS__)
@@ -51,14 +50,17 @@
#endif /* defined(OS_ANDROID) */

#define ASSERT(condition)                                                       \
  do {                                                                          \
    if (!(condition)) {                                                         \
      LOG_ERROR("%s:%d assertion '" #condition "' failed", __FILE__, __LINE__); \
      abort();                                                                  \
  }
    }                                                                           \
  } while (false)

#define ASSERT_LOG(condition, fmt, args...)                                                    \
  do {                                                                                         \
    if (!(condition)) {                                                                        \
      LOG_ERROR("%s:%d assertion '" #condition "' failed - " fmt, __FILE__, __LINE__, ##args); \
      abort();                                                                                 \
  }
    }                                                                                          \
  } while (false)