ERR: Fixed compiler warnings when using strict ansi.

This commit is contained in:
Brad King 2002-06-18 17:19:38 -04:00
parent 589cf38a36
commit 05e162f00a
7 changed files with 17 additions and 4 deletions

View File

@ -3797,7 +3797,7 @@ int set_field_buffer(FIELD * field, int buffer, const char * value)
unsigned int i;
for(i=len; i<vlen; i++)
if (!isprint(value[i]))
if (!isprint((int)(value[i])))
RETURN(E_BAD_ARGUMENT);
}
len = vlen;

View File

@ -153,7 +153,7 @@ int form_request_by_name( const char *str )
strncpy(buf,str,sizeof(buf));
while( (i<sizeof(buf)) && (buf[i] != '\0') )
{
buf[i] = toupper(buf[i]);
buf[i] = toupper((int)(buf[i]));
i++;
}

View File

@ -115,6 +115,7 @@ static bool Check_AlphaNumeric_Field(FIELD * field, const void * argp)
+--------------------------------------------------------------------------*/
static bool Check_AlphaNumeric_Character(int c, const void * argp)
{
argp=0; /* Silence unused parameter warning. */
return (isalnum(c) ? TRUE : FALSE);
}

View File

@ -138,6 +138,7 @@ static bool Check_Integer_Field(FIELD * field, const void * argp)
+--------------------------------------------------------------------------*/
static bool Check_Integer_Character(int c, const void * argp)
{
argp=0; /* Silence unused parameter warning. */
return ((isdigit(c) || (c=='-')) ? TRUE : FALSE);
}

View File

@ -32,13 +32,15 @@ static bool Check_IPV4_Field(FIELD * field, const void * argp)
int num = 0, len;
unsigned int d1, d2, d3, d4;
if(isdigit(*bp)) /* Must start with digit */
argp=0; /* Silence unused parameter warning. */
if(isdigit((int)(*bp))) /* Must start with digit */
{
num = sscanf(bp, "%u.%u.%u.%u%n", &d1, &d2, &d3, &d4, &len);
if (num == 4)
{
bp += len; /* Make bp point to what sscanf() left */
while (*bp && isspace(*bp))
while (*bp && isspace((int)(*bp)))
bp++; /* Allow trailing whitespace */
}
}
@ -59,6 +61,7 @@ static bool Check_IPV4_Field(FIELD * field, const void * argp)
+--------------------------------------------------------------------------*/
static bool Check_IPV4_Character(int c, const void * argp)
{
argp=0; /* Silence unused parameter warning. */
return ((isdigit(c) || (c=='.')) ? TRUE : FALSE);
}

View File

@ -161,6 +161,7 @@ static bool Check_Numeric_Field(FIELD * field, const void * argp)
+--------------------------------------------------------------------------*/
static bool Check_Numeric_Character(int c, const void * argp)
{
argp=0; /* Silence unused parameter warning. */
return (isdigit(c) ||
c == '+' ||
c == '-' ||

View File

@ -147,6 +147,7 @@ static void *Make_RegularExpression_Type(va_list * ap)
}
return (void *)pArg;
#else
ap=0; /* Silence unused parameter warning. */
return 0;
#endif
}
@ -173,6 +174,7 @@ static void *Copy_RegularExpression_Type(const void * argp)
}
return (void *)result;
#else
argp=0; /* Silence unused parameter warning. */
return 0;
#endif
}
@ -209,6 +211,8 @@ static void Free_RegularExpression_Type(void * argp)
free(ap);
}
}
#else
argp=0; /* Silence unused parameter warning. */
#endif
}
@ -234,6 +238,9 @@ static bool Check_RegularExpression_Field(FIELD * field, const void * argp)
RegExp_Arg *ap = (RegExp_Arg *)argp;
if (ap && ap->compiled_expression)
match = (step(field_buffer(field,0),ap->compiled_expression) ? TRUE:FALSE);
#else
argp=0; /* Silence unused parameter warning. */
field=0; /* Silence unused parameter warning. */
#endif
return match;
}