From a4eb3b19abbff0a51eefe74467c07570373e5f56 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Tue, 29 Jun 2004 21:50:23 +0000 Subject: [PATCH] Don't try to make a cast value an lvalue (Brian Johnson). Add some explicit casts to (int) in order to avaoid this warning: warning: comparison between `const enum video_depth' and `enum ' --- BasiliskII/src/SDL/video_sdl.cpp | 10 +++++----- BasiliskII/src/Unix/video_blit.h | 2 +- BasiliskII/src/Unix/video_vosf.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BasiliskII/src/SDL/video_sdl.cpp b/BasiliskII/src/SDL/video_sdl.cpp index 12bdf0b7..8bb3a3a1 100644 --- a/BasiliskII/src/SDL/video_sdl.cpp +++ b/BasiliskII/src/SDL/video_sdl.cpp @@ -413,7 +413,7 @@ static void add_mode(int type, int width, int height, int resolution_id, int byt VIDEO_MODE_Y = height; VIDEO_MODE_RESOLUTION = resolution_id; VIDEO_MODE_ROW_BYTES = bytes_per_row; - VIDEO_MODE_DEPTH = depth; + VIDEO_MODE_DEPTH = (video_depth)depth; VideoModes.push_back(mode); } @@ -587,7 +587,7 @@ void driver_base::update_palette(void) { const VIDEO_MODE &mode = monitor.get_current_mode(); - if (VIDEO_MODE_DEPTH <= VIDEO_DEPTH_8BIT) + if ((int)VIDEO_MODE_DEPTH <= VIDEO_DEPTH_8BIT) SDL_SetPalette(s, SDL_PHYSPAL, sdl_palette, 0, 256); } @@ -618,7 +618,7 @@ driver_window::driver_window(SDL_monitor_desc &m) ADBSetRelMouseMode(mouse_grabbed); // Create surface - int depth = (VIDEO_MODE_DEPTH <= VIDEO_DEPTH_8BIT ? 8 : screen_depth); + int depth = ((int)VIDEO_MODE_DEPTH <= VIDEO_DEPTH_8BIT ? 8 : screen_depth); if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE)) == NULL) return; @@ -1147,7 +1147,7 @@ void SDL_monitor_desc::set_palette(uint8 *pal, int num_in) const VIDEO_MODE &mode = get_current_mode(); // FIXME: how can we handle the gamma ramp? - if (VIDEO_MODE_DEPTH > VIDEO_DEPTH_8BIT) + if ((int)VIDEO_MODE_DEPTH > VIDEO_DEPTH_8BIT) return; LOCK_PALETTE; @@ -1962,7 +1962,7 @@ static void update_display_static(driver_window *drv) // Check for first column from left and first column from right that have changed if (high) { - if (VIDEO_MODE_DEPTH < VIDEO_DEPTH_8BIT) { + if ((int)VIDEO_MODE_DEPTH < VIDEO_DEPTH_8BIT) { const int src_bytes_per_row = bytes_per_row; const int dst_bytes_per_row = drv->s->pitch; const int pixels_per_byte = VIDEO_MODE_X / src_bytes_per_row; diff --git a/BasiliskII/src/Unix/video_blit.h b/BasiliskII/src/Unix/video_blit.h index 2946289e..51dbbacd 100644 --- a/BasiliskII/src/Unix/video_blit.h +++ b/BasiliskII/src/Unix/video_blit.h @@ -69,7 +69,7 @@ enum { #define VIDEO_MODE_X mode.x #define VIDEO_MODE_Y mode.y #define VIDEO_MODE_RESOLUTION mode.resolution_id -#define VIDEO_MODE_DEPTH (int)mode.depth +#define VIDEO_MODE_DEPTH mode.depth #endif #endif /* VIDEO_BLIT_H */ diff --git a/BasiliskII/src/Unix/video_vosf.h b/BasiliskII/src/Unix/video_vosf.h index f34b9b02..df884a6b 100644 --- a/BasiliskII/src/Unix/video_vosf.h +++ b/BasiliskII/src/Unix/video_vosf.h @@ -390,7 +390,7 @@ static inline void update_display_window_vosf(VIDEO_DRV_INIT) VIDEO_DRV_LOCK_PIXELS; - if (VIDEO_MODE_DEPTH < VIDEO_DEPTH_8BIT) { + if ((int)VIDEO_MODE_DEPTH < VIDEO_DEPTH_8BIT) { // Update the_host_buffer and copy of the_buffer const int src_bytes_per_row = VIDEO_MODE_ROW_BYTES;