Browse code

fix type errors

git-svn: trunk@5059

Tomasz Kojm authored on 2009/05/05 23:14:40
Showing 5 changed files
... ...
@@ -81,10 +81,10 @@ static void printopts(struct optstruct *opts, int nondef)
81 81
 
82 82
 	    case TYPE_NUMBER:
83 83
 	    case TYPE_SIZE:
84
-		printf("%s = \"%d\"", opts->name, opts->numarg);
84
+		printf("%s = \"%lld\"", opts->name, opts->numarg);
85 85
 		opt = opts;
86 86
 		while((opt = opt->nextarg))
87
-		    printf(", \"%d\"", opt->numarg);
87
+		    printf(", \"%lld\"", opt->numarg);
88 88
 		printf("\n");
89 89
 		break;
90 90
 
... ...
@@ -143,7 +143,7 @@ static int printconf(const char *name)
143 143
 
144 144
 		case TYPE_NUMBER:
145 145
 		    if(cpt->numarg != -1)
146
-			printf("# Default: %d\n", cpt->numarg);
146
+			printf("# Default: %lld\n", cpt->numarg);
147 147
 		    else
148 148
 			printf("# Default: disabled\n");
149 149
 		    break;
... ...
@@ -151,7 +151,7 @@ static int printconf(const char *name)
151 151
 		case TYPE_SIZE:
152 152
 		    printf("# You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes)\n# and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes). To specify the size\n# in bytes just don't use modifiers.\n");
153 153
 		    if(cpt->numarg != -1)
154
-			printf("# Default: %d\n", cpt->numarg);
154
+			printf("# Default: %lld\n", cpt->numarg);
155 155
 		    else
156 156
 			printf("# Default: disabled\n");
157 157
 		    break;
... ...
@@ -405,7 +405,7 @@ int main(int argc, char **argv)
405 405
 
406 406
     if((opt = optget(opts, "DevACDepth"))->enabled) {
407 407
         cl_engine_set_num(engine, CL_ENGINE_AC_MAXDEPTH, opt->numarg);
408
-	logg("#Max A-C depth set to %u\n", opt->numarg);
408
+	logg("#Max A-C depth set to %u\n", (unsigned int) opt->numarg);
409 409
     }
410 410
 
411 411
     if((ret = cl_load(dbdir, engine, &sigs, dboptions))) {
... ...
@@ -60,8 +60,7 @@ int tcpserver(const struct optstruct *opts)
60 60
 {
61 61
     struct sockaddr_in server;
62 62
     int sockfd, backlog;
63
-    struct hostent he;
64
-    char *estr, buf[1024];
63
+    char *estr;
65 64
     int true = 1;
66 65
 
67 66
     if (cfg_tcpsock(opts, &server, INADDR_ANY) == -1) {
... ...
@@ -86,9 +85,9 @@ int tcpserver(const struct optstruct *opts)
86 86
     } else {
87 87
 	const struct optstruct *taddr = optget(opts, "TCPAddr");
88 88
 	if(taddr->enabled)
89
-	    logg("#TCP: Bound to address %s on port %u\n", taddr->strarg, optget(opts, "TCPSocket")->numarg);
89
+	    logg("#TCP: Bound to address %s on port %u\n", taddr->strarg, (unsigned int) optget(opts, "TCPSocket")->numarg);
90 90
 	else
91
-	    logg("#TCP: Bound to port %u\n", optget(opts, "TCPSocket")->numarg);
91
+	    logg("#TCP: Bound to port %u\n", (unsigned int) optget(opts, "TCPSocket")->numarg);
92 92
     }
93 93
 
94 94
     backlog = optget(opts, "MaxConnectionQueueLength")->numarg;
... ...
@@ -1147,7 +1147,7 @@ static void setup_connections(int argc, char *argv[])
1147 1147
 		if ((opt_addr = optget(clamd_opts, "TCPAddr"))->enabled) {
1148 1148
 		    host = opt_addr->strarg;
1149 1149
 		}
1150
-		snprintf(buf, sizeof(buf), "%s:%u", host, opt->numarg);
1150
+		snprintf(buf, sizeof(buf), "%s:%llu", host, opt->numarg);
1151 1151
 		conn = strdup(buf);
1152 1152
 	    } else {
1153 1153
 		fprintf(stderr, "Can't find how to connect to clamd\n");
... ...
@@ -110,7 +110,7 @@ int notify(const char *cfgfile)
110 110
 	hints.ai_family = AF_INET;
111 111
 #endif
112 112
 	hints.ai_socktype = SOCK_STREAM;
113
-	snprintf(port, 5, "%d", opt->numarg);
113
+	snprintf(port, 5, "%d", (unsigned int) opt->numarg);
114 114
 	port[5] = 0;
115 115
 
116 116
 	if((opt = optget(opts, "TCPAddr"))->enabled)