* routines to convert a string (legal ascii representation of node) back
* to nodes
*
- * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
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;
}
retval = RIGHT_PAREN;
else if (*token == '{')
retval = LEFT_BRACE;
- else if (*token == '\"' && length > 1 && token[length - 1] == '\"')
+ else if (*token == '"' && length > 1 && token[length - 1] == '"')
retval = T_String;
else if (*token == 'b')
retval = T_BitString;
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:
{