diff options
Diffstat (limited to 'src/backend/nodes')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 2 | ||||
-rw-r--r-- | src/backend/nodes/read.c | 14 | ||||
-rw-r--r-- | src/backend/nodes/value.c | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 1785ea39186..fd808919548 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -3235,7 +3235,7 @@ _outValue(StringInfo str, const Value *value) switch (value->type) { case T_Integer: - appendStringInfo(str, "%ld", value->val.ival); + appendStringInfo(str, "%d", value->val.ival); break; case T_Float: diff --git a/src/backend/nodes/read.c b/src/backend/nodes/read.c index 76414029d83..6e9fa45e37e 100644 --- a/src/backend/nodes/read.c +++ b/src/backend/nodes/read.c @@ -224,13 +224,9 @@ nodeTokenType(char *token, int length) errno = 0; val = strtol(token, &endptr, 10); - (void) val; /* avoid compiler warning if unused */ - if (endptr != token + length || errno == ERANGE -#ifdef HAVE_LONG_INT_64 - /* if long > 32 bits, check for overflow of int4 */ - || val != (long) ((int32) val) -#endif - ) + if (endptr != token + length || errno == ERANGE || + /* check for overflow of int */ + val != (int) val) return T_Float; return T_Integer; } @@ -387,9 +383,9 @@ nodeRead(char *token, int tok_len) case T_Integer: /* - * we know that the token terminates on a char atol will stop at + * we know that the token terminates on a char atoi will stop at */ - result = (Node *) makeInteger(atol(token)); + result = (Node *) makeInteger(atoi(token)); break; case T_Float: { diff --git a/src/backend/nodes/value.c b/src/backend/nodes/value.c index 8f0428fce12..2a30307baf4 100644 --- a/src/backend/nodes/value.c +++ b/src/backend/nodes/value.c @@ -20,7 +20,7 @@ * makeInteger */ Value * -makeInteger(long i) +makeInteger(int i) { Value *v = makeNode(Value); |