This commit is contained in:
jsalmon3 2004-06-12 17:39:37 +00:00
parent b3f0f9e12c
commit 2a32252d39
27 changed files with 103 additions and 103 deletions

View file

@ -66,7 +66,7 @@
**
** @note Can be faster written.
*/
static int AiCheckSurrounding(const Unit * worker, const UnitType * type, int x, int y, int flag)
static int AiCheckSurrounding(const Unit* worker, const UnitType* type, int x, int y, int flag)
{
static int dirs[5][2] = {{1,0},{0,1},{-1,0},{0,-1},{0,0}};
int surrounding[1024]; // Max criconference for building
@ -148,8 +148,8 @@ static int AiCheckSurrounding(const Unit * worker, const UnitType * type, int x,
**
** @return True if place found, false if no found.
*/
static int AiFindBuildingPlace2(const Unit * worker, const UnitType * type,
int ox, int oy, int *dx, int *dy, int flag)
static int AiFindBuildingPlace2(const Unit* worker, const UnitType* type,
int ox, int oy, int* dx, int* dy, int flag)
{
static const int xoffset[] = { 0, -1, +1, 0, -1, +1, -1, +1 };
static const int yoffset[] = { -1, 0, 0, +1, -1, -1, +1, +1 };
@ -168,8 +168,8 @@ static int AiFindBuildingPlace2(const Unit * worker, const UnitType * type,
int ep;
int i;
int w;
unsigned char *m;
unsigned char *matrix;
unsigned char* m;
unsigned char* matrix;
points = malloc(TheMap.Width * TheMap.Height);
size = TheMap.Width * TheMap.Height / sizeof (*points);
@ -289,14 +289,14 @@ static int AiFindBuildingPlace2(const Unit * worker, const UnitType * type,
** @todo FIXME: This is slow really slow, using
** two flood fills, is not a perfect solution.
*/
static int AiFindHallPlace(const Unit * worker, const UnitType * type, int *dx, int *dy)
static int AiFindHallPlace(const Unit* worker, const UnitType* type, int* dx, int* dy)
{
static const int xoffset[] = { 0, -1, +1, 0, -1, +1, -1, +1 };
static const int yoffset[] = { -1, 0, 0, +1, -1, -1, +1, +1 };
struct {
unsigned short X;
unsigned short Y;
} *points;
} *points;
int size;
int x;
int y;
@ -308,10 +308,10 @@ static int AiFindHallPlace(const Unit * worker, const UnitType * type, int *dx,
int ep;
int i;
int w;
unsigned char *m;
unsigned char *morg;
unsigned char *matrix;
Unit *mine;
unsigned char* m;
unsigned char* morg;
unsigned char* matrix;
Unit* mine;
int destx;
int desty;
@ -456,15 +456,15 @@ static int AiFindHallPlace(const Unit * worker, const UnitType * type, int *dx,
** @todo FIXME: This is slow really slow, using two flood
** fills, is not a perfect solution.
*/
static int AiFindLumberMillPlace(const Unit * worker, const UnitType * type, int *dx,
int *dy)
static int AiFindLumberMillPlace(const Unit* worker, const UnitType* type, int* dx,
int* dy)
{
static const int xoffset[] = { 0, -1, +1, 0, -1, +1, -1, +1 };
static const int yoffset[] = { -1, 0, 0, +1, -1, -1, +1, +1 };
struct {
unsigned short X;
unsigned short Y;
} *points;
} *points;
int size;
int x;
int y;
@ -476,9 +476,9 @@ static int AiFindLumberMillPlace(const Unit * worker, const UnitType * type, int
int ep;
int i;
int w;
unsigned char *m;
unsigned char *morg;
unsigned char *matrix;
unsigned char* m;
unsigned char* morg;
unsigned char* matrix;
x = worker->X;
y = worker->Y;

View file

@ -113,7 +113,7 @@ static Unit* EnemyOnMapTile(const Unit* source, int tx, int ty)
**
** @note only works for water transporters!
*/
static void AiMarkWaterTransporter(const Unit * unit, unsigned char *matrix)
static void AiMarkWaterTransporter(const Unit* unit, unsigned char* matrix)
{
static const int xoffset[] = { 0, -1, +1, 0, -1, +1, -1, +1 };
static const int yoffset[] = { -1, 0, 0, +1, -1, -1, +1, +1 };
@ -385,12 +385,12 @@ int AiFindWall(AiForce* force)
int ep;
int i;
int w;
unsigned char *m;
unsigned char *matrix;
unsigned char* m;
unsigned char* matrix;
int destx;
int desty;
AiUnit *aiunit;
Unit *unit;
AiUnit* aiunit;
Unit* unit;
// Find a unit to use. Best choice is a land unit with range 1.
// Next best choice is any land unit. Otherwise just use the first.

View file

@ -49,7 +49,7 @@
**
** @param argc Number of command line argurments
*/
void beos_init(int argc, char **argv)
void beos_init(int argc, char** argv)
{
}

View file

@ -36,7 +36,7 @@ extern "C" {
**
** @param argc Number of command line argurments
*/
void beos_init(int argc, char **argv)
void beos_init(int argc, char** argv)
{
BPath path( argv[0] );
path.GetParent( &path );

View file

@ -393,7 +393,7 @@ static void RecalculateShownUnits(void)
const UnitType* type;
if (!ShownUnitTypes) {
ShownUnitTypes = malloc(sizeof(char *) * MaxUnitIndex);
ShownUnitTypes = malloc(sizeof(char*) * MaxUnitIndex);
}
for (n = i = 0; i < MaxUnitIndex; ++i) {
@ -1937,7 +1937,7 @@ static void CreateEditor(void)
++i;
}
n = i + 1;
EditorUnitTypes = malloc(sizeof(char *) * n);
EditorUnitTypes = malloc(sizeof(char*) * n);
for (i = 0; i < n; ++i) {
EditorUnitTypes[i] = UnitTypeWcNames[i];
}

View file

@ -85,12 +85,12 @@ static char* SaveGlobal(lua_State *l, int is_root)
{
int type_key;
int type_value;
const char *sep;
const char *key;
char *value;
char *res;
const char* sep;
const char* key;
char* value;
char* res;
int first;
char *tmp;
char* tmp;
int b;
// Assert(!is_root || !lua_gettop(l));

View file

@ -70,7 +70,7 @@ extern void EditorMainLoop(void);
extern void EditorUpdateDisplay(void);
/// Save a pud from editor
extern int EditorSavePud(const char *file);
extern int EditorSavePud(const char* file);
/// Register ccl features
extern void EditorCclRegister(void);

View file

@ -132,7 +132,7 @@ enum _game_font_ {
** Font names
** @todo should use the names of the real fonts.
*/
extern char *FontNames[];
extern char* FontNames[];
/*----------------------------------------------------------------------------
-- Functions

View file

@ -112,19 +112,19 @@ enum {
----------------------------------------------------------------------------*/
/// Library file open
extern CLFile *CLopen(const char *fn, long flags);
extern CLFile* CLopen(const char* fn, long flags);
/// Library file close
extern int CLclose(CLFile *file);
extern int CLclose(CLFile* file);
/// Library file flush
extern void CLflush(CLFile *file);
extern void CLflush(CLFile* file);
/// Library file read
extern int CLread(CLFile *file, void *buf, size_t len);
extern int CLread(CLFile* file, void* buf, size_t len);
/// Library file seek
extern int CLseek(CLFile *file, long offset, int whence);
extern int CLseek(CLFile* file, long offset, int whence);
/// Library file tell
extern long CLtell(CLFile *file);
extern long CLtell(CLFile* file);
/// Library file write
extern int CLprintf(CLFile *file, char *format, ...);
extern int CLprintf(CLFile* file, char* format, ...);
#endif // USE_ZLIB || USE_BZ2LIB

View file

@ -16,7 +16,7 @@ extern "C" {
#define LIBCDA_VERSION_STR "0.5"
extern const char *cd_error;
extern const char* cd_error;
int cd_init(void);

View file

@ -300,7 +300,7 @@ extern void VideoDrawTile(const int, int, int);
/// Draws tiles display and video mode independ
extern void MapDrawTile(int, int, int);
/// Vision Table to see where to locate goals and vision
extern unsigned char *VisionTable[3];
extern unsigned char* VisionTable[3];
/// Companion table for fast lookups
extern int *VisionLookup;

View file

@ -364,18 +364,18 @@ extern void InitMenuFuncHash(void);
extern void InitMenus(int race);
/// Draw menu
extern void DrawMenu(Menu *menu);
extern void DrawMenu(Menu* menu);
/// Draw menu button
extern void DrawMenuButton(MenuButtonId button, unsigned flags, int transparent, int w, int h,
int x, int y, const int font, const unsigned char *text, char *normalcolor, char *reversecolor);
int x, int y, const int font, const unsigned char* text, char* normalcolor, char* reversecolor);
/// Set menu backgound and draw it
extern void MenusSetBackground(void);
/// Draw and process a menu
extern void ProcessMenu(const char *MenuId, int Loop);
extern void ProcessMenu(const char* MenuId, int Loop);
/// End the current menu
extern void EndMenu(void);
/// Find a menu by id
extern Menu *FindMenu(const char *MenuId);
extern Menu *FindMenu(const char* MenuId);
/// The scenario path received from server, Update the client menu
extern int NetClientSelectScenario(void);
@ -423,10 +423,10 @@ extern void EditorLoadMenu(void);
extern void SetupEditor(void);
/// Error menu
extern void ErrorMenu(char *);
extern void ErrorMenu(char*);
/// Menu Loop
extern void MenuLoop(char *filename, WorldMap *map);
extern void MenuLoop(char* filename, WorldMap* map);
/// Pre menu setup
extern void PreMenuSetup(void);

View file

@ -62,7 +62,7 @@
*/
#ifdef __ULTRA_SPARC__
extern unsigned short inline AccessLE16(unsigned char *p) {
extern unsigned short inline AccessLE16(unsigned char* p) {
return p[0] + (p[1] << 8);
}
@ -77,7 +77,7 @@ extern unsigned short inline AccessLE16(unsigned char *p) {
*/
#ifdef __ULTRA_SPARC__
extern unsigned inline AccessLE32(unsigned char *p) {
extern unsigned inline AccessLE32(unsigned char* p) {
return p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] <<24);
}
@ -93,8 +93,8 @@ extern unsigned inline AccessLE32(unsigned char *p) {
*/
#ifdef __ULTRA_SPARC__
extern unsigned short inline _FetchLE16(unsigned char **pp) {
unsigned char *p = *pp;
extern unsigned short inline _FetchLE16(unsigned char** pp) {
unsigned char* p = *pp;
unsigned short i = p[0] + (p[1] << 8);
(*pp) += 2;
return i;
@ -113,8 +113,8 @@ extern unsigned short inline _FetchLE16(unsigned char **pp) {
*/
#ifdef __ULTRA_SPARC__
extern unsigned inline _FetchLE32(unsigned char **pp) {
unsigned char *p = *pp;
extern unsigned inline _FetchLE32(unsigned char** pp) {
unsigned char* p = *pp;
unsigned int i = p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] <<24);
(*pp) += 4;
return i;

View file

@ -213,8 +213,8 @@ extern void NetworkInitClientConnect(void); ///< Setup network connect state ma
extern void NetworkExitClientConnect(void); ///< Terminate network connect state machine for clients
extern void NetworkInitServerConnect(void); ///< Setup network connect state machine for the server
extern void NetworkExitServerConnect(void); ///< Terminate network connect state machine for the server
extern int NetworkParseSetupEvent(const char *buf, int size); ///< Parse a network connect event
extern int NetworkSetupServerAddress(const char *serveraddr); ///< Menu: Setup the server IP
extern int NetworkParseSetupEvent(const char* buf, int size); ///< Parse a network connect event
extern int NetworkSetupServerAddress(const char* serveraddr); ///< Menu: Setup the server IP
extern void NetworkProcessClientRequest(void); ///< Menu Loop: Send out client request messages
extern void NetworkProcessServerRequest(void); ///< Menu Loop: Send out server request messages
extern void NetworkServerResyncClients(void); ///< Menu Loop: Server: Mark clients state to send stateinfo message

View file

@ -92,7 +92,7 @@ struct _sample_ {
unsigned int Frequency; ///< frequency in hz
unsigned short BitsPerSample; ///< bits in a sample 8/16/32
unsigned char *Buffer; ///< sample buffer
unsigned char* Buffer; ///< sample buffer
int Pos; ///< buffer position
int Len; ///< length of filled buffer
};

View file

@ -196,7 +196,7 @@ typedef struct ConditionInfo {
char Opponent; ///< Target is opponent. (neutral is neither allied, nor opponent)
char Building; ///< Target is a building.
char TargetSelf; ///< Target is the same as the caster.
char *BoolFlag; ///< User defined boolean flag.
char* BoolFlag; ///< User defined boolean flag.
#if 0
// TODO: NOT IMPLEMENTED:
char UnitBuffed; ///< Target is buffed(haste/slow/bloodlust). Dispel magic?

View file

@ -360,7 +360,7 @@ extern void ShowLoadProgress(const char* fmt,...);
/// strdup + strcat
extern char* strdcat(const char* l, const char* r);
/// strdup + strcat + strcat
extern char* strdcat3(const char* l, const char *m, const char* r);
extern char* strdcat3(const char* l, const char* m, const char* r);
#if !defined(BSD)
/// case insensitive strstr

View file

@ -693,8 +693,8 @@ struct _unit_type_ {
int BurnPercent; ///< Burning percent.
int BurnDamageRate; ///< HP burn rate per sec
int RepairRange; ///< Units repair range.
char *CanCastSpell; ///< Unit is able to use spells.
char *AutoCastActive; ///< Default value for autocast.
char* CanCastSpell; ///< Unit is able to use spells.
char* AutoCastActive; ///< Default value for autocast.
int AutoBuildRate; ///< The rate at which the building builds itself
int RandomMovementProbability; ///< Probability to move randomly.
int ClicksToExplode; ///< Number of consecutive clicks until unit suicides.
@ -743,8 +743,8 @@ struct _unit_type_ {
unsigned BuilderLost : 1; ///< The builder is lost after the build.
unsigned CanHarvest : 1; ///< Resource can be harvested.
unsigned Harvester : 1; ///< unit is a resource harvester.
unsigned char *BoolFlag; ///< User defined flag. Used for (dis)allow target.
unsigned char *CanTargetFlag; ///< Flag needed to target with missile.
unsigned char* BoolFlag; ///< User defined flag. Used for (dis)allow target.
unsigned char* CanTargetFlag; ///< Flag needed to target with missile.
unsigned SelectableByRectangle : 1; ///< Selectable with mouse rectangle.
unsigned Decoration : 1; ///< Unit Is a decoration.
@ -797,7 +797,7 @@ extern UnitType*UnitTypeOrcWall; ///< Orc wall
extern char** UnitTypeWcNames; ///< Mapping wc-number 2 symbol
extern char **BoolFlagName; ///< Array of name of user defined bool flag.
extern char** BoolFlagName; ///< Array of name of user defined bool flag.
extern int NumberBoolFlag; ///< Number of user defined bool flag.
/*----------------------------------------------------------------------------

View file

@ -232,7 +232,7 @@ extern Graphic* MakeGraphic(SDL_Surface* surface);
/// Load a picture and display it on the screen (full screen),
/// changing the colormap and so on..
extern void DisplayPicture(const char *name);
extern void DisplayPicture(const char* name);
/// Init line draw
extern void InitLineDraw(void);

View file

@ -55,8 +55,8 @@
** Private flac data structure to handle flac streaming.
*/
typedef struct _flac_data_ {
FLAC__StreamDecoder *FlacStream; /// Decoder stream
CLFile *FlacFile; /// File handle
FLAC__StreamDecoder* FlacStream; /// Decoder stream
CLFile* FlacFile; /// File handle
} FlacData;
/*----------------------------------------------------------------------------
@ -70,8 +70,8 @@ typedef struct _flac_data_ {
** @param status Error state.
** @param user User data.
*/
static void FLAC_error_callback(const FLAC__StreamDecoder *stream,
FLAC__StreamDecoderErrorStatus status, void *user)
static void FLAC_error_callback(const FLAC__StreamDecoder* stream,
FLAC__StreamDecoderErrorStatus status, void* user)
{
DebugPrint(" %s\n" _C_ FLAC__StreamDecoderErrorStatusString[status]);
}
@ -87,11 +87,11 @@ static void FLAC_error_callback(const FLAC__StreamDecoder *stream,
** @return Error status.
*/
static FLAC__StreamDecoderReadStatus FLAC_read_callback(
const FLAC__StreamDecoder *stream, FLAC__byte buffer[],
unsigned int *bytes, void *user)
const FLAC__StreamDecoder* stream, FLAC__byte buffer[],
unsigned int* bytes, void* user)
{
Sample *sample;
FlacData *data;
Sample* sample;
FlacData* data;
unsigned int i;
sample = user;
@ -113,10 +113,10 @@ static FLAC__StreamDecoderReadStatus FLAC_read_callback(
** @param metadata metadata block
** @param user User data.
*/
static void FLAC_metadata_callback(const FLAC__StreamDecoder *stream,
const FLAC__StreamMetadata *metadata, void *user)
static void FLAC_metadata_callback(const FLAC__StreamDecoder* stream,
const FLAC__StreamMetadata* metadata, void* user)
{
Sample *sample;
Sample* sample;
if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
sample = user;
@ -143,14 +143,14 @@ static void FLAC_metadata_callback(const FLAC__StreamDecoder *stream,
** @return Error status.
*/
static FLAC__StreamDecoderWriteStatus FLAC_write_callback(
const FLAC__StreamDecoder *stream, const FLAC__Frame *frame,
const FLAC__int32* const buffer[], void *user)
const FLAC__StreamDecoder *stream, const FLAC__Frame* frame,
const FLAC__int32* const buffer[], void* user)
{
Sample *sample;
FlacData *data;
Sample* sample;
FlacData* data;
unsigned int i;
int j;
char *buf;
char* buf;
int ssize;
sample = user;
@ -195,9 +195,9 @@ static FLAC__StreamDecoderWriteStatus FLAC_write_callback(
**
** @return Number of bytes read
*/
static int FlacStreamRead(Sample *sample, void *buf, int len)
static int FlacStreamRead(Sample* sample, void* buf, int len)
{
FlacData *data;
FlacData* data;
data = sample->User;
@ -228,9 +228,9 @@ static int FlacStreamRead(Sample *sample, void *buf, int len)
**
** @param sample Sample to free
*/
static void FlacStreamFree(Sample *sample)
static void FlacStreamFree(Sample* sample)
{
FlacData *data;
FlacData* data;
data = sample->User;
@ -259,7 +259,7 @@ static const SampleType FlacStreamSampleType = {
**
** @return Number of bytes read
*/
static int FlacRead(Sample *sample, void *buf, int len)
static int FlacRead(Sample* sample, void* buf, int len)
{
if (len > sample->Len) {
len = sample->Len;
@ -279,7 +279,7 @@ static int FlacRead(Sample *sample, void *buf, int len)
**
** @param sample Sample to free
*/
static void FlacFree(Sample *sample)
static void FlacFree(Sample* sample)
{
free(sample->User);
free(sample->Buffer);
@ -302,13 +302,13 @@ static const SampleType FlacSampleType = {
**
** @return Returns the loaded sample.
*/
Sample* LoadFlac(const char *name, int flags)
Sample* LoadFlac(const char* name, int flags)
{
Sample *sample;
FlacData *data;
CLFile *f;
Sample* sample;
FlacData* data;
CLFile* f;
unsigned int magic[1];
FLAC__StreamDecoder *stream;
FLAC__StreamDecoder* stream;
if (!(f = CLopen(name, CL_OPEN_READ))) {

View file

@ -72,7 +72,7 @@ static int get_subchnl(struct cdrom_subchnl* s)
*/
int cd_init(void)
{
char *device;
char* device;
device = getenv("CDAUDIO");
if (!device) {
@ -359,7 +359,7 @@ void cd_close(void)
static char _cd_error[256];
const char *cd_error = _cd_error;
const char* cd_error = _cd_error;
/* Hack. */
@ -372,7 +372,7 @@ static char end_pos[20];
static char ret[256];
static int command(char *fmt, ...)
static int command(char* fmt, ...)
{
char buf[256];
va_list ap;
@ -414,7 +414,7 @@ void cd_exit(void)
#define startof(track) (MCI_MAKE_TMSF(track, 0, 0, 0))
static char *lengthof(int track)
static char* lengthof(int track)
{
command("status cdaudio length track %u", track);
return ret;

View file

@ -117,7 +117,7 @@ static enum mad_flow MAD_write(void* user,
int i;
int j;
int n;
short *buf;
short* buf;
int s;
int comp;

View file

@ -66,7 +66,7 @@ static int WavStreamRead(Sample* sample, void* buf, int len)
{
WavData* data;
WavChunk chunk;
char *sndbuf;
char* sndbuf;
int comp; // number of compressed bytes actually read
int i;
int read;

View file

@ -118,7 +118,7 @@ static void laction(int i)
/**
** FIXME: docu
*/
static void l_message(const char *pname, const char *msg)
static void l_message(const char* pname, const char* msg)
{
if (pname) {
fprintf(stderr, "%s: ", pname);

View file

@ -257,7 +257,7 @@ int getopt(int argc, char** argv, char* opts)
{
static int sp = 1;
register int c;
register char *cp;
register char* cp;
optarg = NULL;

View file

@ -1576,7 +1576,7 @@ static int CclDefineUI(lua_State* l)
ui->PieY[pie]= (coeffY[pie] * radius) >> 8;
}
} else if (!strcmp(value, "mouse-button")) {
const char *button;
const char* button;
lua_rawgeti(l, j + 1, k + 1);
button = LuaToString(l, -1);

View file

@ -610,11 +610,11 @@ static void FontMeasureWidths(ColorFont* fp)
SDL_LockSurface(fp->Graphic->Surface);
for (y = 1; y < 207; ++y) {
sp = (const unsigned char *)fp->Graphic->Surface->pixels +
sp = (const unsigned char*)fp->Graphic->Surface->pixels +
y * fp->Height * fp->Graphic->Surface->pitch - 1;
gp = sp + fp->Graphic->Surface->pitch * fp->Height;
// Bail out if no letters left
if (gp >= ((const unsigned char *)fp->Graphic->Surface->pixels +
if (gp >= ((const unsigned char*)fp->Graphic->Surface->pixels +
fp->Graphic->Surface->pitch * fp->Graphic->Height)) {
break;
}