]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Ported r157 from branches/v2_2_6_1 (remove warnings if no libgd)
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 14 Dec 2009 08:04:08 +0000 (08:04 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 14 Dec 2009 08:04:08 +0000 (08:04 +0000)
ChangeLog
grepday.c

index 2c0a13e91ff04564d300568b5e9adceedb61f611..b4bcb722bb7bf6fff6cfb3b9c1ccf8d8d0e69faf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@ Dec-09-2009 Version 2.2.6.1
                - Fix user agent report font size and statistics on user agent.
                - Test for the availability of -Werror=format-security in gcc (thanks to Maxim Britov).
                - Test the existence of bzero with autoconf and don't redefine it (tkanks to Maxim Britov).
+               - Remove warnings if libgd is not available.
 
 Oct-14-2009 Version 2.2.6
                - Protection against buffer overflows in getword and friends and report the origin of the error instead of always blaming access.log.
index 90dce44968485dece2cdd32042db8a95a8dbd0ba..aff71f0f88b9cf375b57a23ebb0242b749ab4d6c 100644 (file)
--- a/grepday.c
+++ b/grepday.c
@@ -26,6 +26,8 @@
 #include "include/conf.h"
 #include "include/defs.h"
 
+#if defined(HAVE_GD) && defined(HAVE_ICONV_H) && defined(gdFTEX_Unicode)
+
 static int blue;
 static int white;
 static int lavender;
@@ -39,7 +41,6 @@ static int black;
 //static char *font1 = FONTDIR"/FreeSans.ttf";
 static char *font1 = FONTDIR"/DejaVuSans.ttf";
 
-#if defined(HAVE_GD) && defined(HAVE_ICONV_H) && defined(gdFTEX_Unicode)
 #include <iconv.h>
 #define SARGgdImageStringFT I18NgdImageStringFT
 
@@ -74,9 +75,9 @@ static char * I18NgdImageStringFT (gdImage * im, int *brect, int fg, char *fontl
 #define SARGgdImageStringFT gdImageStringFT
 #endif
 
+#ifdef HAVE_GD
 static void bar(int x1,long long int n)
 {
-#ifdef HAVE_GD
    gdPoint points[4];
    int brect[8];
    int val=0, x;
@@ -226,12 +227,13 @@ static void bar(int x1,long long int n)
    points[3].y = 420;
    gdImageFilledPolygon(im, points, 4, color2);
 
-#endif
    return;
 }
+#endif
 
 void greport_day(const char *user)
 {
+#ifdef HAVE_GD
    FILE *fp_in, *pngout;
    int x, y;
    int x1;
@@ -252,8 +254,6 @@ void greport_day(const char *user)
    int cstatus;
    char s[15];
 
-#ifdef HAVE_GD
-
    if(strcmp(Graphs,"yes") != 0) {
       unlink(wdirname);
       return;