Datum lquery_out(PG_FUNCTION_ARGS);
-#define UNCHAR elog(ERROR,"Syntax error in position %d near '%c'", ptr-buf, *ptr)
+#define UNCHAR elog(ERROR,"Syntax error in position %d near '%c'", (int)(ptr-buf), *ptr)
typedef struct {
char* start;
lptr->len = ptr - lptr->start;
if ( lptr->len > 255 )
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
- lptr->len, lptr->start - buf);
+ lptr->len, (int)(lptr->start - buf));
totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE);
lptr++;
state = LTPRS_WAITNAME;
lptr->len = ptr - lptr->start;
if ( lptr->len > 255 )
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
- lptr->len, lptr->start - buf);
+ lptr->len, (int)(lptr->start - buf));
totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE);
lptr++;
} else if ( ! (state == LTPRS_WAITNAME && lptr == list) )
( ( lptr->flag & LVAR_ANYEND ) ? 1 : 0 );
if ( lptr->len > 255 )
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
- lptr->len, lptr->start - buf);
+ lptr->len, (int)(lptr->start - buf));
state = LQPRS_WAITVAR;
} else if ( *ptr == '.' ) {
lptr->len = ptr - lptr->start -
( ( lptr->flag & LVAR_ANYEND ) ? 1 : 0 );
if ( lptr->len > 255 )
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
- lptr->len, lptr->start - buf);
+ lptr->len, (int)(lptr->start - buf));
state = LQPRS_WAITLEVEL;
curqlevel = NEXTLEV(curqlevel);
} else if ( ISALNUM(*ptr) ) {
} else if ( state == LQPRS_WAITFNUM ) {
if ( *ptr == ',' ) {
state = LQPRS_WAITSNUM;
- } else if ( isdigit(*ptr) ) {
+ } else if ( isdigit((unsigned int)*ptr) ) {
curqlevel->low = atoi( ptr );
state = LQPRS_WAITND;
} else
UNCHAR;
} else if ( state == LQPRS_WAITSNUM ) {
- if ( isdigit(*ptr) ) {
+ if ( isdigit((unsigned int)*ptr) ) {
curqlevel->high = atoi( ptr );
state = LQPRS_WAITCLOSE;
} else if ( *ptr == '}' ) {
} else if ( state == LQPRS_WAITCLOSE ) {
if ( *ptr == '}' )
state = LQPRS_WAITEND;
- else if ( !isdigit(*ptr) )
+ else if ( !isdigit((unsigned int)*ptr) )
UNCHAR;
} else if ( state == LQPRS_WAITND ) {
if ( *ptr == '}' ) {
state = LQPRS_WAITEND;
} else if ( *ptr == ',' )
state = LQPRS_WAITSNUM;
- else if ( !isdigit(*ptr) )
+ else if ( !isdigit((unsigned int)*ptr) )
UNCHAR;
} else if ( state == LQPRS_WAITEND ) {
if ( *ptr == '.' ) {
elog(ERROR,"Unexpected end of line");
if ( lptr->len > 255 )
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
- lptr->len, lptr->start - buf);
+ lptr->len, (int)(lptr->start - buf));
} else if ( state == LQPRS_WAITOPEN ) {
curqlevel->high = 0xffff;
} else if ( state != LQPRS_WAITEND )