File tree Expand file tree Collapse file tree 7 files changed +17
-27
lines changed Expand file tree Collapse file tree 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)
32353235 switch (value -> type )
32363236 {
32373237 case T_Integer :
3238- appendStringInfo (str , "%ld " , value -> val .ival );
3238+ appendStringInfo (str , "%d " , value -> val .ival );
32393239 break ;
32403240 case T_Float :
32413241
Original file line number Diff line number Diff line change @@ -224,13 +224,9 @@ nodeTokenType(char *token, int length)
224224
225225 errno = 0 ;
226226 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 )
234230 return T_Float ;
235231 return T_Integer ;
236232 }
@@ -387,9 +383,9 @@ nodeRead(char *token, int tok_len)
387383 case T_Integer :
388384
389385 /*
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
391387 */
392- result = (Node * ) makeInteger (atol (token ));
388+ result = (Node * ) makeInteger (atoi (token ));
393389 break ;
394390 case T_Float :
395391 {
Original file line number Diff line number Diff line change 2020 * makeInteger
2121 */
2222Value *
23- makeInteger (long i )
23+ makeInteger (int i )
2424{
2525 Value * v = makeNode (Value );
2626
Original file line number Diff line number Diff line change @@ -1216,12 +1216,9 @@ process_integer_literal(const char *token, YYSTYPE *lval)
12161216
12171217 errno = 0 ;
12181218 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)
12251222 {
12261223 /* integer too large, treat it as a float */
12271224 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)
69136913 switch (nodeTag (& con -> val ))
69146914 {
69156915 case T_Integer :
6916- appendStringInfo (& buf , "%ld " , intVal (& con -> val ));
6916+ appendStringInfo (& buf , "%d " , intVal (& con -> val ));
69176917 break ;
69186918 case T_Float :
69196919 /* represented as a string, so just copy it */
Original file line number Diff line number Diff line change 3434 * better to use the more general representation.)
3535 *
3636 * 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 '.
3838 *
3939 * Nulls, of course, don't need the value part at all.
4040 *----------------------
@@ -44,7 +44,7 @@ typedef struct Value
4444 NodeTag type ; /* tag appropriately (eg. T_String) */
4545 union ValUnion
4646 {
47- long ival ; /* machine integer */
47+ int ival ; /* machine integer */
4848 char * str ; /* string */
4949 } val ;
5050} Value ;
@@ -53,7 +53,7 @@ typedef struct Value
5353#define floatVal (v ) atof(((Value *)(v))->val.str)
5454#define strVal (v ) (((Value *)(v))->val.str)
5555
56- extern Value * makeInteger (long i );
56+ extern Value * makeInteger (int i );
5757extern Value * makeFloat (char * numericStr );
5858extern Value * makeString (char * str );
5959extern 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})((\/\*[^*/]*\*+
732732
733733 errno = 0 ;
734734 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)
741738 {
742739 errno = 0 ;
743740 base_yylval.str = mm_strdup (yytext);
You can’t perform that action at this time.
0 commit comments