Skip to content

Commit 872556d

Browse files
committed
Fix some example C++ Warnings
1 parent 6e4a852 commit 872556d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

examples/core/core_drop_files.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main() {
4848
raylib::DrawText("Dropped files:", 100, 40, 20, DARKGRAY);
4949

5050
// Iterate through all the dropped files.
51-
for (int i = 0; i < droppedFiles.size(); i++) {
51+
for (int i = 0; i < (int)droppedFiles.size(); i++) {
5252
if (i % 2 == 0)
5353
DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f));
5454
else

examples/core/core_loading_thread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int main(void)
5555
threadId = std::thread(LoadDataThread);
5656
TraceLog(LOG_INFO,
5757
"Loading thread initialized successfully");
58-
} catch (std::system_error e) {
58+
} catch (std::system_error& e) {
5959
TraceLog(LOG_ERROR, "Error: %s", e.what());
6060
}
6161

examples/core/core_window_letterbox.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int main(void)
4141
raylib::RenderTexture2D target(gameScreenWidth, gameScreenHeight);
4242
target.GetTexture().SetFilter(TEXTURE_FILTER_BILINEAR); // Texture scale filter to use
4343

44-
raylib::Color colors[10] = { 0 };
44+
raylib::Color colors[10];
4545
for (int i = 0; i < 10; i++) {
4646
colors[i] = raylib::Color((unsigned char)GetRandomValue(100, 250), (unsigned char)GetRandomValue(50, 150), (unsigned char)GetRandomValue(10, 100), 255);
4747
}
@@ -60,7 +60,9 @@ int main(void)
6060
if (IsKeyPressed(KEY_SPACE))
6161
{
6262
// Recalculate random colors for the bars
63-
for (int i = 0; i < 10; i++) colors[i] = (Color){ (unsigned char)GetRandomValue(100, 250), (unsigned char)GetRandomValue(50, 150), (unsigned char)GetRandomValue(10, 100), 255 };
63+
for (int i = 0; i < 10; i++) {
64+
colors[i] = raylib::Color((unsigned char)GetRandomValue(100, 250), (unsigned char)GetRandomValue(50, 150), (unsigned char)GetRandomValue(10, 100), 255);
65+
}
6466
}
6567

6668
// Update virtual mouse (clamped mouse value behind game screen)

0 commit comments

Comments
 (0)