(svn r10673) -Cleanup: some assorted style cleanups. Primarily type* var -> type *var.
authorrubidium
Tue, 24 Jul 2007 17:01:23 +0000
changeset 7814 fe643468ad64
parent 7813 49fbe41f8a04
child 7815 04deaeb181ab
(svn r10673) -Cleanup: some assorted style cleanups. Primarily type* var -> type *var.
src/aircraft.h
src/bridge.h
src/driver.h
src/economy.h
src/engine.h
src/functions.h
src/gfx.h
src/industry_map.h
src/mixer.h
src/player.h
src/queue.h
src/roadveh.h
src/ship.h
src/sprite.h
src/station_map.h
src/string.h
src/strings.h
src/thread.h
src/town_map.h
src/vehicle.h
src/viewport.h
src/waypoint.h
--- a/src/aircraft.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/aircraft.h	Tue Jul 24 17:01:23 2007 +0000
@@ -35,7 +35,7 @@
  * @param v vehicle to check
  * @return true if in hangar
  */
-static inline bool IsAircraftInHangar(const Vehicle* v)
+static inline bool IsAircraftInHangar(const Vehicle *v)
 {
 	assert(v->type == VEH_AIRCRAFT);
 	return v->vehstatus & VS_HIDDEN && IsHangarTile(v->tile);
@@ -45,7 +45,7 @@
  * @param v vehicle to check
  * @return true if in hangar and stopped
  */
-static inline bool IsAircraftInHangarStopped(const Vehicle* v)
+static inline bool IsAircraftInHangarStopped(const Vehicle *v)
 {
 	return IsAircraftInHangar(v) && v->vehstatus & VS_STOPPED;
 }
--- a/src/bridge.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/bridge.h	Tue Jul 24 17:01:23 2007 +0000
@@ -35,6 +35,6 @@
 	return &_bridge[i];
 }
 
-void DrawBridgeMiddle(const TileInfo* ti);
+void DrawBridgeMiddle(const TileInfo *ti);
 
 #endif /* BRIDGE_H */
--- a/src/driver.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/driver.h	Tue Jul 24 17:01:23 2007 +0000
@@ -11,8 +11,8 @@
 #include <string>
 #include <map>
 
-bool GetDriverParamBool(const char* const* parm, const char* name);
-int GetDriverParamInt(const char* const* parm, const char* name, int def);
+bool GetDriverParamBool(const char * const *parm, const char *name);
+int GetDriverParamInt(const char * const *parm, const char *name, int def);
 
 class Driver {
 public:
--- a/src/economy.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/economy.h	Tue Jul 24 17:01:23 2007 +0000
@@ -61,7 +61,7 @@
 int UpdateCompanyRatingAndValue(Player *p, bool update);
 
 VARDEF Subsidy _subsidies[MAX_PLAYERS];
-Pair SetupSubsidyDecodeParam(const Subsidy* s, bool mode);
+Pair SetupSubsidyDecodeParam(const Subsidy *s, bool mode);
 void DeleteSubsidyWithTown(TownID index);
 void DeleteSubsidyWithIndustry(IndustryID index);
 void DeleteSubsidyWithStation(StationID index);
--- a/src/engine.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/engine.h	Tue Jul 24 17:01:23 2007 +0000
@@ -45,7 +45,7 @@
 	                    //       kind of visual effect to generate for a vehicle (default, steam, diesel, electric).
 	                    //       Same goes for the callback result, which atm is only used to check if a wagon is powered.
 	byte shorten_factor;   ///< length on main map for this type is 8 - shorten_factor
-	byte tractive_effort; ///< Tractive effort coefficient
+	byte tractive_effort;  ///< Tractive effort coefficient
 	byte user_def_data;    ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles
 };
 
@@ -309,7 +309,7 @@
  * @param  erl The renewlist for a given player.
  * @return The new renewlist for the player.
  */
-void RemoveAllEngineReplacement(EngineRenewList* erl);
+void RemoveAllEngineReplacement(EngineRenewList *erl);
 
 /**
  * Retrieve the engine replacement in a given renewlist for an original engine type.
@@ -328,7 +328,7 @@
  * @param flags The calling command flags.
  * @return 0 on success, CMD_ERROR on failure.
  */
-CommandCost AddEngineReplacement(EngineRenewList* erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags);
+CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags);
 
 /**
  * Remove an engine replacement from a given renewlist.
@@ -337,7 +337,7 @@
  * @param flags The calling command flags.
  * @return 0 on success, CMD_ERROR on failure.
  */
