(#1118) Try to fix warnings on MacOS build

master
rexim 2019-11-04 17:38:26 +07:00
parent 5a7b5b1208
commit 3c43b90c20
5 changed files with 11 additions and 6 deletions

View File

@ -72,7 +72,7 @@ void action_picker_event(ActionPicker *picker,
const float element_height = picker->widget.boundary.h / (float)ACTION_N;
for (size_t i = 0; i < ACTION_N; ++i) {
for (ActionType i = 0; i < ACTION_N; ++i) {
const Vec2f element_position =
vec_sum(
vec(picker->widget.boundary.x, picker->widget.boundary.y),

View File

@ -134,7 +134,7 @@ int layer_picker_event(LayerPicker *layer_picker,
switch (event->type) {
case SDL_MOUSEBUTTONDOWN: {
for (size_t i = 0; i < LAYER_PICKER_N; ++i) {
for (LayerPicker i = 0; i < LAYER_PICKER_N; ++i) {
const Rect cell = rect(
position.x,
size.y * (float) i + position.y,

View File

@ -750,7 +750,10 @@ RectLayer *create_rect_layer_from_line_stream(LineStream *line_stream, const cha
dynarray_push(layer->ids, id);
dynarray_push(layer->colors, &color);
Action action = {0};
Action action = {
.type = ACTION_NONE,
.entity_id = {0}
};
if (sscanf(line, "%d%n", (int*)&action.type, &n) > 0) {
line += n;

View File

@ -27,7 +27,6 @@ static void print_usage(FILE *stream)
int main(int argc, char *argv[])
{
int a = 5;
srand((unsigned int) time(NULL));
Lt *lt = create_lt();

View File

@ -81,7 +81,7 @@ void rect_object_impact(Rect object, Rect obstacle, int *sides)
Rect int_area = rects_overlap_area(object, obstacle);
if (int_area.w * int_area.h > 0.0f) {
for (int side = 0; side < RECT_SIDE_N; ++side) {
for (Rect_side side = 0; side < RECT_SIDE_N; ++side) {
Line object_side = rect_side(object, side);
Line int_side = rect_side(int_area, side);
@ -105,7 +105,10 @@ Line rect_side(Rect rect, Rect_side side)
const float x2 = rect.x + rect.w;
const float y2 = rect.y + rect.h;
Line result = { 0 };
Line result = {
.p1 = {0, 0},
.p2 = {0, 0}
};
switch (side) {
case RECT_SIDE_LEFT: