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