-CommandCost RemoveEngineReplacement(EngineRenewList* erl, EngineID engine, GroupID group, uint32 flags);
+CommandCost RemoveEngineReplacement(EngineRenewList *erl, EngineID engine, GroupID group, uint32 flags);
 
 /** When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists
  * @param type The type of engine
--- a/src/functions.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/functions.h	Tue Jul 24 17:01:23 2007 +0000
@@ -96,7 +96,7 @@
 /* misc.cpp */
 bool IsCustomName(StringID id);
 void DeleteName(StringID id);
-char *GetName(char *buff, StringID id, const char* last);
+char *GetName(char *buff, StringID id, const char *last);
 
 #define AllocateName(name, skip) RealAllocateName(name, skip, false)
 StringID RealAllocateName(const char *name, byte skip, bool check_double);
@@ -117,7 +117,7 @@
 
 void ResetObjectToPlace();
 
-bool ScrollWindowTo(int x, int y, Window * w, bool instant = false);
+bool ScrollWindowTo(int x, int y, Window *w, bool instant = false);
 
 bool ScrollMainWindowToTile(TileIndex tile, bool instant = false);
 bool ScrollMainWindowTo(int x, int y, bool instant = false);
--- a/src/gfx.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/gfx.h	Tue Jul 24 17:01:23 2007 +0000
@@ -110,7 +110,7 @@
 typedef int32 CursorID;
 
 struct Point {
-	int x,y;
+	int x, y;
 };
 
 struct Rect {
--- a/src/industry_map.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/industry_map.h	Tue Jul 24 17:01:23 2007 +0000
@@ -68,7 +68,7 @@
  * @pre IsTileType(t, MP_INDUSTRY)
  * @return the industry
  */
-static inline Industry* GetIndustryByTile(TileIndex t)
+static inline Industry *GetIndustryByTile(TileIndex t)
 {
 	return GetIndustry(GetIndustryIndex(t));
 }
--- a/src/mixer.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/mixer.h	Tue Jul 24 17:01:23 2007 +0000
@@ -15,9 +15,9 @@
 };
 
 bool MxInitialize(uint rate);
-void MxMixSamples(void* buffer, uint samples);
+void MxMixSamples(void *buffer, uint samples);
 
-MixerChannel* MxAllocateChannel();
+MixerChannel *MxAllocateChannel();
 void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, uint size, uint rate, uint flags);
 void MxSetChannelVolume(MixerChannel *mc, uint left, uint right);
 void MxActivateChannel(MixerChannel*);
--- a/src/player.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/player.h	Tue Jul 24 17:01:23 2007 +0000
@@ -212,8 +212,8 @@
 
 void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player);
 void GetNameOfOwner(Owner owner, TileIndex tile);
-Money CalculateCompanyValue(const Player* p);
-void InvalidatePlayerWindows(const Player* p);
+Money CalculateCompanyValue(const Player *p);
+void InvalidatePlayerWindows(const Player *p);
 void SetLocalPlayer(PlayerID new_player);
 #define FOR_ALL_PLAYERS(p) for (p = _players; p != endof(_players); p++)
 
@@ -236,7 +236,7 @@
 	return count;
 }
 
