Some compile-time warnings removed.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@634 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2003-02-02 05:45:31 +00:00
parent 29f42c75cf
commit f02f5f5e82
18 changed files with 53 additions and 39 deletions
+4
View File
@@ -2971,6 +2971,10 @@ SOURCE=..\sc2code\comm.c
# End Source File
# Begin Source File
SOURCE=..\sc2code\comm.h
# End Source File
# Begin Source File
SOURCE=..\sc2code\commglue.c
# End Source File
# Begin Source File
+1
View File
@@ -22,6 +22,7 @@
#include <ctype.h>
#include <stdlib.h>
#include "port.h"
#ifndef HAVE_STRUPR
char *
-2
View File
@@ -12,9 +12,7 @@
#define stricmp strcasecmp
#endif
#ifndef HAVE_STRUPR
char *strupr (char *str);
#endif
#endif /* _PORT_H */
+1 -2
View File
@@ -100,8 +100,7 @@ if ((InputState & DEVICE_BUTTON3)
&& !(ElementPtr->state_flags & FINITE_LIFE)
&& ElementPtr->mass_points != MAX_SHIP_MASS * 10)
{
extern void flee_preprocess (PELEMENT
ElementPtr);
extern void flee_preprocess (PELEMENT);
battle_counter -= MAKE_WORD (1, 0);
+9 -8
View File
@@ -173,15 +173,15 @@ ActivateStarShip (COUNT which_ship, SIZE state)
)); hStarShip; hStarShip = hNextShip)
{
BOOLEAN RemoveShip;
SHIP_FRAGMENTPTR StarShipPtr;
SHIP_FRAGMENTPTR StarShipPtr2;
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
StarShipPtr2 = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (built_ship_q),
hStarShip
);
hNextShip = _GetSuccLink (StarShipPtr);
hNextShip = _GetSuccLink (StarShipPtr2);
RemoveShip = (BOOLEAN)(
GET_RACE_ID (StarShipPtr) == ORZ_SHIP
GET_RACE_ID (StarShipPtr2) == ORZ_SHIP
);
UnlockStarShip (
&GLOBAL (built_ship_q),
@@ -375,12 +375,13 @@ NameCaptain (PQUEUE pQueue, STARSHIPPTR StarShipPtr)
}
HSTARSHIP
CloneShipFragment (COUNT index, PQUEUE pDstQueue, BYTE crew_level)
CloneShipFragment (COUNT shipIndex, PQUEUE pDstQueue, BYTE crew_level)
{
HSTARSHIP hStarShip, hBuiltShip;
SHIP_FRAGMENTPTR TemplatePtr;
if ((hStarShip = GetStarShipFromIndex (&GLOBAL (avail_race_q), index)) == 0)
if ((hStarShip = GetStarShipFromIndex (&GLOBAL (avail_race_q),
shipIndex)) == 0)
return (0);
TemplatePtr = (SHIP_FRAGMENTPTR)LockStarShip (
@@ -390,7 +391,7 @@ CloneShipFragment (COUNT index, PQUEUE pDstQueue, BYTE crew_level)
Build (pDstQueue,
TemplatePtr->RaceResIndex,
TemplatePtr->ShipInfo.ship_flags & (GOOD_GUY | BAD_GUY),
(BYTE)(index == SAMATRA_SHIP ?
(BYTE)(shipIndex == SAMATRA_SHIP ?
0 : NameCaptain (pDstQueue, (STARSHIPPTR)TemplatePtr)));
if (hBuiltShip)
{
@@ -404,7 +405,7 @@ CloneShipFragment (COUNT index, PQUEUE pDstQueue, BYTE crew_level)
ShipFragPtr->ShipInfo.ship_flags = 0;
ShipFragPtr->ShipInfo.var1 = ShipFragPtr->ShipInfo.var2 = 0;
ShipFragPtr->ShipInfo.loc.x = ShipFragPtr->ShipInfo.loc.y = 0;
SET_RACE_ID (ShipFragPtr, (BYTE)index);
SET_RACE_ID (ShipFragPtr, (BYTE)shipIndex);
UnlockStarShip (pDstQueue, hBuiltShip);
}
UnlockStarShip (
+1 -1
View File
@@ -41,7 +41,7 @@
extern HSTARSHIP Build (PQUEUE pQueue, DWORD RaceResIndex, COUNT
which_player, BYTE captains_name_index);
extern HSTARSHIP CloneShipFragment (COUNT index, PQUEUE pDstQueue, BYTE
extern HSTARSHIP CloneShipFragment (COUNT shipIndex, PQUEUE pDstQueue, BYTE
crew_level);
extern HSTARSHIP GetStarShipFromIndex (PQUEUE pShipQ, COUNT Index);
extern BYTE NameCaptain (PQUEUE pQueue, STARSHIPPTR StarShipPtr);
+2 -1
View File
@@ -90,7 +90,8 @@ UninitKernel (BOOLEAN ships)
ActivityFrame = 0;
}
void UninitGameKernel ()
void
UninitGameKernel (void)
{
if (ActivityFrame)
{
+4 -3
View File
@@ -23,6 +23,7 @@
#include "starcon.h"
#include "commglue.h"
#include "options.h"
#include "comm.h"
void InitOscilloscope (int x, int y, int width, int height, FRAME_DESC *f);
void SetSliderImage (void *f);
@@ -439,7 +440,7 @@ static struct {
} XFormControl;
void
init_xform_control ()
init_xform_control (void)
{
XFormControl.XFormCurrent = XFormControl.XFormInsertPoint = 0;
XFormControl.XFormsPending = FALSE;
@@ -447,13 +448,13 @@ init_xform_control ()
}
void
uninit_xform_control ()
uninit_xform_control (void)
{
DestroySemaphore (XFormControl.XFormSem);
}
void
xform_complete ()
xform_complete (void)
{
SetSemaphore (XFormControl.XFormSem);
if (XFormControl.XFormsPending)
@@ -21,7 +21,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "starcon.h"
#include "libs/gfxlib.h"
+2 -2
View File
@@ -45,7 +45,7 @@ TFB_DrawScreen_Rect (PRECT rect, int r, int g, int b, SCREEN dest)
}
void
TFB_DrawScreen_SetPalette (int index, int r, int g, int b)
TFB_DrawScreen_SetPalette (int paletteIndex, int r, int g, int b)
{
TFB_DrawCommand DC;
@@ -53,7 +53,7 @@ TFB_DrawScreen_SetPalette (int index, int r, int g, int b)
DC.data.setpalette.r = r;
DC.data.setpalette.g = g;
DC.data.setpalette.b = b;
DC.data.setpalette.index = index;
DC.data.setpalette.index = paletteIndex;
TFB_EnqueueDrawCommand (&DC);
}
+1 -1
View File
@@ -59,7 +59,7 @@ void TFB_DrawScreen_FilledImage (TFB_Image *img, int x, int y, BOOLEAN scaled, i
void TFB_DrawScreen_CopyToImage (TFB_Image *img, PRECT lpRect, SCREEN src);
void TFB_DrawScreen_DeleteImage (TFB_Image *img);
void TFB_DrawScreen_WaitForSignal (void);
void TFB_DrawScreen_SetPalette (int index, int r, int g, int b);
void TFB_DrawScreen_SetPalette (int paletteIndex, int r, int g, int b);
void TFB_FlushPaletteCache (void);
void TFB_DrawImage_Line (int x1, int y1, int x2, int y2, int r, int g, int b, TFB_Image *dest);
+1 -1
View File
@@ -101,7 +101,7 @@ extern void WaitThread (Thread thread, int *status);
typedef void *Semaphore;
#ifdef DEBUG_TRACK_SEM
extern Semaphore CreateSemaphoreAux (DWORD initial, char *sem_name);
extern Semaphore CreateSemaphoreAux (DWORD initial, const char *sem_name);
# define CreateSemaphore(initial,sem_name) \
CreateSemaphoreAux ((initial), (sem_name))
extern void ResetSemaphoreOwnerAux (Semaphore sem);
+1 -1
View File
@@ -342,7 +342,7 @@ PrintThreadsStats (void)
Semaphore
CreateSemaphoreAux (DWORD initial
#ifdef DEBUG_TRACK_SEM
, char *sem_name
, const char *sem_name
#endif
)
{
+9 -3
View File
@@ -51,19 +51,25 @@ load_ship (STARSHIPPTR StarShipPtr, BOOLEAN LoadBattleData)
CaptureDrawable (LoadGraphic (
(RESOURCE)StarShipPtr->RaceDescPtr->ship_info.icons
))) == 0)
/* goto BadLoad */;
{
/* goto BadLoad */
}
if ((StarShipPtr->RaceDescPtr->ship_info.melee_icon =
CaptureDrawable (LoadGraphic (
(RESOURCE)StarShipPtr->RaceDescPtr->ship_info.melee_icon
))) == 0)
/* goto BadLoad */;
{
/* goto BadLoad */
}
if ((StarShipPtr->RaceDescPtr->ship_info.race_strings =
CaptureStringTable (LoadStringTable (
(RESOURCE)StarShipPtr->RaceDescPtr->ship_info.race_strings
))) == 0)
/* goto BadLoad */;
{
/* goto BadLoad */
}
if (LoadBattleData)
{
+6 -4
View File
@@ -63,10 +63,12 @@ DWORD **getpixelarray(FRAME FramePtr,int width, int height);
#define DIAMETER (TWORADIUS + 1)
#define DIFFUSE_BITS 24
//#define GET_LIGHT(val, dif, sp) \
// ( (UBYTE)min ((sp) + \
// ( ( ( (DWORD)(val) << DIFFUSE_BITS ) - (DWORD)(val) * (dif) ) >> DIFFUSE_BITS ) \
// , 255) )
#if 0
#define GET_LIGHT(val, dif, sp) \
( (UBYTE)min ((sp) + \
( ( ( (DWORD)(val) << DIFFUSE_BITS ) - (DWORD)(val) * (dif) ) >> DIFFUSE_BITS ) \
, 255) )
#endif
UBYTE GET_LIGHT (UBYTE val, DWORD dif, UBYTE sp)
{
DWORD i = (DWORD)val << DIFFUSE_BITS;
+2
View File
@@ -889,9 +889,11 @@ DoModifyShips (INPUT_STATE InputState, PMENU_STATE pMS)
}
if (hStarShip)
{
UnlockStarShip (
&GLOBAL (built_ship_q), hStarShip
);
}
CrewTransaction (crew_delta);
}
-1
View File
@@ -44,7 +44,6 @@ extern int ScreenHeight;
#include "config.h"
#include "../port.h"
#include <stdlib.h>
#include <math.h>
#include "gfxlib.h"
#include "inplib.h"
#include "timelib.h"
+9 -8
View File
@@ -36,6 +36,7 @@
#include "file.h"
#include "port.h"
#include "options.h"
#include "comm.h"
#if defined(GFXMODULE_SDL) || defined(SOUNDMODULE_SDL)
# include <SDL.h>
@@ -59,11 +60,11 @@ CDToContentDir (char *contentdir)
}
static int
Check_PC_3DO_opt (char *value, DWORD mask, char *opt)
Check_PC_3DO_opt (const char *value, DWORD mask, const char *opt)
{
if (value == NULL)
{
fprintf (stderr, "option '%s' requires a value!\n",opt);
fprintf (stderr, "option '%s' requires a value!\n", opt);
return -1;
}
@@ -71,7 +72,7 @@ Check_PC_3DO_opt (char *value, DWORD mask, char *opt)
return OPT_3DO;
if ((mask & OPT_PC) && strcmp (value, "pc") == 0)
return OPT_PC;
fprintf (stderr, "Unknown option '%s %s' found!",opt, value);
fprintf (stderr, "Unknown option '%s %s' found!", opt, value);
return -1;
}
@@ -215,31 +216,31 @@ main (int argc, char *argv[])
case 'm':
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
long_options[option_index].name)) != -1)
optWhichMusic = val;
break;
case CSCAN_OPT:
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
long_options[option_index].name)) != -1)
optWhichCoarseScan = val;
break;
case MENU_OPT:
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
long_options[option_index].name)) != -1)
optWhichMenu = val;
break;
case FONT_OPT:
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
long_options[option_index].name)) != -1)
optWhichFonts = val;
break;
case SCROLL_OPT:
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
long_options[option_index].name)) != -1)
optSmoothScroll = val;
break;
default: