File: 040_fix-warnings-int.patch

package info (click to toggle)
mrtg 2.17.10-14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,216 kB
  • sloc: perl: 25,746; ansic: 4,568; sh: 1,518; php: 227; awk: 225; makefile: 196; csh: 49; exp: 16
file content (50 lines) | stat: -rw-r--r-- 1,800 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Description: Change type of col_XXX[]
Author: NAKAJIMA Yusaku <yupong7@gmail.com>
Origin: https://github.com/oetiker/mrtg/pull/102
Origin: https://github.com/oetiker/mrtg/pull/103
Bug: https://github.com/oetiker/mrtg/issues/99
Bug: https://github.com/oetiker/mrtg/issues/100
Last-Update: 2022-10-27
Index: mrtg/configure.ac
===================================================================
--- mrtg.orig/configure.ac
+++ mrtg/configure.ac
@@ -175,7 +175,7 @@ AC_MSG_RESULT((cached) it's fine)
 dnl Does the compiler like -Wall and
 if test "x$GCC" = "xyes"; then
   oCFLAGS=$CFLAGS
-  CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W"
+  CFLAGS="$CFLAGS -Wall -Wextra -Wpedantic -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline"
   AC_CACHE_CHECK(if we can use GCC-specific compiler options, rd_cv_gcc_opt,
                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0 ]])],[rd_cv_gcc_opt=yes],[rd_cv_gcc_opt=no ])
                ]
Index: mrtg/src/rateup.c
===================================================================
--- mrtg.orig/src/rateup.c
+++ mrtg/src/rateup.c
@@ -146,11 +146,11 @@ char weekformat = 'V';		/* strftime() fm
 #define c_outm  255,0,255
 #define c_outp  239,159,79
 
-int col_in[3];
-int col_out[3];
-int col_inm[3];
-int col_outm[3];
-int col_outp[3];
+unsigned int col_in[3];
+unsigned int col_out[3];
+unsigned int col_inm[3];
+unsigned int col_outm[3];
+unsigned int col_outp[3];
 
 long long kilo = (long long) 1000;
 char *kMG = (char *) NULL;
@@ -1772,7 +1772,7 @@ update (in, out, abs_max, absupdate)
 }
 
 static void
-init_colour (int *colmap, int c0, int c1, int c2)
+init_colour (unsigned int *colmap, int c0, int c1, int c2)
 {
   *colmap++ = c0;
   *colmap++ = c1;