Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 381024a

Browse filesBrowse files
committed
Fix GCC warnings in C samples
1 parent aa48bc5 commit 381024a
Copy full SHA for 381024a

File tree

Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed

‎samples/samples_c.c

Copy file name to clipboardExpand all lines: samples/samples_c.c
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,6 @@ void render_image(const SDL_Event* event) {
706706
* mouse sample
707707
* ***************************/
708708
void render_mouse(const SDL_Event* event) {
709-
static TCOD_mouse_t mouse = {0};
710709
static int tile_motion_x = 0;
711710
static int tile_motion_y = 0;
712711
float pixel_x;
@@ -750,8 +749,8 @@ void render_mouse(const SDL_Event* event) {
750749
"Left button : %s\n"
751750
"Right button : %s\n"
752751
"Middle button : %s\n",
753-
pixel_x,
754-
pixel_y,
752+
(int)pixel_x,
753+
(int)pixel_y,
755754
tile_x,
756755
tile_y,
757756
tile_motion_x,
@@ -1609,12 +1608,12 @@ SDL_AppResult SDL_AppIterate(void* userdata) {
16091608
main_console,
16101609
(TCOD_PrintParamsRGB){.x = 0, .width = main_console->w, .y = 46, .fg = &GREY, .alignment = TCOD_RIGHT},
16111610
"last frame : %3d ms (%3.0f fps)",
1612-
delta_time_ms,
1611+
(int)delta_time_ms,
16131612
get_framerate());
16141613
TCOD_printf_rgb(
16151614
main_console,
16161615
(TCOD_PrintParamsRGB){.x = 0, .width = main_console->w, .y = 47, .fg = &GREY, .alignment = TCOD_RIGHT},
1617-
"elapsed : %5dms %5.2fs",
1616+
"elapsed : %5lldms %5.2fs",
16181617
SDL_GetTicks(),
16191618
SDL_GetTicks() / 1000.0f);
16201619
TCOD_printf_rgb(main_console, (TCOD_PrintParamsRGB){.x = 2, .y = 47, .fg = &GREY}, "↑↓ : select a sample");

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.