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 <anonymous>'
This commit is contained in:
gbeauche 2004-06-29 21:50:23 +00:00
parent eb9961585b
commit a4eb3b19ab
3 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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 */

View File

@ -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;