"${CMAKE_C_FLAGS} \
/Wall \
/WX \
+ /wd4127 \
/wd4201 \
/wd4204 \
/wd4255 \
/wd4668 \
+ /wd4702 \
/wd4710 \
/wd4777 \
/wd4820 \
size_t capacity;
};
-static long int value_of_expr(struct Expr expr)
+static intptr_t value_of_expr(struct Expr expr)
{
if (expr.type == EXPR_CONS) {
- return (long int) expr.cons;
+ return (intptr_t) expr.cons;
} else if (expr.type == EXPR_ATOM) {
- return (long int) expr.atom;
+ return (intptr_t) expr.atom;
} else {
return 0;
}
trace_assert(a);
trace_assert(b);
- const long int ptr_a = value_of_expr(*(const struct Expr *)a);
- const long int ptr_b = value_of_expr(*(const struct Expr *)b);
- const long int d = ptr_b - ptr_a;
+ const intptr_t ptr_a = value_of_expr(*(const struct Expr *)a);
+ const intptr_t ptr_b = value_of_expr(*(const struct Expr *)b);
+ const intptr_t d = ptr_b - ptr_a;
if (d < 0) {
return -1;
static struct ParseResult parse_number(Gc *gc, struct Token current_token)
{
char *endptr = 0;
- const long int x = strtoimax(current_token.begin, &endptr, 10);
+ const long int x = strtol(current_token.begin, &endptr, 10);
if (current_token.begin == endptr || current_token.end != endptr) {
return parse_failure("Expected number", current_token.begin);
goals->count = 0;
if (sscanf(
line_stream_next(line_stream),
- "%lu",
+ "%zu",
&goals->count) == EOF) {
log_fail("Could not read amount of goals\n");
RETURN_LT(lt, NULL);
if (sscanf(
line_stream_next(line_stream),
- "%lu",
+ "%zu",
&labels->count) == EOF) {
log_fail("Could not read amount of labels\n");
RETURN_LT(lt, NULL);
if (sscanf(
line_stream_next(line_stream),
- "%lu",
+ "%zu",
&lava->rects_count) < 0) {
log_fail("Could not read amount of lava\n");
RETURN_LT(lt, NULL);
}
size_t n = 0;
- if (sscanf(line, "%lu", &n) == EOF) {
+ if (sscanf(line, "%zu", &n) == EOF) {
log_fail("Could not parse amount of labels\n");
RETURN_LT(label_layer->lt, NULL);
}
Color *colors = dynarray_data(label_layer->colors);
char **texts = dynarray_data(label_layer->texts);
- fprintf(filedump, "%ld\n", n);
+ fprintf(filedump, "%zd\n", n);
for (size_t i = 0; i < n; ++i) {
fprintf(filedump, "%s %f %f ",
ids + LABEL_LAYER_ID_MAX_SIZE * i,
#include <stdbool.h>
+#include <string.h>
#include <SDL.h>
size_t count = 0;
if (sscanf(
line_stream_next(line_stream),
- "%lu",
+ "%zu",
&count) == EOF) {
log_fail("Could not read amount of points");
RETURN_LT(point_layer->lt, NULL);
Point *points = dynarray_data(point_layer->points);
Color *colors = dynarray_data(point_layer->colors);
- fprintf(filedump, "%ld\n", n);
+ fprintf(filedump, "%zd\n", n);
for (size_t i = 0; i < n; ++i) {
fprintf(filedump, "%s %f %f ",
ids + ID_MAX_SIZE * i,
}
size_t count = 0;
- if (sscanf(line, "%lu", &count) < 0) {
+ if (sscanf(line, "%zu", &count) < 0) {
RETURN_LT(layer->lt, NULL);
}
Rect *rects = dynarray_data(layer->rects);
Color *colors = dynarray_data(layer->colors);
- fprintf(filedump, "%ld\n", n);
+ fprintf(filedump, "%zd\n", n);
for (size_t i = 0; i < n; ++i) {
fprintf(filedump, "%s %f %f %f %f ",
ids + RECT_LAYER_ID_MAX_SIZE * i,
if(sscanf(
line_stream_next(line_stream),
- "%lu",
+ "%zu",
®ions->count) < 0) {
log_fail("Could not read amount of script regions\n");
RETURN_LT(lt, NULL);
return -1;
}
- snprintf(text_buffer, 256, "id: %ld", id);
+ snprintf(text_buffer, 256, "id: %zd", id);
if (camera_render_debug_text(
camera,
const float x2 = rect.x + rect.w;
const float y2 = rect.y + rect.h;
- Line result;
+ Line result = { 0 };
switch (side) {
case RECT_SIDE_LEFT:
ASSERT_FALSE(result.is_error, {
fprintf(stderr, "Parsing failed: %s\n", result.error_message);
- fprintf(stderr, "Position: %ld\n", result.end - source_code);
+ fprintf(stderr, "Position: %zd\n", result.end - source_code);
});
return 0;