From 9b44d6fd226fc051ac5d46ecef0376122205c87d Mon Sep 17 00:00:00 2001 From: swhite Date: Thu, 2 Mar 2006 14:46:41 +0000 Subject: As discussed in today's Cactus call, applying patches from 14 Feb Patches mailing list. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4263 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/util/ParseFile.c | 18 +++++++++--------- src/util/snprintf.c | 17 +++++++++-------- 2 files changed, 18 insertions(+), 17 deletions(-) (limited to 'src/util') diff --git a/src/util/ParseFile.c b/src/util/ParseFile.c index 0dc9863d..59d6abcc 100644 --- a/src/util/ParseFile.c +++ b/src/util/ParseFile.c @@ -186,7 +186,7 @@ int ParseFile(FILE *ifp, /* Token character */ if (intoken && c != '=') { - tokens[intoken++] = c; + tokens[intoken++] = (char)c; CheckBuf(intoken,lineno); } @@ -195,7 +195,7 @@ int ParseFile(FILE *ifp, if (c != ' ' && c != '\t' && c != '\n' && c != '\r' && !inval && !intoken) { intoken = 0; - tokens[intoken++] = c; + tokens[intoken++] = (char)c; } /* End of a token signified by an = */ @@ -257,7 +257,7 @@ int ParseFile(FILE *ifp, /* Make an important decision NOT to include * line feeds in the string parameters */ - if (c != '\n') value[p++] = c; + if (c != '\n') value[p++] = (char)c; if (c == '\n') { printf ("Warning: Quoted string contains newline for token %s\n", @@ -314,7 +314,7 @@ int ParseFile(FILE *ifp, { int p = 0; - value[p++] = c; + value[p++] = (char)c; if (ntokens == 1) { /* Simple case. We have an int @@ -326,7 +326,7 @@ int ParseFile(FILE *ifp, #endif while (!(c==' ' || c=='\t' || c == '\n' || c == '\r' || c == EOF)) { - value[p++] = c; + value[p++] = (char)c; CheckBuf(p,lineno); c = fgetc(ifp); #ifdef DEBUG @@ -354,7 +354,7 @@ int ParseFile(FILE *ifp, int pp=0, i; int pt, pv; - value[pp++] = c; + value[pp++] = (char)c; /* OK, since we only have numbers in the old input stream, we can go along getting ntokens-1 commas, stripping spaces, and @@ -368,7 +368,7 @@ int ParseFile(FILE *ifp, { if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) { - value[pp++] = c; + value[pp++] = (char)c; CheckBuf(pp,lineno); } if (c == ',') ncommas ++; @@ -396,7 +396,7 @@ int ParseFile(FILE *ifp, } /* And tack the rest on */ - value[pp++] = c; + value[pp++] = (char)c; CheckBuf(p,lineno); c = fgetc(ifp); @@ -405,7 +405,7 @@ int ParseFile(FILE *ifp, #endif while (c != ' ' && c != '\t' && c != '\n' && c != '\r' && c != EOF) { - value[pp++] = c; + value[pp++] = (char)c; CheckBuf(pp,lineno); c = fgetc(ifp); #ifdef DEBUG diff --git a/src/util/snprintf.c b/src/util/snprintf.c index e5170038..6b4b5bb0 100644 --- a/src/util/snprintf.c +++ b/src/util/snprintf.c @@ -365,7 +365,8 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args) total += fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); break; case 'c': - total += dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); + total += dopr_outch (buffer, &currlen, maxlen, + (char)va_arg (args, int)); break; case 's': strvalue = va_arg (args, char *); @@ -381,7 +382,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args) { short int *num; num = va_arg (args, short int *); - *num = currlen; + *num = (short int)currlen; } else if (cflags == DP_C_LONG) { @@ -538,7 +539,7 @@ static int fmtint (char *buffer, size_t *currlen, size_t maxlen, /* Sign */ if (signvalue) - total += dopr_outch (buffer, currlen, maxlen, signvalue); + total += dopr_outch (buffer, currlen, maxlen, (char)signvalue); /* Zeros */ if (zpadlen > 0) @@ -590,7 +591,7 @@ static long myround (LDOUBLE value) { long intpart; - intpart = value; + intpart = (long)value; value = value - intpart; if (value >= 0.5) intpart++; @@ -668,7 +669,7 @@ static int fmtfp (char *buffer, size_t *currlen, size_t maxlen, } } - intpart = ufvalue; + intpart = (long)ufvalue; /* * Sorry, we only support 9 digits past the decimal because of our @@ -685,7 +686,7 @@ static int fmtfp (char *buffer, size_t *currlen, size_t maxlen, if (fracpart >= mypow10 (max)) { intpart++; - fracpart -= mypow10 (max); + fracpart -= (long)mypow10 (max); } #ifdef DEBUG_SNPRINTF @@ -752,7 +753,7 @@ static int fmtfp (char *buffer, size_t *currlen, size_t maxlen, { if (signvalue) { - total += dopr_outch (buffer, currlen, maxlen, signvalue); + total += dopr_outch (buffer, currlen, maxlen, (char)signvalue); --padlen; signvalue = 0; } @@ -768,7 +769,7 @@ static int fmtfp (char *buffer, size_t *currlen, size_t maxlen, --padlen; } if (signvalue) - total += dopr_outch (buffer, currlen, maxlen, signvalue); + total += dopr_outch (buffer, currlen, maxlen, (char)signvalue); while (iplace > 0) total += dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); -- cgit v1.2.3