[PATCH] fixes compilers warnings

Vincent CHAVANIS <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
This fixes:

1/
gwlib/charset.c: In function 'charset_convert':
gwlib/charset.c:635: attention : format '%d' expects type 'int', but argument 3 has type 'long int'
gwlib/charset.c:669: attention : format '%d' expects type 'int', but argument 4 has type 'long int'

2/
/* now make it const - This should not be modifiable */
gwlib/date.c:69: attention : pointer targets in initialization differ in signedness
gwlib/date.c:69: attention : pointer targets in initialization differ in signedness
gwlib/date.c:69: attention : pointer targets in initialization differ in signedness
gwlib/date.c:69: attention : pointer targets in initialization differ in signedness
gwlib/date.c:69: attention : pointer targets in initialization differ in signedness
gwlib/date.c:69: attention : pointer targets in initialization differ in signedness
gwlib/date.c:70: attention : pointer targets in initialization differ in signedness
gwlib/date.c:73: attention : pointer targets in initialization differ in signedness
gwlib/date.c:73: attention : pointer targets in initialization differ in signedness
gwlib/date.c:73: attention : pointer targets in initialization differ in signedness
gwlib/date.c:73: attention : pointer targets in initialization differ in signedness
gwlib/date.c:73: attention : pointer targets in initialization differ in signedness
gwlib/date.c:73: attention : pointer targets in initialization differ in signedness
gwlib/date.c:74: attention : pointer targets in initialization differ in signedness
gwlib/date.c:74: attention : pointer targets in initialization differ in signedness
gwlib/date.c:74: attention : pointer targets in initialization differ in signedness
gwlib/date.c:74: attention : pointer targets in initialization differ in signedness
gwlib/date.c:74: attention : pointer targets in initialization differ in signedness
gwlib/date.c:75: attention : pointer targets in initialization differ in signedness




-- 
Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR)
Service Technique/Reseau - NOC
Direction du Developpement xMS+
http://www.telemaque.fr/
[email protected]
Tel : +33 4 92 90 99 84 (fax 9142)
charset_c_warn.txt (text/plain, 1 KB)
--- /gateway-cvs/gwlib/charset.c        2009-03-13 11:16:22.000000000 +0100
+++ /gateway/gwlib/charset.c    2009-04-16 13:55:51.000000000 +0200
@@ -631,7 +631,7 @@
                 break;
             case EILSEQ: /* invalid multibyte sequence */
             case EINVAL: /* incomplete multibyte sequence */
-                warning(0, "Invalid/Incomplete multibyte sequence at position %d, skeep it.",
+                warning(0, "Invalid/Incomplete multibyte sequence at position %ld, skeep it.",
                         from_buf - octstr_get_cstr(string));
                 /* skeep char and try next */
                 if (outbytesleft == 0) {
@@ -665,7 +665,7 @@
         error(errno,"Failed to convert string from <%s> to <%s>.", charset_from, charset_to);
 
     if (errno == EILSEQ) {
-        debug("charset_convert", 0, "Found an invalid multibyte sequence at position <%d>",
+        debug("charset_convert", 0, "Found an invalid multibyte sequence at position <%ld>",
               from_buf - octstr_get_cstr(string));     
     }
     gw_free(to_buf);
date_fix.txt (text/plain, 484 B)
--- /gateway-cvs/gwlib/date.c   2009-03-13 23:17:26.000000000 +0100
+++ /gateway/gwlib/date.c       2009-04-16 14:22:03.000000000 +0200
@@ -65,11 +65,11 @@
 
 #include "gwlib.h"
 
-static unsigned char *wkday[7] = {
+static char const *wkday[7] = {
     "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
 };
 
-static unsigned char *monthname[12] = {
+static char const *monthname[12] = {
     "Jan", "Feb", "Mar", "Apr", "May", "Jun",
     "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
 };
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.