Changeset - r15991:9b390068ea00
[Not reviewed]
master
0 12 0
alberth - 14 years ago 2010-08-29 15:58:43
alberth@openttd.org
(svn r20689) -Codechange: Make some global functions used in 1 .cpp file static in that file.
12 files changed with 6 insertions and 13 deletions:
0 comments (0 inline, 0 general)
src/company_cmd.cpp
Show inline comments
 
@@ -135,13 +135,13 @@ void DrawCompanyIcon(CompanyID c, int x,
 
/**
 
 * Checks whether a company manager's face is a valid encoding.
 
 * Unused bits are not enforced to be 0.
 
 * @param cmf the fact to check
 
 * @return true if and only if the face is valid
 
 */
 
bool IsValidCompanyManagerFace(CompanyManagerFace cmf)
 
static bool IsValidCompanyManagerFace(CompanyManagerFace cmf)
 
{
 
	if (!AreCompanyManagerFaceBitsValid(cmf, CMFV_GEN_ETHN, GE_WM)) return false;
 

	
 
	GenderEthnicity ge   = (GenderEthnicity)GetCompanyManagerFaceBits(cmf, CMFV_GEN_ETHN, GE_WM);
 
	bool has_moustache   = !HasBit(ge, GENDER_FEMALE) && GetCompanyManagerFaceBits(cmf, CMFV_HAS_MOUSTACHE,   ge) != 0;
 
	bool has_tie_earring = !HasBit(ge, GENDER_FEMALE) || GetCompanyManagerFaceBits(cmf, CMFV_HAS_TIE_EARRING, ge) != 0;
src/company_manager_face.h
Show inline comments
 
@@ -234,9 +234,8 @@ static inline SpriteID GetCompanyManager
 
	assert(_cmf_info[cmfv].valid_values[ge] != 0);
 

	
 
	return _cmf_info[cmfv].first_sprite[ge] + GB(cmf, _cmf_info[cmfv].offset, _cmf_info[cmfv].length);
 
}
 

	
 
void DrawCompanyManagerFace(CompanyManagerFace face, int colour, int x, int y);
 
bool IsValidCompanyManagerFace(CompanyManagerFace cmf);
 

	
 
#endif /* COMPANY_MANAGER_FACE_H */
src/fileio.cpp
Show inline comments
 
@@ -423,13 +423,13 @@ FILE *FioFOpenFile(const char *filename,
 
}
 

	
 
/**
 
 * Create a directory with the given name
 
 * @param name the new name of the directory
 
 */
 
void FioCreateDirectory(const char *name)
 
static void FioCreateDirectory(const char *name)
 
{
 
#if defined(WIN32) || defined(WINCE)
 
	CreateDirectory(OTTD2FS(name), NULL);
 
#elif defined(OS2) && !defined(__INNOTEK_LIBC__)
 
	mkdir(OTTD2FS(name));
 
#elif defined(__MORPHOS__) || defined(__AMIGAOS__)
src/fileio_func.h
Show inline comments
 
@@ -22,13 +22,12 @@ byte FioReadByte();
 
uint16 FioReadWord();
 
uint32 FioReadDword();
 
void FioCloseAll();
 
void FioOpenFile(int slot, const char *filename);
 
void FioReadBlock(void *ptr, size_t size);
 
void FioSkipBytes(int n);
 
void FioCreateDirectory(const char *filename);
 

	
 
/**
 
 * The searchpaths OpenTTD could search through.
 
 * At least one of the slots has to be filled with a path.
 
 * NULL paths tell that there is no such path for the
 
 * current operating system.
src/network/network_func.h
Show inline comments
 
@@ -69,13 +69,12 @@ bool NetworkServerChangeClientName(Clien
 

	
 
NetworkClientInfo *NetworkFindClientInfoFromClientID(ClientID client_id);
 
const char *GetClientIP(NetworkClientInfo *ci);
 

	
 
void NetworkServerDoMove(ClientID client_id, CompanyID company_id);
 
void NetworkServerSendRcon(ClientID client_id, ConsoleColour colour_code, const char *string);
 
void NetworkServerSendError(ClientID client_id, NetworkErrorCode error);
 
void NetworkServerSendChat(NetworkAction action, DestType type, int dest, const char *msg, ClientID from_id, int64 data = 0);
 

	
 
void NetworkServerKickClient(ClientID client_id);
 
uint NetworkServerKickOrBanIP(const char *ip, bool ban);
 

	
 
void NetworkInitChatMessage();
src/network/network_server.cpp
Show inline comments
 
@@ -1773,13 +1773,13 @@ void NetworkServerDoMove(ClientID client
 

	
 
void NetworkServerSendRcon(ClientID client_id, ConsoleColour colour_code, const char *string)
 
{
 
	SEND_COMMAND(PACKET_SERVER_RCON)(NetworkFindClientStateFromClientID(client_id), colour_code, string);
 
}
 

	
 
void NetworkServerSendError(ClientID client_id, NetworkErrorCode error)
 
static void NetworkServerSendError(ClientID client_id, NetworkErrorCode error)
 
{
 
	SEND_COMMAND(PACKET_SERVER_ERROR)(NetworkFindClientStateFromClientID(client_id), error);
 
}
 

	
 
void NetworkServerKickClient(ClientID client_id)
 
{
src/newgrf_canal.cpp
Show inline comments
 
@@ -111,13 +111,13 @@ SpriteID GetCanalSprite(CanalFeature fea
 
 * @param param1   Callback parameter 1.
 
 * @param param2   Callback parameter 2.
 
 * @param feature  For which feature to run the callback.
 
 * @param tile     Tile index of canal.
 
 * @return Callback result or CALLBACK_FAILED if the callback failed.
 
 */
 
uint16 GetCanalCallback(CallbackID callback, uint32 param1, uint32 param2, CanalFeature feature, TileIndex tile)
 
static uint16 GetCanalCallback(CallbackID callback, uint32 param1, uint32 param2, CanalFeature feature, TileIndex tile)
 
{
 
	ResolverObject object;
 
	const SpriteGroup *group;
 

	
 
	NewCanalResolver(&object, tile, _water_feature[feature].grffile);
 

	
src/newgrf_canal.h
Show inline comments
 
@@ -55,10 +55,9 @@ extern WaterFeature _water_feature[CF_EN
 
 * @param feature Which canal feature we want.
 
 * @param tile Tile index of canal, if appropriate.
 
 * @return Base sprite returned by GRF, or 0 if none.
 
 */
 
SpriteID GetCanalSprite(CanalFeature feature, TileIndex tile);
 

	
 
uint16 GetCanalCallback(CallbackID callback, uint32 param1, uint32 param2, CanalFeature feature, TileIndex tile);
 
uint GetCanalSpriteOffset(CanalFeature feature, TileIndex tile, uint cur_offset);
 

	
 
#endif /* NEWGRF_CANAL_H */
src/settings.cpp
Show inline comments
 
@@ -158,13 +158,13 @@ static uint32 LookupManyOfMany(const cha
 
 * @param p the string to be parsed. Each element in the list is seperated by a
 
 * comma or a space character
 
 * @param items pointer to the integerlist-array that will be filled with values
 
 * @param maxitems the maximum number of elements the integerlist-array has
 
 * @return returns the number of items found, or -1 on an error
 
 */
 
int ParseIntList(const char *p, int *items, int maxitems)
 
static int ParseIntList(const char *p, int *items, int maxitems)
 
{
 
	int n = 0; // number of items read so far
 
	bool comma = false; // do we accept comma?
 

	
 
	while (*p != '\0') {
 
		switch (*p) {
src/settings_func.h
Show inline comments
 
@@ -17,14 +17,12 @@
 

	
 
void IConsoleSetSetting(const char *name, const char *value, bool force_newgame = false);
 
void IConsoleSetSetting(const char *name, int32 value);
 
void IConsoleGetSetting(const char *name, bool force_newgame = false);
 
void IConsoleListSettings(const char *prefilter);
 

	
 
int ParseIntList(const char *p, int *items, int maxitems);
 

	
 
void LoadFromConfig();
 
void SaveToConfig();
 
void CheckConfig();
 

	
 
/* Functions to load and save NewGRF settings to a separate
 
 * configuration file, used for presets. */
src/window.cpp
Show inline comments
 
@@ -142,13 +142,13 @@ void SetFocusedWindow(Window *w)
 

	
 
/**
 
 * Check if an edit box is in global focus. That is if focused window
 
 * has a edit box as focused widget, or if a console is focused.
 
 * @return returns true if an edit box is in global focus or if the focused window is a console, else false
 
 */
 
bool EditBoxInGlobalFocus()
 
static bool EditBoxInGlobalFocus()
 
{
 
	if (_focused_window == NULL) return false;
 

	
 
	/* The console does not have an edit box so a special case is needed. */
 
	if (_focused_window->window_class == WC_CONSOLE) return true;
 

	
src/window_gui.h
Show inline comments
 
@@ -812,11 +812,10 @@ enum SpecialMouseMode {
 
};
 
extern SpecialMouseMode _special_mouse_mode;
 

	
 
Window *GetCallbackWnd();
 

	
 
void SetFocusedWindow(Window *w);
 
bool EditBoxInGlobalFocus();
 

	
 
void ScrollbarClickHandler(Window *w, NWidgetCore *nw, int x, int y);
 

	
 
#endif /* WINDOW_GUI_H */
0 comments (0 inline, 0 general)