]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Fix the static and const correctness of a function
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 5 Nov 2015 20:01:39 +0000 (21:01 +0100)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 5 Nov 2015 20:01:39 +0000 (21:01 +0100)
I happened to stumble on that function that was unnecessarily declared as
global and without using const strings for strings that are not modified.

That's just a style problem.

datafile.c

index 35822063301253abd223860a6153f8cc5c4773a0..bb11b0ebe13b5e5970598e931fcd850e2bbcd15c 100644 (file)
@@ -27,7 +27,7 @@
 #include "include/conf.h"
 #include "include/defs.h"
 
-void saverecs(FILE *fp_ou, const struct userinfostruct *uinfo, long long int nacc, char *url, long long int nbytes, char *ip, char *hora, char *dia, long long int nelap, long long int incache, long long int oucache);
+static void saverecs(FILE *fp_ou, const struct userinfostruct *uinfo, long long int nacc, const char *url, long long int nbytes, const char *ip, const char *hora, const char *dia, long long int nelap, long long int incache, long long int oucache);
 
 void data_file(char *tmp)
 {
@@ -210,7 +210,7 @@ void data_file(char *tmp)
                debuga(__FILE__,__LINE__,_("Datafile %s written successfully\n"),DataFile);
 }
 
-void saverecs(FILE *fp_ou, const struct userinfostruct *uinfo, long long int nacc, char *url, long long int nbytes, char *ip, char *hora, char *dia, long long int nelap, long long int incache, long long int oucache)
+static void saverecs(FILE *fp_ou, const struct userinfostruct *uinfo, long long int nacc, const char *url, long long int nbytes, const char *ip, const char *hora, const char *dia, long long int nelap, long long int incache, long long int oucache)
 {
        char val[20];
        char name[512];