Skip to content

Commit

Permalink
fix compiler warnings [-Wextra-semi-stmt]
Browse files Browse the repository at this point in the history
  • Loading branch information
janmojzis committed Nov 11, 2024
1 parent 24db217 commit fe255f6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
#include "e.h"
#include "log.h"

#define bug_(a, b) do { log_9_(-1, 0, a, b, 0, 0, 0, 0, 0, 0, 0, 0, 0); global_die(111); } while (0);
#define bug_(a, b) do { log_9_(-1, 0, a, b, 0, 0, 0, 0, 0, 0, 0, 0, 0); global_die(111); } while (0)
#define bug() bug_(__FILE__, __LINE__)

#define bug_nomem() do { errno = ENOMEM; bug(); } while (0);
#define bug_proto() do { errno = EPROTO; bug(); } while (0);
#define bug_inval() do { errno = EINVAL; bug(); } while (0);
#define bug_nomem() do { errno = ENOMEM; bug(); } while (0)
#define bug_proto() do { errno = EPROTO; bug(); } while (0)
#define bug_inval() do { errno = EINVAL; bug(); } while (0)

#define bug_nomem_(a, b) do { errno = ENOMEM; bug_(a, b); } while (0);
#define bug_proto_(a, b) do { errno = EPROTO; bug_(a, b); } while (0);
#define bug_inval_(a, b) do { errno = EINVAL; bug_(a, b); } while (0);
#define bug_nomem_(a, b) do { errno = ENOMEM; bug_(a, b); } while (0)
#define bug_proto_(a, b) do { errno = EPROTO; bug_(a, b); } while (0)
#define bug_inval_(a, b) do { errno = EINVAL; bug_(a, b); } while (0)

#endif
2 changes: 1 addition & 1 deletion e.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const char *e_str(int i)
{
X(0,"no error");
X(0,"no error")
X(EINTR,"interrupted system call")
X(ENOMEM,"out of memory")
X(ENOENT,"file does not exist")
Expand Down
26 changes: 13 additions & 13 deletions ssh.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <signal.h>
#include "ssh.h"

#define X(e,s) if (i == e) return s;
#define X(e,s) if (i == e) return s

/*
Return short name of signal.
Expand Down Expand Up @@ -57,40 +57,40 @@ Return long name of signal.
const char *ssh_sigstrlong(int i) {

#ifdef SIGABRT
X(SIGABRT, "SIGABRT (abort)")
X(SIGABRT, "SIGABRT (abort)");
#endif
#ifdef SIGALRM
X(SIGALRM, "SIGALRM (alarm clock)")
X(SIGALRM, "SIGALRM (alarm clock)");
#endif
#ifdef SIGFPE
X(SIGFPE, "SIGFPE (floating-point exception)")
X(SIGFPE, "SIGFPE (floating-point exception)");
#endif
#ifdef SIGILL
X(SIGILL, "SIGILL (illegal instruction)")
X(SIGILL, "SIGILL (illegal instruction)");
#endif
#ifdef SIGINT
X(SIGINT, "SIGINT (interrupt)")
X(SIGINT, "SIGINT (interrupt)");
#endif
#ifdef SIGKILL
X(SIGKILL, "SIGKILL (kill, unblockable)")
X(SIGKILL, "SIGKILL (kill, unblockable)");
#endif
#ifdef SIGPIPE
X(SIGPIPE, "SIGPIPE (broken pipe)")
X(SIGPIPE, "SIGPIPE (broken pipe)");
#endif
#ifdef SIGQUIT
X(SIGQUIT, "SIGQUIT (quit)")
X(SIGQUIT, "SIGQUIT (quit)");
#endif
#ifdef SIGSEGV
X(SIGSEGV, "SIGSEGV (segment violation)")
X(SIGSEGV, "SIGSEGV (segment violation)");
#endif
#ifdef SIGTERM
X(SIGTERM, "SIGTERM (termination)")
X(SIGTERM, "SIGTERM (termination)");
#endif
#ifdef SIGUSR1
X(SIGUSR1, "SIGUSR1 (user defined signal 1)")
X(SIGUSR1, "SIGUSR1 (user defined signal 1)");
#endif
#ifdef SIGUSR2
X(SIGUSR2, "SIGUSR2 (user defined signal 2)")
X(SIGUSR2, "SIGUSR2 (user defined signal 2)");
#endif

return "UNKNOWN SIGNAL";
Expand Down

0 comments on commit fe255f6

Please sign in to comment.