Merge branch 't/cleanups'
authorAndre Noll <maan@systemlinux.org>
Wed, 15 Aug 2012 09:32:10 +0000 (11:32 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 15 Aug 2012 09:32:10 +0000 (11:32 +0200)
The changes in this branch are an attempt to make dss compile cleanly
with the more strict compiler flags (GCC 4.6 on Linux).

    -pedantic -fno-common -W -Wall -Wcast-align -Wformat=2
    -Wpointer-arith -Wundef -Waggregate-return -Wcast-qual
    -Wmissing-declarations -Wnested-externs -Wstrict-prototypes

This is only a first step that addresses the easier warnings. Some,
like the ones stemming from the variadic macros, have yet to be fixed.

* 9e6c2f Remove some debug messages.
* 899f88 string.c: Fix a statement-before-declaration issue.
* 83ebb4 Remove trailing commas.
* 2ed0d7 snap.h: Fix HSA_ITEM.
* 508350 Fix "comma after last element" warning.
* 97fbf4 compare_snapshots(): Add const keyword.
* b28495 Avoid per-element initializers.
* 9528cf dss.c: Fix initialization of argv[].
* 4526f9 dss.c: Remove redundant const.
* 2183c6 Makefile: Split CPPFLAGS.

Conflicts:
error.h

1  2 
Makefile
dss.c
error.h

diff --cc Makefile
Simple merge
diff --cc dss.c
Simple merge
diff --cc error.h
index 2b62611cc68937517f171148014ac2d124d9dd16,accd5fd9781fab1920d085991fc993add332fc30..14cc032fae65f621ade9c419d682f0252b7ad0ac
+++ b/error.h
@@@ -38,24 -38,22 +38,23 @@@ static inline char *dss_strerror(int nu
  }
  
  #define DSS_ERRORS \
-       DSS_ERROR(SUCCESS, "success") \
-       DSS_ERROR(SYNTAX, "syntax error") \
-       DSS_ERROR(ATOI_OVERFLOW, "value too large") \
-       DSS_ERROR(STRTOLL, "unknown strtoll error") \
-       DSS_ERROR(ATOI_NO_DIGITS, "no digits found in string") \
-       DSS_ERROR(ATOI_JUNK_AT_END, "further characters after number") \
-       DSS_ERROR(INVALID_NUMBER, "invalid number") \
-       DSS_ERROR(STRFTIME, "strftime() failed") \
-       DSS_ERROR(LOCALTIME, "localtime() failed") \
-       DSS_ERROR(NULL_OPEN, "can not open /dev/null") \
-       DSS_ERROR(DUP_PIPE, "exec error: can not create pipe") \
-       DSS_ERROR(INVOLUNTARY_EXIT, "unexpected termination cause") \
-       DSS_ERROR(BAD_EXIT_CODE, "unexpected exit code") \
-       DSS_ERROR(SIGNAL_SIG_ERR, "signal() returned SIG_ERR") \
-       DSS_ERROR(SIGNAL, "caught terminating signal") \
-       DSS_ERROR(BUG, "values of beta might cause dom!") \
-       DSS_ERROR(NOT_RUNNING, "dss not running") \
+       DSS_ERROR(SUCCESS, "success"), \
+       DSS_ERROR(SYNTAX, "syntax error"), \
+       DSS_ERROR(ATOI_OVERFLOW, "value too large"), \
+       DSS_ERROR(STRTOLL, "unknown strtoll error"), \
+       DSS_ERROR(ATOI_NO_DIGITS, "no digits found in string"), \
+       DSS_ERROR(ATOI_JUNK_AT_END, "further characters after number"), \
+       DSS_ERROR(INVALID_NUMBER, "invalid number"), \
+       DSS_ERROR(STRFTIME, "strftime() failed"), \
+       DSS_ERROR(LOCALTIME, "localtime() failed"), \
+       DSS_ERROR(NULL_OPEN, "can not open /dev/null"), \
+       DSS_ERROR(DUP_PIPE, "exec error: can not create pipe"), \
+       DSS_ERROR(INVOLUNTARY_EXIT, "unexpected termination cause"), \
+       DSS_ERROR(BAD_EXIT_CODE, "unexpected exit code"), \
+       DSS_ERROR(SIGNAL_SIG_ERR, "signal() returned SIG_ERR"), \
+       DSS_ERROR(SIGNAL, "caught terminating signal"), \
 -      DSS_ERROR(BUG, "values of beta might cause dom!")
++      DSS_ERROR(BUG, "values of beta might cause dom!"), \
++      DSS_ERROR(NOT_RUNNING, "dss not running")
  
  /**
   * This is temporarily defined to expand to its first argument (prefixed by