Code

patches: Added compiler-warning-fixes.
authorSebastian Harl <sh@tokkee.org>
Fri, 8 May 2009 16:01:55 +0000 (18:01 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 8 May 2009 16:01:55 +0000 (18:01 +0200)
This is an upstream patch to fix some compiler warnings.

debian/changelog
debian/patches/compiler-warning-fixes [new file with mode: 0644]
debian/patches/series

index fb54573a2fa7a1663bd9bfcb6c72377b94f28763..f82314eb2d9595f7dea3b8796e11e5a3186edd93 100644 (file)
@@ -16,6 +16,8 @@ rrdtool (1.3.7-1) unstable; urgency=low
     - Added bts494874-gnu-kfreebsd to fix a FTBFS on GNU/kFreeBSD - thanks to
       Petr Salinger for the patch (Closes: #494874).
     - Added doc-fixes to fix a POD error in doc/rrdtutorial.pod.
+    - Added compiler-warning-fixes - upstream patch to fix some compiler
+      warnings.
   * debian/rules:
     - Remove src/librrd.sym in the clean target - this file is automatically
       created during the build but not cleaned up in the upstream Makefiles.
@@ -38,7 +40,7 @@ rrdtool (1.3.7-1) unstable; urgency=low
       dh_installexamples. This allows the use of --fail-missing when running
       dh_install.
 
- -- Sebastian Harl <sh@tokkee.org>  Tue, 07 Apr 2009 17:54:04 +0200
+ -- Sebastian Harl <sh@tokkee.org>  Fri, 08 May 2009 18:00:59 +0200
 
 rrdtool (1.3.1-4) unstable; urgency=high
 
diff --git a/debian/patches/compiler-warning-fixes b/debian/patches/compiler-warning-fixes
new file mode 100644 (file)
index 0000000..4948541
--- /dev/null
@@ -0,0 +1,257 @@
+diff a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb
+--- a/bindings/ruby/extconf.rb
++++ b/bindings/ruby/extconf.rb
+@@ -3,6 +3,8 @@
+ require 'mkmf'
++$CFLAGS += ' -Wall '
++
+ if /solaris/ =~ RUBY_PLATFORM
+    $LDFLAGS += '-R$(EPREFIX)/lib'
+ elsif /hpux/ =~ RUBY_PLATFORM
+diff a/bindings/ruby/main.c b/bindings/ruby/main.c
+--- a/bindings/ruby/main.c
++++ b/bindings/ruby/main.c
+@@ -4,6 +4,7 @@
+ #include <unistd.h>
+ #include <ruby.h>
++#include <math.h>
+ #include "../../src/rrd_tool.h"
+ typedef struct string_arr_t {
+@@ -19,6 +20,11 @@ typedef int (
+     int argc,
+     char **argv);
++typedef rrd_info_t *(
++    *RRDINFOFUNC) (
++    int argc,
++    char **argv);
++
+ #define RRD_CHECK_ERROR  \
+     if (rrd_test_error()) \
+       rb_raise(rb_eRRDError, rrd_get_error()); \
+@@ -142,7 +148,7 @@ VALUE rb_rrd_update(
+ /* Calls Returning Data via the Info Interface */
+ VALUE rb_rrd_infocall(
+-    RRDFUNC func,
++    RRDINFOFUNC func,
+     VALUE args)
+ {
+     string_arr a;
+@@ -173,9 +179,12 @@ VALUE rb_rrd_infocall(
+         case RD_I_STR:
+             rb_hash_aset(result, key, rb_str_new2(data->value.u_str));
+             break;
++        case RD_I_INT:
++            rb_hash_aset(result, key, INT2FIX(data->value.u_int));
++            break;
+         case RD_I_BLO:
+             rb_hash_aset(result, key,
+-                         rb_str_new(data->value.u_blo.ptr,
++                         rb_str_new((char *)data->value.u_blo.ptr,
+                                     data->value.u_blo.size));
+             break;
+         }
+diff a/bindings/tcl/tclrrd.c b/bindings/tcl/tclrrd.c
+--- a/bindings/tcl/tclrrd.c
++++ b/bindings/tcl/tclrrd.c
+@@ -97,7 +97,7 @@ static void getopt_squieeze(
+ /* Thread-safe version */
+ static int Rrd_Create(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -186,7 +186,8 @@ static int Rrd_Create(
+         return TCL_ERROR;
+     }
+-    rrd_create_r(argv2[1], pdp_step, last_up, argc - 2, argv2 + 2);
++    rrd_create_r(argv2[1], pdp_step, last_up, argc - 2,
++                 (const char **)argv2 + 2);
+     getopt_cleanup(argc, argv2);
+@@ -204,7 +205,7 @@ static int Rrd_Create(
+ /* Thread-safe version */
+ static int Rrd_Dump(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -233,7 +234,7 @@ static int Rrd_Dump(
+ /* Thread-safe version */
+ static int Rrd_Last(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -264,7 +265,7 @@ static int Rrd_Last(
+ /* Thread-safe version */
+ static int Rrd_Update(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -319,7 +320,7 @@ static int Rrd_Update(
+         return TCL_ERROR;
+     }
+-    rrd_update_r(argv2[1], template, argc - 2, argv2 + 2);
++    rrd_update_r(argv2[1], template, argc - 2, (const char **)argv2 + 2);
+     if (template != NULL) {
+         free(template);
+@@ -337,7 +338,7 @@ static int Rrd_Update(
+ }
+ static int Rrd_Lastupdate(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -350,6 +351,12 @@ static int Rrd_Lastupdate(
+     Tcl_Obj  *listPtr;
+     unsigned long ds_cnt, i;
++    if (argc != 2) {
++        Tcl_AppendResult(interp, "RRD Error: needs a single rrd filename",
++                         (char *) NULL);
++        return TCL_ERROR;
++    }
++
+     argv2 = getopt_init(argc, argv);
+     if (rrd_lastupdate(argc - 1, argv2, &last_update,
+                        &ds_cnt, &ds_namv, &last_ds) == 0) {
+@@ -379,7 +386,7 @@ static int Rrd_Lastupdate(
+ }
+ static int Rrd_Fetch(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -424,7 +431,7 @@ static int Rrd_Fetch(
+ static int Rrd_Graph(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -534,7 +541,7 @@ static int Rrd_Graph(
+ static int Rrd_Tune(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -558,7 +565,7 @@ static int Rrd_Tune(
+ static int Rrd_Resize(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+@@ -582,7 +589,7 @@ static int Rrd_Resize(
+ static int Rrd_Restore(
+-    ClientData clientData,
++    ClientData __attribute__((unused)) clientData,
+     Tcl_Interp *interp,
+     int argc,
+     CONST84 char *argv[])
+diff a/src/Makefile.am b/src/Makefile.am
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -12,6 +12,8 @@ endif
+ INCLUDES = -DLOCALEDIR="\"$(datadir)/locale\""
+ RRD_DEFAULT_FONT=@RRD_DEFAULT_FONT@
+ AM_CPPFLAGS = -DRRD_DEFAULT_FONT=\"$(RRD_DEFAULT_FONT)\" -DNUMVERS=@NUMVERS@
++AM_CFLAGS = @CFLAGS@
++## no including this by default @WERROR@
+ UPD_C_FILES =         \
+       rrd_parsetime.c \
+@@ -77,7 +79,7 @@ librrd_la_LDFLAGS         += -export-symbols librrd.sym
+ librrd_th_la_SOURCES         = $(UPD_C_FILES) $(RRD_C_FILES) rrd_thread_safe.c
+ librrd_th_la_DEPENDENCIES    = librrd.sym
+-librrd_th_la_CFLAGS          = $(MULTITHREAD_CFLAGS)
++librrd_th_la_CFLAGS          = $(AM_CFLAGS) $(MULTITHREAD_CFLAGS)
+ librrd_th_la_LDFLAGS         = $(MULTITHREAD_LDFLAGS) -version-info @LIBVERS@
+ librrd_th_la_LDFLAGS         += -export-symbols librrd.sym
+ librrd_th_la_LIBADD          = $(ALL_LIBS)
+diff a/src/rrd_dump.c b/src/rrd_dump.c
+--- a/src/rrd_dump.c
++++ b/src/rrd_dump.c
+@@ -58,8 +58,7 @@
+ extern char *tzname[2];
+ #endif
+-
+-int rrd_dump_opt_r(
++static int rrd_dump_opt_r(
+     const char *filename,
+     char *outname,
+     int opt_noheader)
+diff a/src/rrd_gfx.c b/src/rrd_gfx.c
+--- a/src/rrd_gfx.c
++++ b/src/rrd_gfx.c
+@@ -124,7 +124,7 @@ static PangoLayout *gfx_prep_text(
+     const char *text)
+ {
+     PangoLayout  *layout = im->layout;
+-    PangoFontDescription *pfd;
++    const PangoFontDescription *pfd;
+     cairo_t  *cr = im->cr;
+     static double last_tabwidth = -1;
+diff a/src/rrd_open.c b/src/rrd_open.c
+--- a/src/rrd_open.c
++++ b/src/rrd_open.c
+@@ -389,9 +389,9 @@ void rrd_dontneed(
+     rrd_t *rrd)
+ {
+ #if defined USE_MADVISE || defined HAVE_POSIX_FADVISE
+-    unsigned long dontneed_start;
+-    unsigned long rra_start;
+-    unsigned long active_block;
++    off_t dontneed_start;
++    off_t rra_start;
++    off_t active_block;
+     unsigned long i;
+     ssize_t   _page_size = sysconf(_SC_PAGESIZE);
+diff a/src/rrd_xport.c b/src/rrd_xport.c
+--- a/src/rrd_xport.c
++++ b/src/rrd_xport.c
+@@ -228,7 +228,7 @@ int rrd_xport_fn(
+             ref_list[xport_counter++] = i;
+             *step_list_ptr = im->gdes[im->gdes[i].vidx].step;
+             /* printf("%s:%lu\n",im->gdes[i].legend,*step_list_ptr); */
+-            *step_list_ptr++;
++            step_list_ptr++;
+             /* reserve room for one legend entry */
+             /* is FMT_LEG_LEN + 5 the correct size? */
+             if ((legend_list[j] =
index 20d11b2a0b531133349a131cf2482ab021c61441..ae66800ab04431d54822698b668c668d5619bedf 100644 (file)
@@ -4,4 +4,5 @@ setup.py-module-name
 no-rpath-for-ruby
 no-rpath-for-perl
 implicit-decl-fix
+compiler-warning-fixes
 doc-fixes