]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add casts to remove error on warnings
authorJeff Lenk <jeff@jefflenk.com>
Thu, 10 Dec 2009 22:12:51 +0000 (22:12 +0000)
committerJeff Lenk <jeff@jefflenk.com>
Thu, 10 Dec 2009 22:12:51 +0000 (22:12 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15882 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_mprintf.c

index 64d83652b3b45ccfbcc19fcf05110169ab33e8f8..2b487170f1a9a96a19398abea6923933139c2a04 100644 (file)
@@ -245,7 +245,7 @@ static int vxprintf(
   char buf[etBUFSIZE];       /* Conversion buffer */
   char prefix;               /* Prefix character.  "+" or "-" or " " or '\0'. */
   etByte errorflag = 0;      /* True if an error is encountered */
-  etByte xtype;              /* Conversion paradigm */
+  etByte xtype = 0;          /* Conversion paradigm */
   char *zExtra;              /* Extra memory used for etTCLESCAPE conversions */
   static const char spaces[] =
    "                                                                         ";
@@ -517,7 +517,7 @@ static int vxprintf(
           *(bufpt++) = '0';
         }else{
           for(; e2>=0; e2--){
-            *(bufpt++) = et_getdigit(&realvalue,&nsd);
+            *(bufpt++) = (char)et_getdigit(&realvalue,&nsd);
           }
         }
         /* The decimal point */
@@ -531,7 +531,7 @@ static int vxprintf(
         }
         /* Significant digits after the decimal point */
         while( (precision--)>0 ){
-          *(bufpt++) = et_getdigit(&realvalue,&nsd);
+          *(bufpt++) = (char)et_getdigit(&realvalue,&nsd);
         }
         /* Remove trailing zeros and the "." if no digits follow the "." */
         if( flag_rtz && flag_dp ){
@@ -554,10 +554,10 @@ static int vxprintf(
             *(bufpt++) = '+';
           }
           if( exp>=100 ){
-            *(bufpt++) = (exp/100)+'0';                /* 100's digit */
+            *(bufpt++) = (char)(exp/100)+'0';                /* 100's digit */
             exp %= 100;
           }
-          *(bufpt++) = exp/10+'0';                     /* 10's digit */
+          *(bufpt++) = (char)exp/10+'0';                     /* 10's digit */
           *(bufpt++) = exp%10+'0';                     /* 1's digit */
         }
         *bufpt = 0;
@@ -593,9 +593,9 @@ static int vxprintf(
         break;
       case etCHARLIT:
       case etCHARX:
-        c = buf[0] = (xtype==etCHARX ? va_arg(ap,int) : *++fmt);
+        c = buf[0] = (char)(xtype==etCHARX ? va_arg(ap,int) : *++fmt);
         if( precision>=0 ){
-          for(idx=1; idx<precision; idx++) buf[idx] = c;
+          for(idx=1; idx<precision; idx++) buf[idx] = (char)c;
           length = precision;
         }else{
           length =1;
@@ -635,8 +635,8 @@ static int vxprintf(
         j = 0;
         if( needQuote ) bufpt[j++] = '\'';
         for(i=0; (ch=escarg[i])!=0; i++){
-          bufpt[j++] = ch;
-          if( ch=='\'' || ( xtype==etSQLESCAPE3 && ch=='\\')) bufpt[j++] = ch;
+          bufpt[j++] = (char)ch;
+          if( ch=='\'' || ( xtype==etSQLESCAPE3 && ch=='\\')) bufpt[j++] = (char)ch;
         }
         if( needQuote ) bufpt[j++] = '\'';
         bufpt[j] = 0;