File tree 7 files changed +17
-27
lines changed 7 files changed +17
-27
lines changed Original file line number Diff line number Diff line change @@ -3235,7 +3235,7 @@ _outValue(StringInfo str, const Value *value)
3235
3235
switch (value -> type )
3236
3236
{
3237
3237
case T_Integer :
3238
- appendStringInfo (str , "%ld " , value -> val .ival );
3238
+ appendStringInfo (str , "%d " , value -> val .ival );
3239
3239
break ;
3240
3240
case T_Float :
3241
3241
Original file line number Diff line number Diff line change @@ -224,13 +224,9 @@ nodeTokenType(char *token, int length)
224
224
225
225
errno = 0 ;
226
226
val = strtol (token , & endptr , 10 );
227
- (void ) val ; /* avoid compiler warning if unused */
228
- if (endptr != token + length || errno == ERANGE
229
- #ifdef HAVE_LONG_INT_64
230
- /* if long > 32 bits, check for overflow of int4 */
231
- || val != (long ) ((int32 ) val )
232
- #endif
233
- )
227
+ if (endptr != token + length || errno == ERANGE ||
228
+ /* check for overflow of int */
229
+ val != (int ) val )
234
230
return T_Float ;
235
231
return T_Integer ;
236
232
}
@@ -387,9 +383,9 @@ nodeRead(char *token, int tok_len)
387
383
case T_Integer :
388
384
389
385
/*
390
- * we know that the token terminates on a char atol will stop at
386
+ * we know that the token terminates on a char atoi will stop at
391
387
*/
392
- result = (Node * ) makeInteger (atol (token ));
388
+ result = (Node * ) makeInteger (atoi (token ));
393
389
break ;
394
390
case T_Float :
395
391
{
Original file line number Diff line number Diff line change 20
20
* makeInteger
21
21
*/
22
22
Value *
23
- makeInteger (long i )
23
+ makeInteger (int i )
24
24
{
25
25
Value * v = makeNode (Value );
26
26
Original file line number Diff line number Diff line change @@ -1216,12 +1216,9 @@ process_integer_literal(const char *token, YYSTYPE *lval)
1216
1216
1217
1217
errno = 0 ;
1218
1218
val = strtol (token, &endptr, 10 );
1219
- if (*endptr != ' \0 ' || errno == ERANGE
1220
- #ifdef HAVE_LONG_INT_64
1221
- /* if long > 32 bits, check for overflow of int4 */
1222
- || val != (long ) ((int32) val)
1223
- #endif
1224
- )
1219
+ if (*endptr != ' \0 ' || errno == ERANGE ||
1220
+ /* check for overflow of int */
1221
+ val != (int ) val)
1225
1222
{
1226
1223
/* integer too large, treat it as a float */
1227
1224
lval->str = pstrdup (token);
Original file line number Diff line number Diff line change @@ -6913,7 +6913,7 @@ flatten_set_variable_args(const char *name, List *args)
6913
6913
switch (nodeTag (& con -> val ))
6914
6914
{
6915
6915
case T_Integer :
6916
- appendStringInfo (& buf , "%ld " , intVal (& con -> val ));
6916
+ appendStringInfo (& buf , "%d " , intVal (& con -> val ));
6917
6917
break ;
6918
6918
case T_Float :
6919
6919
/* represented as a string, so just copy it */
Original file line number Diff line number Diff line change 34
34
* better to use the more general representation.)
35
35
*
36
36
* Note that an integer-looking string will get lexed as T_Float if
37
- * the value is too large to fit in a 'long '.
37
+ * the value is too large to fit in an 'int '.
38
38
*
39
39
* Nulls, of course, don't need the value part at all.
40
40
*----------------------
@@ -44,7 +44,7 @@ typedef struct Value
44
44
NodeTag type ; /* tag appropriately (eg. T_String) */
45
45
union ValUnion
46
46
{
47
- long ival ; /* machine integer */
47
+ int ival ; /* machine integer */
48
48
char * str ; /* string */
49
49
} val ;
50
50
} Value ;
@@ -53,7 +53,7 @@ typedef struct Value
53
53
#define floatVal (v ) atof(((Value *)(v))->val.str)
54
54
#define strVal (v ) (((Value *)(v))->val.str)
55
55
56
- extern Value * makeInteger (long i );
56
+ extern Value * makeInteger (int i );
57
57
extern Value * makeFloat (char * numericStr );
58
58
extern Value * makeString (char * str );
59
59
extern Value * makeBitString (char * str );
Original file line number Diff line number Diff line change @@ -732,12 +732,9 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
732
732
733
733
errno = 0 ;
734
734
val = strtol ((char *)yytext, &endptr,10 );
735
- if (*endptr != ' \0 ' || errno == ERANGE
736
- #ifdef HAVE_LONG_INT_64
737
- /* if long > 32 bits, check for overflow of int4 */
738
- || val != (long ) ((int32) val)
739
- #endif
740
- )
735
+ if (*endptr != ' \0 ' || errno == ERANGE ||
736
+ /* check for overflow of int */
737
+ val != (int ) val)
741
738
{
742
739
errno = 0 ;
743
740
base_yylval.str = mm_strdup (yytext);
You can’t perform that action at this time.
0 commit comments