mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Change internal integer representation of Value node
A Value node would store an integer as a long. This causes needless portability risks, as long can be of varying sizes. Change it to use int instead. All code using this was already careful to only store 32-bit values anyway. Reviewed-by: Michael Paquier <michael@paquier.xyz>
This commit is contained in:
		@@ -34,7 +34,7 @@
 | 
			
		||||
 * better to use the more general representation.)
 | 
			
		||||
 *
 | 
			
		||||
 * Note that an integer-looking string will get lexed as T_Float if
 | 
			
		||||
 * the value is too large to fit in a 'long'.
 | 
			
		||||
 * the value is too large to fit in an 'int'.
 | 
			
		||||
 *
 | 
			
		||||
 * Nulls, of course, don't need the value part at all.
 | 
			
		||||
 *----------------------
 | 
			
		||||
@@ -44,7 +44,7 @@ typedef struct Value
 | 
			
		||||
	NodeTag		type;			/* tag appropriately (eg. T_String) */
 | 
			
		||||
	union ValUnion
 | 
			
		||||
	{
 | 
			
		||||
		long		ival;		/* machine integer */
 | 
			
		||||
		int			ival;		/* machine integer */
 | 
			
		||||
		char	   *str;		/* string */
 | 
			
		||||
	}			val;
 | 
			
		||||
} Value;
 | 
			
		||||
@@ -53,7 +53,7 @@ typedef struct Value
 | 
			
		||||
#define floatVal(v)		atof(((Value *)(v))->val.str)
 | 
			
		||||
#define strVal(v)		(((Value *)(v))->val.str)
 | 
			
		||||
 | 
			
		||||
extern Value *makeInteger(long i);
 | 
			
		||||
extern Value *makeInteger(int i);
 | 
			
		||||
extern Value *makeFloat(char *numericStr);
 | 
			
		||||
extern Value *makeString(char *str);
 | 
			
		||||
extern Value *makeBitString(char *str);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user