From 3fab89624a6576c0c705d28b42203bf06edca5cf Mon Sep 17 00:00:00 2001 From: mcmartin Date: Mon, 3 Mar 2003 00:21:05 +0000 Subject: [PATCH] Removed some compiler warnings. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@841 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/boxint.c | 3 +++ sc2/src/sc2code/libs/graphics/font.c | 3 ++- sc2/src/sc2code/libs/graphics/gfx_common.c | 2 ++ sc2/src/sc2code/libs/graphics/gfx_common.h | 2 +- sc2/src/sc2code/libs/graphics/sdl/3do_blt.c | 5 +++++ sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c | 15 ++++++++++++++- sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c | 1 - sc2/src/sc2code/libs/graphics/sdl/opengl.c | 3 +++ sc2/src/sc2code/libs/graphics/sdl/primitives.c | 2 +- sc2/src/sc2code/libs/graphics/sdl/pure.c | 14 ++++++++------ sc2/src/sc2code/libs/graphics/tfb_draw.h | 2 +- sc2/src/sc2code/libs/graphics/tfb_prim.c | 2 ++ 12 files changed, 42 insertions(+), 12 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/boxint.c b/sc2/src/sc2code/libs/graphics/boxint.c index e85d32932..f3c08e16a 100644 --- a/sc2/src/sc2code/libs/graphics/boxint.c +++ b/sc2/src/sc2code/libs/graphics/boxint.c @@ -104,7 +104,10 @@ BoxIntersect (PRECT pr1, PRECT pr2, PRECT pinter) void BoxUnion (PRECT pr1, PRECT pr2, PRECT punion) { +#if NEVER // Part of lower FIXME. COORD x2, y2, w2, h2; +#endif // NEVER + // Union is A AND B, put together, correct? Returns a bigger box that // encompasses the two. punion->corner.x = MIN(pr1->corner.x, pr2->corner.x); diff --git a/sc2/src/sc2code/libs/graphics/font.c b/sc2/src/sc2code/libs/graphics/font.c index 6291c09d4..7fd875a75 100644 --- a/sc2/src/sc2code/libs/graphics/font.c +++ b/sc2/src/sc2code/libs/graphics/font.c @@ -17,6 +17,7 @@ */ #include "gfxintrn.h" +#include "tfb_prim.h" extern FRAME Build_Font_Effect (FRAME FramePtr, DWORD from, DWORD to, BYTE type); @@ -26,7 +27,7 @@ static struct { DWORD from; DWORD to; BYTE type; -} FontEffect = {0,0,0}; +} FontEffect = {0,0,0,0}; void SetContextFontEffect (BYTE type, DWORD from, DWORD to) { diff --git a/sc2/src/sc2code/libs/graphics/gfx_common.c b/sc2/src/sc2code/libs/graphics/gfx_common.c index 66633cc9d..9276894b7 100644 --- a/sc2/src/sc2code/libs/graphics/gfx_common.c +++ b/sc2/src/sc2code/libs/graphics/gfx_common.c @@ -39,6 +39,7 @@ void SetGraphicUseOtherExtra (int other) //Could this possibly be more cryptic?!? :) { //fprintf(stderr, "SetGraphicUseOtherExtra %d\n", other); + (void)other; /* lint */ } // Status: Ignored (only used in solarsys.c) @@ -46,6 +47,7 @@ void SetGraphicGrabOther (int grab_other) { //fprintf(stderr, "SetGraphicGrabOther %d\n", grab_other); + (void)grab_other; /* lint */ } void diff --git a/sc2/src/sc2code/libs/graphics/gfx_common.h b/sc2/src/sc2code/libs/graphics/gfx_common.h index 7b4ec11c6..76b73f687 100644 --- a/sc2/src/sc2code/libs/graphics/gfx_common.h +++ b/sc2/src/sc2code/libs/graphics/gfx_common.h @@ -52,7 +52,7 @@ void LoadIntoExtraScreen (PRECT r); void DrawFromExtraScreen (PRECT r); void SetGraphicGrabOther (int grab_other); void SetGraphicScale (int scale); -int GetGraphicScale (); +int GetGraphicScale (void); void SetGraphicUseOtherExtra (int other); void ScreenTransition (int transition, PRECT pRect); diff --git a/sc2/src/sc2code/libs/graphics/sdl/3do_blt.c b/sc2/src/sc2code/libs/graphics/sdl/3do_blt.c index 54f192022..d4834f721 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/3do_blt.c +++ b/sc2/src/sc2code/libs/graphics/sdl/3do_blt.c @@ -58,6 +58,11 @@ static DRAWABLE alloc_image (COUNT NumFrames, DRAWABLE_TYPE DrawableType, CREATE_FLAGS flags, SIZE width, SIZE height) { + /* dodge compiler warnings */ + (void)DrawableType; + (void)flags; + (void)width; + (void)height; return AllocDrawable (NumFrames, 0); } diff --git a/sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c b/sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c index ef1b81ee2..7f8a93903 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c +++ b/sc2/src/sc2code/libs/graphics/sdl/3do_funcs.c @@ -42,6 +42,10 @@ InitGraphics (int argc, char* argv[], COUNT KbytesRequired) LoadDisplay (&_pCurDisplay); ActivateDisplay (); + (void) argc; /* lint */ + (void) argv; /* lint */ + (void) KbytesRequired; /* lint */ + ret = TRUE; return (ret); } @@ -117,6 +121,7 @@ ScreenTransition (int TransType, PRECT pRect) Task transition_task; //fprintf(stderr, "ScreenTransition %d\n", TransType); + (void) TransType; /* dodge compiler warning */ if (TransitionAmount != 255) return; @@ -164,6 +169,8 @@ InitVideo (BOOLEAN useCDROM) //useCDROM doesn't really apply to us... { BOOLEAN ret; + (void)useCDROM; /* dodge compiler warning */ + // fprintf (stderr, "Unimplemented function activated: InitVideo()\n"); ret = TRUE; return (ret); @@ -202,6 +209,10 @@ VidPlay (VIDEO_REF VidRef, char *loopname, BOOLEAN uninit) VIDEO_TYPE ret; ret = 0; + /* dodge compiler warnings */ + (void) VidRef; + (void) loopname; + (void) uninit; // fprintf (stderr, "Unimplemented function activated: VidPlay()\n"); return (ret); } @@ -212,11 +223,13 @@ _init_video_file(PVOID pStr) VIDEO_REF ret; fprintf (stderr, "Unimplemented function activated: _init_video_file()\n"); + + /* dodge compiler warning */ + (void) pStr; ret = 0; return (ret); } -// Status: Implemented BOOLEAN _image_intersect (PIMAGE_BOX box1, PIMAGE_BOX box2, PRECT rect) { diff --git a/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c b/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c index e40beef63..be677f62c 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c +++ b/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c @@ -212,7 +212,6 @@ void fill_frame_rgb (FRAMEPTR FramePtr, Uint32 color, int x0, int y0, int x, int void arith_frame_blit (FRAMEPTR srcFrame, RECT *rsrc, FRAMEPTR dstFrame, RECT *rdst, int num,int denom) { - int add = 0, sub = 0; TFB_Image *srcImg, *dstImg; SDL_Surface *src, *dst; SDL_Rect srcRect, dstRect, *srp = NULL, *drp = NULL; diff --git a/sc2/src/sc2code/libs/graphics/sdl/opengl.c b/sc2/src/sc2code/libs/graphics/sdl/opengl.c index 5df929596..23c16b74f 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/opengl.c +++ b/sc2/src/sc2code/libs/graphics/sdl/opengl.c @@ -409,6 +409,9 @@ TFB_GL_SwapBuffers (int force_full_redraw) TFB_GL_ScanLines (); SDL_GL_SwapBuffers (); + + /* remove compiler warning */ + (void) force_full_redraw; } SDL_Surface* diff --git a/sc2/src/sc2code/libs/graphics/sdl/primitives.c b/sc2/src/sc2code/libs/graphics/sdl/primitives.c index a5e2e60de..506be8856 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/primitives.c +++ b/sc2/src/sc2code/libs/graphics/sdl/primitives.c @@ -200,7 +200,7 @@ void line(int x1, int y1, int x2, int y2, Uint32 color, PutPixelFn plot, SDL_Sur // Clips line against rectangle using Cohen-Sutherland algorithm -static enum {C_TOP = 0x1, C_BOTTOM = 0x2, C_RIGHT = 0x4, C_LEFT = 0x8}; +enum {C_TOP = 0x1, C_BOTTOM = 0x2, C_RIGHT = 0x4, C_LEFT = 0x8}; static int compute_code (float x, float y, float xmin, float ymin, float xmax, float ymax) diff --git a/sc2/src/sc2code/libs/graphics/sdl/pure.c b/sc2/src/sc2code/libs/graphics/sdl/pure.c index 1fca429a6..84dcf6555 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/pure.c +++ b/sc2/src/sc2code/libs/graphics/sdl/pure.c @@ -163,9 +163,10 @@ static void ScanLines (SDL_Surface *dst, SDL_Rect *r) Uint16 *p = (Uint16 *) &pixels[y * dst->pitch + (rx << 1)]; for (x = 0; x < rw; ++x) { - *p++ = ((((*p & fmt->Rmask) * 3) >> 2) & fmt->Rmask) | - ((((*p & fmt->Gmask) * 3) >> 2) & fmt->Gmask) | - ((((*p & fmt->Bmask) * 3) >> 2) & fmt->Bmask); + *p = ((((*p & fmt->Rmask) * 3) >> 2) & fmt->Rmask) | + ((((*p & fmt->Gmask) * 3) >> 2) & fmt->Gmask) | + ((((*p & fmt->Bmask) * 3) >> 2) & fmt->Bmask); + ++p; } } break; @@ -211,9 +212,10 @@ static void ScanLines (SDL_Surface *dst, SDL_Rect *r) Uint32 *p = (Uint32 *) &pixels[y * dst->pitch + (rx << 2)]; for (x = 0; x < rw; ++x) { - *p++ = ((((*p & fmt->Rmask) * 3) >> 2) & fmt->Rmask) | - ((((*p & fmt->Gmask) * 3) >> 2) & fmt->Gmask) | - ((((*p & fmt->Bmask) * 3) >> 2) & fmt->Bmask); + *p = ((((*p & fmt->Rmask) * 3) >> 2) & fmt->Rmask) | + ((((*p & fmt->Gmask) * 3) >> 2) & fmt->Gmask) | + ((((*p & fmt->Bmask) * 3) >> 2) & fmt->Bmask); + ++p; } } break; diff --git a/sc2/src/sc2code/libs/graphics/tfb_draw.h b/sc2/src/sc2code/libs/graphics/tfb_draw.h index 08373f408..7e3008fa3 100644 --- a/sc2/src/sc2code/libs/graphics/tfb_draw.h +++ b/sc2/src/sc2code/libs/graphics/tfb_draw.h @@ -88,6 +88,6 @@ void TFB_DrawCanvas_FilledImage (TFB_Image *img, int x, int y, int scale, int r, TFB_Palette *TFB_DrawCanvas_ExtractPalette (TFB_Canvas canvas); void TFB_DrawCanvas_SetPalette (TFB_Canvas target, TFB_Palette *palette); int TFB_DrawCanvas_GetTransparentIndex (TFB_Canvas canvas); -void TFB_DrawCanvas_SetTransparentIndex (TFB_Canvas canvas, int index); +void TFB_DrawCanvas_SetTransparentIndex (TFB_Canvas canvas, int i); #endif diff --git a/sc2/src/sc2code/libs/graphics/tfb_prim.c b/sc2/src/sc2code/libs/graphics/tfb_prim.c index f738597e5..a5040a99c 100644 --- a/sc2/src/sc2code/libs/graphics/tfb_prim.c +++ b/sc2/src/sc2code/libs/graphics/tfb_prim.c @@ -22,8 +22,10 @@ * worry about this. */ #include "gfxintrn.h" +#include "gfx_common.h" #include "tfb_draw.h" #include "tfb_prim.h" +#include "cmap.h" void TFB_Prim_Point (PPOINT p, TFB_Palette *color)