From 3c2366248ba345753202c49f8e718f713f420b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Sun, 12 Apr 2015 10:59:07 +0200 Subject: [PATCH] Fix compile warnings, cast size_t to long unsigned int for printf --- src/stratagus/groups.cpp | 2 +- src/stratagus/selection.cpp | 2 +- src/ui/mainscr.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stratagus/groups.cpp b/src/stratagus/groups.cpp index c14814dec..045c778b8 100644 --- a/src/stratagus/groups.cpp +++ b/src/stratagus/groups.cpp @@ -127,7 +127,7 @@ void SaveGroups(CFile &file) file.printf("--- MODULE: groups\n\n"); for (int g = 0; g < NUM_GROUPS; ++g) { - file.printf("Group(%d, %d, {", g, Groups[g].getUnits().size()); + file.printf("Group(%d, %lu, {", g, (long unsigned int)Groups[g].getUnits().size()); for (size_t i = 0; i < Groups[g].getUnits().size(); ++i) { file.printf("\"%s\", ", UnitReference(*Groups[g].getUnits()[i]).c_str()); } diff --git a/src/stratagus/selection.cpp b/src/stratagus/selection.cpp index a66b63075..036a4a5a4 100644 --- a/src/stratagus/selection.cpp +++ b/src/stratagus/selection.cpp @@ -982,7 +982,7 @@ void SaveSelections(CFile &file) file.printf("--- MODULE: selection\n\n"); file.printf("SetGroupId(%d)\n", GroupId); - file.printf("Selection(%d, {", Selected.size()); // TODO: remove + file.printf("Selection(%lu, {", (long unsigned int)Selected.size()); // TODO: remove for (size_t i = 0; i != Selected.size(); ++i) { file.printf("\"%s\", ", UnitReference(*Selected[i]).c_str()); } diff --git a/src/ui/mainscr.cpp b/src/ui/mainscr.cpp index a9e1fb8cf..ce94c99ed 100644 --- a/src/ui/mainscr.cpp +++ b/src/ui/mainscr.cpp @@ -1143,7 +1143,7 @@ static void InfoPanel_draw_multiple_selection() if (Selected.size() > UI.SelectedButtons.size()) { char buf[5]; - sprintf(buf, "+%u", Selected.size() - UI.SelectedButtons.size()); + sprintf(buf, "+%lu", (long unsigned int)(Selected.size() - UI.SelectedButtons.size())); CLabel(*UI.MaxSelectedFont).Draw(UI.MaxSelectedTextX, UI.MaxSelectedTextY, buf); } }