@@ -174,18 +174,18 @@ static ssize_t tokenize_select(Lexer *l, Token *tokens, size_t capacity)
174
174
} else if (strncmp (token .p , "AT" , token .length ) == 0 ) {
175
175
tokens [i ].type = TOKEN_AT ;
176
176
token = lexer_next (l );
177
- if (sscanf (token .p , "%lli" , & (int64_t ){0 }) == 1 )
177
+ if (sscanf (token .p , "%" PRId64 , & (int64_t ){0 }) == 1 )
178
178
strncpy (tokens [i ].value , token .p , token .length );
179
179
} else if (strncmp (token .p , "RANGE" , token .length ) == 0 ) {
180
180
tokens [i ].type = TOKEN_RANGE ;
181
181
token = lexer_next (l );
182
- if (sscanf (token .p , "%lli" , & (int64_t ){0 }) == 1 )
182
+ if (sscanf (token .p , "%" PRId64 , & (int64_t ){0 }) == 1 )
183
183
strncpy (tokens [i ].value , token .p , token .length );
184
184
// TOOD error here, missing the start timestamp
185
185
} else if (strncmp (token .p , "TO" , token .length ) == 0 ) {
186
186
tokens [i ].type = TOKEN_TO ;
187
187
token = lexer_next (l );
188
- if (sscanf (token .p , "%lli" , & (int64_t ){0 }) == 1 )
188
+ if (sscanf (token .p , "%" PRId64 , & (int64_t ){0 }) == 1 )
189
189
strncpy (tokens [i ].value , token .p , token .length );
190
190
// TOOD error here, missing the start timestamp
191
191
} else if (strncmp (token .p , "WHERE" , token .length ) == 0 ) {
@@ -199,7 +199,7 @@ static ssize_t tokenize_select(Lexer *l, Token *tokens, size_t capacity)
199
199
} else if (strncmp (token .p , "BY" , token .length ) == 0 ) {
200
200
tokens [i ].type = TOKEN_BY ;
201
201
token = lexer_next (l );
202
- if (sscanf (token .p , "%llu" , & (uint64_t ){0 }) == 1 )
202
+ if (sscanf (token .p , "%" PRIu64 , & (uint64_t ){0 }) == 1 )
203
203
strncpy (tokens [i ].value , token .p , token .length );
204
204
// TOOD error here, missing the start timestamp
205
205
} else {
@@ -217,7 +217,7 @@ static ssize_t tokenize_select(Lexer *l, Token *tokens, size_t capacity)
217
217
tokens [i ].type = TOKEN_OPERATOR_NE ;
218
218
}
219
219
token = lexer_next (l );
220
- if (sscanf (token .p , "%llu" , & (uint64_t ){0 }) == 1 )
220
+ if (sscanf (token .p , "%" PRIu64 , & (uint64_t ){0 }) == 1 )
221
221
strncpy (tokens [i ].value , token .p , token .length );
222
222
}
223
223
}
@@ -428,7 +428,7 @@ static void print_insert(const Statement_Insert *insert)
428
428
printf ("INSERT\n\t%s\nINTO\n\t%s\n" , insert -> ts_name , insert -> db_name );
429
429
printf ("VALUES\n\t" );
430
430
for (size_t i = 0 ; i < insert -> record_len ; ++ i ) {
431
- printf ("(%llu , %.2f) " , insert -> records [i ].timestamp ,
431
+ printf ("(%" PRId64 " , %.2f) " , insert -> records [i ].timestamp ,
432
432
insert -> records [i ].value );
433
433
}
434
434
printf ("\n" );
@@ -438,16 +438,17 @@ static void print_select(const Statement_Select *select)
438
438
{
439
439
printf ("SELECT\n\t%s\nFROM\n\t%s\n" , select -> ts_name , select -> db_name );
440
440
if (select -> mask & SM_SINGLE )
441
- printf ("AT\n\t%lli \n" , select -> start_time );
441
+ printf ("AT\n\t%" PRId64 " \n" , select -> start_time );
442
442
else if (select -> mask & SM_RANGE )
443
- printf ("RANGE\n\t%lli TO %lli\n" , select -> start_time , select -> end_time );
443
+ printf ("RANGE\n\t%" PRId64 " TO %" PRId64 "\n" , select -> start_time ,
444
+ select -> end_time );
444
445
if (select -> mask & SM_WHERE )
445
446
printf ("WHERE\n\t%s %i %.2lf\n" , select -> where .key ,
446
447
select -> where .operator , select -> where .value );
447
448
if (select -> mask & SM_AGGREGATE )
448
449
printf ("AGGREAGATE\n\t%i\n" , select -> af );
449
450
if (select -> mask & SM_BY )
450
- printf ("BY\n\t%llu \n" , select -> interval );
451
+ printf ("BY\n\t%" PRIu64 " \n" , select -> interval );
451
452
}
452
453
453
454
void print_statement (const Statement * statement )
0 commit comments