-static inline Player* GetPlayer(PlayerID i)
+static inline Player *GetPlayer(PlayerID i)
 {
 	assert(IS_INSIDE_1D(i, PLAYER_FIRST, lengthof(_players)));
 	return &_players[i];
@@ -282,7 +282,7 @@
  * @param p the player "in action"
  * @return The "best" railtype a player has available
  */
-static inline RailType GetBestRailtype(const Player* p)
+static inline RailType GetBestRailtype(const Player *p)
 {
 	if (HasRailtypeAvail(p, RAILTYPE_MAGLEV)) return RAILTYPE_MAGLEV;
 	if (HasRailtypeAvail(p, RAILTYPE_MONO)) return RAILTYPE_MONO;
--- a/src/queue.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/queue.h	Tue Jul 24 17:01:23 2007 +0000
@@ -12,20 +12,20 @@
 
 
 struct Queue;
-typedef bool Queue_PushProc(Queue* q, void* item, int priority);
-typedef void* Queue_PopProc(Queue* q);
-typedef bool Queue_DeleteProc(Queue* q, void* item, int priority);
-typedef void Queue_ClearProc(Queue* q, bool free_values);
-typedef void Queue_FreeProc(Queue* q, bool free_values);
+typedef bool Queue_PushProc(Queue *q, void *item, int priority);
+typedef void* Queue_PopProc(Queue *q);
+typedef bool Queue_DeleteProc(Queue *q, void* item, int priority);
+typedef void Queue_ClearProc(Queue *q, bool free_values);
+typedef void Queue_FreeProc(Queue *q, bool free_values);
 
 struct InsSortNode {
-	void* item;
+	void *item;
 	int priority;
 	InsSortNode* next;
 };
 
 struct BinaryHeapNode {
-	void* item;
+	void *item;
 	int priority;
 };
 
@@ -35,39 +35,39 @@
 	 * Pushes an element into the queue, at the appropriate place for the queue.
 	 * Requires the queue pointer to be of an appropriate type, of course.
 	 */
-	Queue_PushProc* push;
+	Queue_PushProc *push;
 	/*
 	 * Pops the first element from the queue. What exactly is the first element,
 	 * is defined by the exact type of queue.
 	 */
-	Queue_PopProc* pop;
+	Queue_PopProc *pop;
 	/*
 	 * Deletes the item from the queue. priority should be specified if
 	 * known, which speeds up the deleting for some queue's. Should be -1
 	 * if not known.
 	 */
-	Queue_DeleteProc* del;
+	Queue_DeleteProc *del;
 
 	/* Clears the queue, by removing all values from it. It's state is
 	 * effectively reset. If free_items is true, each of the items cleared
 	 * in this way are free()'d.
 	 */
-	Queue_ClearProc* clear;
+	Queue_ClearProc *clear;
 	/* Frees the queue, by reclaiming all memory allocated by it. After
 	 * this it is no longer usable. If free_items is true, any remaining
 	 * items are free()'d too.
 	 */
-	Queue_FreeProc* free;
+	Queue_FreeProc *free;
 
 	union {
 		struct {
-			InsSortNode* first;
+			InsSortNode *first;
 		} inssort;
 		struct {
 			uint max_size;
 			uint size;
 			uint blocks; ///< The amount of blocks for which space is reserved in elements
-			BinaryHeapNode** elements;
+			BinaryHeapNode **elements;
 		} binaryheap;
 	} data;
 };
@@ -79,7 +79,7 @@
 
 /* Initializes a inssort and allocates internal memory. There is no maximum
  * size */
-void init_InsSort(Queue* q);
+void init_InsSort(Queue *q);
 
 
 /*
@@ -93,7 +93,7 @@
 
 /** Initializes a binary heap and allocates internal memory for maximum of
  * max_size elements */
-void init_BinaryHeap(Queue* q, uint max_size);
+void init_BinaryHeap(Queue *q, uint max_size);
 
 
 /*
@@ -102,8 +102,8 @@
 struct HashNode {
 	uint key1;
 	uint key2;
-	void* value;
-	HashNode* next;
+	void *value;
+	HashNode *next;
 };
 /**
  * Generates a hash code from the given key pair. You should make sure that
@@ -112,16 +112,16 @@
 typedef uint Hash_HashProc(uint key1, uint key2);
 struct Hash {
 	/* The hash function used */
-	Hash_HashProc* hash;
+	Hash_HashProc *hash;
 	/* The amount of items in the hash */
 	uint size;
 	/* The number of buckets allocated */
 	uint num_buckets;
 	/* A pointer to an array of num_buckets buckets. */
-	HashNode* buckets;
+	HashNode *buckets;
 	/* A pointer to an array of numbuckets booleans, which will be true if
 	 * there are any Nodes in the bucket */
-	bool* buckets_in_use;
+	bool *buckets_in_use;
 };
 
 /* Call these function to manipulate a hash */
@@ -129,32 +129,32 @@
 /** Deletes the value with the specified key pair from the hash and returns
  * that value. Returns NULL when the value was not present. The value returned
  * is _not_ free()'d! */
-void* Hash_Delete(Hash* h, uint key1, uint key2);
+void *Hash_Delete(Hash *h, uint key1, uint key2);
 /** Sets the value associated with the given key pair to the given value.
  * Returns the old value if the value was replaced, NULL when it was not yet present. */
