Store Nix integers as longs
So on 64-bit systems, integers are now 64-bit. Fixes #158.
This commit is contained in:
		
							parent
							
								
									297b762513
								
							
						
					
					
						commit
						d308aeaf53
					
				
					 9 changed files with 25 additions and 23 deletions
				
			
		|  | @ -110,8 +110,10 @@ or          { return OR_KW; } | |||
| \+\+        { return CONCAT; } | ||||
| 
 | ||||
| {ID}        { yylval->id = strdup(yytext); return ID; } | ||||
| {INT}       { int n = atoi(yytext); /* !!! overflow */ | ||||
|               yylval->n = n; | ||||
| {INT}       { errno = 0; | ||||
|               yylval->n = strtol(yytext, 0, 10); | ||||
|               if (errno != 0) | ||||
|                   throw ParseError(format("invalid integer `%1%'") % yytext); | ||||
|               return INT; | ||||
|             } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue