Fix compiler warnings on AMD64 Linux.
authorMichael Poole <mdpoole@troilus.org>
Fri, 7 Oct 2005 02:51:12 +0000 (02:51 +0000)
committerMichael Poole <mdpoole@troilus.org>
Fri, 7 Oct 2005 02:51:12 +0000 (02:51 +0000)
src/gline.c (gline_alternate_target): Typecast format field precision
    argument.

src/helpfile.c (helpfile_eval_identifier): Likewise.
  (helpfile_eval_atomicexpr): Likewise.
  (helpfile_eval_expr): Likewise.
  (helpfile_eval_condition): Likewise.

src/log.c (log_audit): Change typecast used to make types compatible.

src/main.c (set_item_rlimit): Use long instead of int as contained value.

src/sendmail.c (send_flowed_text): Typecast format field precision
    argument.
git-archimport-id: srvx@srvx.net--2005-srvx/srvx--devo--1.3--patch-27

ChangeLog
src/gline.c
src/helpfile.c
src/log.c
src/main.c
src/sendmail.c

index 92a822f3ce04772e2eb2186f47e503ff2548bf73..1adaa85bd22379f0e4fac2237020ca15bb6e4fd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,33 @@
 # arch-tag: automatic-ChangeLog--srvx@srvx.net--2005-srvx/srvx--devo--1.3
 #
 
+2005-10-07 02:51:12 GMT        Michael Poole <mdpoole@troilus.org>     patch-27
+
+    Summary:
+      Fix compiler warnings on AMD64 Linux.
+    Revision:
+      srvx--devo--1.3--patch-27
+
+    src/gline.c (gline_alternate_target): Typecast format field precision
+        argument.
+    
+    src/helpfile.c (helpfile_eval_identifier): Likewise.
+      (helpfile_eval_atomicexpr): Likewise.
+      (helpfile_eval_expr): Likewise.
+      (helpfile_eval_condition): Likewise.
+    
+    src/log.c (log_audit): Change typecast used to make types compatible.
+    
+    src/main.c (set_item_rlimit): Use long instead of int as contained value.
+    
+    src/sendmail.c (send_flowed_text): Typecast format field precision
+        argument.
+
+    modified files:
+     ChangeLog src/gline.c src/helpfile.c src/log.c src/main.c
+     src/sendmail.c
+
+
 2005-08-14 01:34:04 GMT        Michael Poole <mdpoole@troilus.org>     patch-26
 
     Summary:
index ae8600c94c81587a901138b6eec745de3a35159c..8071f370adcedaa93dcec9ca7a1980bdd17d6131 100644 (file)
@@ -186,13 +186,13 @@ gline_alternate_target(const char *target)
         if (inet_aton(hostname+1, &in)
             && (he = gethostbyaddr((char*)&in, sizeof(in), AF_INET))) {
             res = malloc((hostname - target) + 2 + strlen(he->h_name));
-            sprintf(res, "%.*s@%s", hostname - target, target, he->h_name);
+            sprintf(res, "%.*s@%s", (int)(hostname - target), target, he->h_name);
             return res;
         } else
             return NULL;
     } else if (getipbyname(hostname+1, &ip)) {
         res = malloc((hostname - target) + 18);
-        sprintf(res, "%.*s@%lu.%lu.%lu.%lu", hostname - target, target, ip & 255, (ip >> 8) & 255, (ip >> 16) & 255, (ip >> 24) & 255);
+        sprintf(res, "%.*s@%lu.%lu.%lu.%lu", (int)(hostname - target), target, ip & 255, (ip >> 8) & 255, (ip >> 16) & 255, (ip >> 24) & 255);
         return res;
     } else
         return NULL;
index e5aca29edec0b07b6df8cdc464f4a0c2002e0bd1..27fc614b16564b9c51acacd6b812c16d0745f135 100644 (file)
@@ -806,7 +806,7 @@ helpfile_eval_identifier(const char *start, const char **end)
         *end = start + 5;
         return 0;
     } else {
-        log_module(MAIN_LOG, LOG_FATAL, "Unexpected helpfile identifier '%.*s'.", *end-start, start);
+        log_module(MAIN_LOG, LOG_FATAL, "Unexpected helpfile identifier '%.*s'.", (int)(*end-start), start);
         return -1;
     }
 }