-void* Hash_Set(Hash* h, uint key1, uint key2, void* value);
+void *Hash_Set(Hash *h, uint key1, uint key2, void *value);
 /** Gets the value associated with the given key pair, or NULL when it is not
  * present. */
-void* Hash_Get(const Hash* h, uint key1, uint key2);
+void *Hash_Get(const Hash *h, uint key1, uint key2);
 
 /* Call these function to create/destroy a hash */
 
 /** Builds a new hash in an existing struct. Make sure that hash() always
  * returns a hash less than num_buckets! Call delete_hash after use */
-void init_Hash(Hash* h, Hash_HashProc* hash, uint num_buckets);
+void init_Hash(Hash *h, Hash_HashProc *hash, uint num_buckets);
 /**
  * Deletes the hash and cleans up. Only cleans up memory allocated by new_Hash
  * & friends. If free is true, it will call free() on all the values that
  * are left in the hash.
  */
-void delete_Hash(Hash* h, bool free_values);
+void delete_Hash(Hash *h, bool free_values);
 /**
  * Cleans the hash, but keeps the memory allocated
  */
-void clear_Hash(Hash* h, bool free_values);
+void clear_Hash(Hash *h, bool free_values);
 /**
  * Gets the current size of the Hash
  */
-uint Hash_Size(const Hash* h);
+uint Hash_Size(const Hash *h);
 
 #endif /* QUEUE_H */
--- a/src/roadveh.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/roadveh.h	Tue Jul 24 17:01:23 2007 +0000
@@ -44,13 +44,13 @@
 }
 
 
-static inline bool IsRoadVehInDepot(const Vehicle* v)
+static inline bool IsRoadVehInDepot(const Vehicle *v)
 {
 	assert(v->type == VEH_ROAD);
 	return v->u.road.state == 254;
 }
 
-static inline bool IsRoadVehInDepotStopped(const Vehicle* v)
+static inline bool IsRoadVehInDepotStopped(const Vehicle *v)
 {
 	return IsRoadVehInDepot(v) && v->vehstatus & VS_STOPPED;
 }
--- a/src/ship.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/ship.h	Tue Jul 24 17:01:23 2007 +0000
@@ -12,13 +12,13 @@
 void RecalcShipStuff(Vehicle *v);
 void GetShipSpriteSize(EngineID engine, uint &width, uint &height);
 
-static inline bool IsShipInDepot(const Vehicle* v)
+static inline bool IsShipInDepot(const Vehicle *v)
 {
 	assert(v->type == VEH_SHIP);
 	return v->u.ship.state == 0x80;
 }
 
-static inline bool IsShipInDepotStopped(const Vehicle* v)
+static inline bool IsShipInDepotStopped(const Vehicle *v)
 {
 	return IsShipInDepot(v) && v->vehstatus & VS_STOPPED;
 }
--- a/src/sprite.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/sprite.h	Tue Jul 24 17:01:23 2007 +0000
@@ -24,7 +24,7 @@
 struct DrawTileSprites {
 	SpriteID ground_sprite;
 	SpriteID ground_pal;
-	const DrawTileSeqStruct* seq;
+	const DrawTileSeqStruct *seq;
 };
 
 /**
--- a/src/station_map.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/station_map.h	Tue Jul 24 17:01:23 2007 +0000
@@ -17,7 +17,7 @@
 	return (StationID)_m[t].m2;
 }
 
-static inline Station* GetStationByTile(TileIndex t)
+static inline Station *GetStationByTile(TileIndex t)
 {
 	return GetStation(GetStationIndex(t));
 }
--- a/src/string.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/string.h	Tue Jul 24 17:01:23 2007 +0000
@@ -24,10 +24,10 @@
  *             if NULL no boundary check is performed
  * @return a pointer to the terminating \0 in the destination buffer
  */
-char* strecat(char* dst, const char* src, const char* last);
-char* strecpy(char* dst, const char* src, const char* last);
+char *strecat(char *dst, const char *src, const char *last);
+char *strecpy(char *dst, const char *src, const char *last);
 
-char* CDECL str_fmt(const char* str, ...);
+char *CDECL str_fmt(const char *str, ...);
 
 /** Scans the string for valid characters and if it finds invalid ones,
  * replaces them with a question mark '?' */
@@ -49,7 +49,7 @@
 void strtolower(char *str);
 
 
-static inline bool StrEmpty(const char* s) { return s[0] == '\0'; }
+static inline bool StrEmpty(const char *s) { return s[0] == '\0'; }
 
 
 /** Get the length of a string, within a limited buffer */
