From eba22158410e664ad102c7542e333d00dcb80cc3 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 8 May 2008 18:57:31 +0000 Subject: [PATCH] fix a few warnings SVN-Revision: 5437 --- src/gui/menu.cpp | 6 +++--- src/mainloop.cpp | 2 +- src/squirrel/include/sqstdio.h | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp index b0394ac32..255835964 100644 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -372,7 +372,7 @@ Menu::clear() void Menu::update() { - int menu_height = get_height(); + int menu_height = (int) get_height(); if (menu_height > SCREEN_HEIGHT) { // Scrolling int scroll_offset = (menu_height - SCREEN_HEIGHT) / 2 + 32; @@ -823,8 +823,8 @@ Menu::draw(DrawingContext& context) if (!items[active_item]->help.empty()) { - int text_width = default_font->get_text_width(items[active_item]->help); - int text_height = default_font->get_text_height(items[active_item]->help); + int text_width = (int) default_font->get_text_width(items[active_item]->help); + int text_height = (int) default_font->get_text_height(items[active_item]->help); Rect text_rect(pos_x - text_width/2 - 8, SCREEN_HEIGHT - 48 - text_height/2 - 4, diff --git a/src/mainloop.cpp b/src/mainloop.cpp index 3d4ec4b51..4d32e54ff 100644 --- a/src/mainloop.cpp +++ b/src/mainloop.cpp @@ -246,7 +246,7 @@ MainLoop::run(DrawingContext &context) elapsed_ticks += ticks - last_ticks; last_ticks = ticks; - Uint32 ticks_per_frame = TICKS_PER_FRAME * game_speed; + Uint32 ticks_per_frame = (Uint32) (TICKS_PER_FRAME * game_speed); if (elapsed_ticks > ticks_per_frame*4) { // when the game loads up or levels are switched the diff --git a/src/squirrel/include/sqstdio.h b/src/squirrel/include/sqstdio.h index 2cb744bcf..1b753804c 100644 --- a/src/squirrel/include/sqstdio.h +++ b/src/squirrel/include/sqstdio.h @@ -7,6 +7,8 @@ #define SQSTD_STREAM_TYPE_TAG 0x80000000 struct SQStream { + virtual ~SQStream() {} + virtual SQInteger Read(void *buffer, SQInteger size) = 0; virtual SQInteger Write(void *buffer, SQInteger size) = 0; virtual SQInteger Flush() = 0; -- 2.11.0