summaryrefslogtreecommitdiff
path: root/src/common/mapindex.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-06-24 00:13:59 +0200
committerHaru <haru@dotalux.com>2018-07-01 21:09:24 +0200
commit8dd7aec896efc0220d6234bcfb190767c30dbb29 (patch)
tree0fd1b8d2b795c01b4a6fddc3827784d26d09cc61 /src/common/mapindex.c
parentec1bc50b01aa4f34f151b3b3800011abdce31919 (diff)
downloadhercules-8dd7aec896efc0220d6234bcfb190767c30dbb29.tar.gz
hercules-8dd7aec896efc0220d6234bcfb190767c30dbb29.tar.bz2
hercules-8dd7aec896efc0220d6234bcfb190767c30dbb29.tar.xz
hercules-8dd7aec896efc0220d6234bcfb190767c30dbb29.zip
Change functions to static where possible (Part 1 - common)
This fixes issues with plugins defining symbols with the same names Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/mapindex.c')
-rw-r--r--src/common/mapindex.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index e79054f72..d5cda5c22 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -33,12 +33,12 @@
#include <stdlib.h>
/* mapindex.c interface source */
-struct mapindex_interface mapindex_s;
+static struct mapindex_interface mapindex_s;
struct mapindex_interface *mapindex;
/// Retrieves the map name from 'string' (removing .gat extension if present).
/// Result gets placed either into 'buf' or in a static local buffer.
-const char* mapindex_getmapname(const char* string, char* output)
+static const char *mapindex_getmapname(const char *string, char *output)
{
static char buf[MAP_NAME_LENGTH];
char* dest = (output != NULL) ? output : buf;
@@ -62,7 +62,7 @@ const char* mapindex_getmapname(const char* string, char* output)
/// Retrieves the map name from 'string' (adding .gat extension if not already present).
/// Result gets placed either into 'buf' or in a static local buffer.
-const char* mapindex_getmapname_ext(const char* string, char* output)
+static const char *mapindex_getmapname_ext(const char *string, char *output)
{
static char buf[MAP_NAME_LENGTH_EXT];
char* dest = (output != NULL) ? output : buf;
@@ -94,7 +94,7 @@ const char* mapindex_getmapname_ext(const char* string, char* output)
/// Adds a map to the specified index
/// Returns 1 if successful, 0 otherwise
-int mapindex_addmap(int index, const char* name)
+static int mapindex_addmap(int index, const char *name)
{
char map_name[MAP_NAME_LENGTH];
@@ -136,7 +136,7 @@ int mapindex_addmap(int index, const char* name)
return index;
}
-unsigned short mapindex_name2id(const char* name)
+static unsigned short mapindex_name2id(const char *name)
{
int i;
char map_name[MAP_NAME_LENGTH];
@@ -150,7 +150,7 @@ unsigned short mapindex_name2id(const char* name)
return 0;
}
-const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const char *func)
+static const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const char *func)
{
if (id >= MAX_MAPINDEX || !mapindex_exists(id)) {
ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache. %s:%s:%d\n", id,file,func,line);
@@ -159,7 +159,7 @@ const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const ch
return mapindex->list[id].name;
}
-int mapindex_init(void)
+static int mapindex_init(void)
{
FILE *fp;
char line[1024];
@@ -198,7 +198,7 @@ int mapindex_init(void)
return total;
}
-bool mapindex_check_default(void)
+static bool mapindex_check_default(void)
{
if (!strdb_iget(mapindex->db, mapindex->default_map)) {
ShowError("mapindex_init: MAP_DEFAULT '%s' not found in cache! update mapindex.h MAP_DEFAULT var!!!\n", mapindex->default_map);
@@ -207,14 +207,14 @@ bool mapindex_check_default(void)
return true;
}
-void mapindex_removemap(int index)
+static void mapindex_removemap(int index)
{
Assert_retv(index < MAX_MAPINDEX);
strdb_remove(mapindex->db, mapindex->list[index].name);
mapindex->list[index].name[0] = '\0';
}
-void mapindex_final(void)
+static void mapindex_final(void)
{
db_destroy(mapindex->db);
}