Skip to content

Commit

Permalink
Fix some example C++ Warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLoach committed Dec 18, 2024
1 parent 6e4a852 commit 872556d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/core/core_drop_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main() {
raylib::DrawText("Dropped files:", 100, 40, 20, DARKGRAY);

// Iterate through all the dropped files.
for (int i = 0; i < droppedFiles.size(); i++) {
for (int i = 0; i < (int)droppedFiles.size(); i++) {
if (i % 2 == 0)
DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f));
else
Expand Down
2 changes: 1 addition & 1 deletion examples/core/core_loading_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(void)
threadId = std::thread(LoadDataThread);
TraceLog(LOG_INFO,
"Loading thread initialized successfully");
} catch (std::system_error e) {
} catch (std::system_error& e) {
TraceLog(LOG_ERROR, "Error: %s", e.what());
}

Expand Down
6 changes: 4 additions & 2 deletions examples/core/core_window_letterbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main(void)
raylib::RenderTexture2D target(gameScreenWidth, gameScreenHeight);
target.GetTexture().SetFilter(TEXTURE_FILTER_BILINEAR); // Texture scale filter to use

raylib::Color colors[10] = { 0 };
raylib::Color colors[10];
for (int i = 0; i < 10; i++) {
colors[i] = raylib::Color((unsigned char)GetRandomValue(100, 250), (unsigned char)GetRandomValue(50, 150), (unsigned char)GetRandomValue(10, 100), 255);
}
Expand All @@ -60,7 +60,9 @@ int main(void)
if (IsKeyPressed(KEY_SPACE))
{
// Recalculate random colors for the bars
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 };
for (int i = 0; i < 10; i++) {
colors[i] = raylib::Color((unsigned char)GetRandomValue(100, 250), (unsigned char)GetRandomValue(50, 150), (unsigned char)GetRandomValue(10, 100), 255);
}
}

// Update virtual mouse (clamped mouse value behind game screen)
Expand Down

0 comments on commit 872556d

Please sign in to comment.