@@ -838,7 +838,7 @@ helpfile_eval_atomicexpr(const char *start, const char **end)
     while (isspace(*sep) && (sep < *end))
         sep++;
     if ((sep == *end) || (sep[0] != ')')) {
-        log_module(MAIN_LOG, LOG_FATAL, "Expected close parenthesis at '%.*s'.", *end-sep, sep);
+        log_module(MAIN_LOG, LOG_FATAL, "Expected close parenthesis at '%.*s'.", (int)(*end-sep), sep);
         return -1;
     }
 
@@ -875,7 +875,7 @@ helpfile_eval_expr(const char *start, const char **end)
         sep += len;
     }
     if (op == OP_INVALID) {
-        log_module(MAIN_LOG, LOG_FATAL, "Unrecognized helpfile operator at '%.*s'.", *end-sep, sep);
+        log_module(MAIN_LOG, LOG_FATAL, "Unrecognized helpfile operator at '%.*s'.", (int)(*end-sep), sep);
         return -1;
     }
 
@@ -889,7 +889,7 @@ helpfile_eval_expr(const char *start, const char **end)
     while (isspace(*sep2) && (sep2 < *end))
         sep2++;
     if (sep2 != *end) {
-        log_module(MAIN_LOG, LOG_FATAL, "Trailing garbage in helpfile expression: '%.*s'.", *end-sep2, sep2);
+        log_module(MAIN_LOG, LOG_FATAL, "Trailing garbage in helpfile expression: '%.*s'.", (int)(*end-sep2), sep2);
         return -1;
     }
 
@@ -916,7 +916,7 @@ helpfile_eval_condition(const char *start, const char **end)
     for (term = start; isalnum(*term) && (term < *end); ++term) ;
     if (term != start) {
         if ((term + 2 >= *end) || (term[0] != ':') || (term[1] != ' ')) {
-            log_module(MAIN_LOG, LOG_FATAL, "In helpfile condition '%.*s' expected prefix to end with ': '.", *end-start, start);
+            log_module(MAIN_LOG, LOG_FATAL, "In helpfile condition '%.*s' expected prefix to end with ': '.", (int)(*end-start), start);
             return -1;
         }
         start = term + 2;
index ef64835cec99f8b27e1a41b103499c818f9ee722..11ec27f996df82411543317e43955e02d1fbcde7 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -527,7 +527,7 @@ log_audit(struct log_type *type, enum log_severity sev, struct userNode *user, s
     /* remove old elements from the linked list */
     while (type->log_count > type->max_count)
         log_type_free_oldest(type);
-    while (type->log_oldest && (type->log_oldest->time + type->max_age < (unsigned long)now))
+    while (type->log_oldest && (type->log_oldest->time + (time_t)type->max_age < now))
         log_type_free_oldest(type);
     if (type->log_oldest)
         type->log_oldest->prev = 0;
index cd461c583440bfcf8fdf787855657841339e9f8f..7c6e2cd64077ea56d33697600a22ed34fa449750 100644 (file)
@@ -565,12 +565,13 @@ conf_globals(void)
 static int
 set_item_rlimit(const char *name, void *data, void *extra)
 {
-    int rsrc, found;
+    long rsrc;
+    int found;
     struct record_data *rd = data;
     struct rlimit rlim;
     const char *str;
 
-    rsrc = (int)dict_find(extra, name, &found);
+    rsrc = (long)dict_find(extra, name, &found);
     if (!found) {
         log_module(MAIN_LOG, LOG_ERROR, "Invalid rlimit \"%s\" in rlimits section.", name);
         return 0;
index 63fe69b9afe11acd3a245033dd8531eb7e411c9a..63bb54890ef65ba1e07883d583e6492f2793eea7 100644 (file)
@@ -83,7 +83,7 @@ send_flowed_text(FILE *where, const char *para)
             break;
         } else if (eol && (eol < para + (80 - shift))) {
             /* Newline inside paragraph, no need to wrap. */
-            fprintf(where, "%.*s\n", eol - para, para);
+            fprintf(where, "%.*s\n", (int)(eol - para), para);
             para = eol + 1;
         } else {
             int pos;