--- a/src/strings.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/strings.h	Tue Jul 24 17:01:23 2007 +0000
@@ -6,7 +6,7 @@
 #define STRINGS_H
 
 char *InlineString(char *buf, StringID string);
-char *GetString(char *buffr, StringID string, const char* last);
+char *GetString(char *buffr, StringID string, const char *last);
 
 extern char _userstring[128];
 
--- a/src/thread.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/thread.h	Tue Jul 24 17:01:23 2007 +0000
@@ -7,10 +7,10 @@
 
 struct OTTDThread;
 
-typedef void* (*OTTDThreadFunc)(void*);
+typedef void * (*OTTDThreadFunc)(void*);
 
-OTTDThread* OTTDCreateThread(OTTDThreadFunc, void*);
-void*       OTTDJoinThread(OTTDThread*);
+OTTDThread *OTTDCreateThread(OTTDThreadFunc, void*);
+void       *OTTDJoinThread(OTTDThread*);
 void        OTTDExitThread();
 
 #endif /* THREAD_H */
--- a/src/town_map.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/town_map.h	Tue Jul 24 17:01:23 2007 +0000
@@ -38,7 +38,7 @@
  * @param t the tile to get the town of
  * @return the town
  */
-static inline Town* GetTownByTile(TileIndex t)
+static inline Town *GetTownByTile(TileIndex t)
 {
 	return GetTown(GetTownIndex(t));
 }
--- a/src/vehicle.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/vehicle.h	Tue Jul 24 17:01:23 2007 +0000
@@ -352,7 +352,7 @@
 	 * @param v    the vehicle to use as 'storage' backend
 	 * @return the memory that is 'allocated'
 	 */
-	void* operator new(size_t size, Vehicle *v) { return v; }
+	void *operator new(size_t size, Vehicle *v) { return v; }
 
 	/**
 	 * 'Free' the memory allocated by the overriden new.
@@ -516,7 +516,7 @@
 Vehicle *GetLastVehicleInChain(Vehicle *v);
 Vehicle *GetPrevVehicleInChain(const Vehicle *v);
 Vehicle *GetFirstVehicleInChain(const Vehicle *v);
-uint CountVehiclesInChain(const Vehicle* v);
+uint CountVehiclesInChain(const Vehicle *v);
 bool IsEngineCountable(const Vehicle *v);
 void DeleteVehicleChain(Vehicle *v);
 void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc);
@@ -592,7 +592,7 @@
 };
 
 struct GetNewVehiclePosResult {
-	int x,y;
+	int x, y;
 	TileIndex old_tile;
 	TileIndex new_tile;
 };
@@ -612,10 +612,10 @@
 
 /* returns true if staying in the same tile */
 GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v);
-Direction GetDirectionTowards(const Vehicle* v, int x, int y);
+Direction GetDirectionTowards(const Vehicle *v, int x, int y);
 
 #define BEGIN_ENUM_WAGONS(v) do {
-#define END_ENUM_WAGONS(v) } while ( (v=v->next) != NULL);
+#define END_ENUM_WAGONS(v) } while ((v = v->next) != NULL);
 
 DECLARE_OLD_POOL(Vehicle, Vehicle, 9, 125)
 
--- a/src/viewport.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/viewport.h	Tue Jul 24 17:01:23 2007 +0000
@@ -41,7 +41,7 @@
 
 static inline void MaxZoomInOut(int how, Window *w)
 {
-	while (DoZoomInOutWindow(how, w) ) {};
+	while (DoZoomInOutWindow(how, w)) {};
 }
 
 void OffsetGroundSprite(int x, int y);
--- a/src/waypoint.h	Tue Jul 24 13:03:24 2007 +0000
+++ b/src/waypoint.h	Tue Jul 24 17:01:23 2007 +0000
@@ -69,7 +69,7 @@
 CommandCost RemoveTrainWaypoint(TileIndex tile, uint32 flags, bool justremove);
 Station *ComposeWaypointStation(TileIndex tile);
 void ShowRenameWaypointWindow(const Waypoint *cp);
-void DrawWaypointSprite(int x, int y, int image, RailType railtype);
+void DrawWaypointSprite(int x, int y, int stat_id, RailType railtype);
 void FixOldWaypoints();
 void UpdateAllWaypointSigns();
 void AfterLoadWaypoints();