summaryrefslogtreecommitdiff
path: root/src/map/searchstore.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-06-28 03:17:32 +0200
committerHaru <haru@dotalux.com>2018-07-01 21:09:26 +0200
commita675e06c38ec4e31a2758435a582b58a2199cfc4 (patch)
treea4bf91c20da434eef97f55f7427ccbf034c5e285 /src/map/searchstore.c
parentb7e6439f0c788ceacc567fbb017d3c7f09913f78 (diff)
downloadhercules-a675e06c38ec4e31a2758435a582b58a2199cfc4.tar.gz
hercules-a675e06c38ec4e31a2758435a582b58a2199cfc4.tar.bz2
hercules-a675e06c38ec4e31a2758435a582b58a2199cfc4.tar.xz
hercules-a675e06c38ec4e31a2758435a582b58a2199cfc4.zip
Change functions to static where possible (Part 4 - map)
This fixes issues with plugins defining symbols with the same names Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/searchstore.c')
-rw-r--r--src/map/searchstore.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/map/searchstore.c b/src/map/searchstore.c
index c80f2f575..2243ffe04 100644
--- a/src/map/searchstore.c
+++ b/src/map/searchstore.c
@@ -31,7 +31,7 @@
#include "common/showmsg.h" // ShowError, ShowWarning
#include "common/strlib.h" // safestrncpy
-struct searchstore_interface searchstore_s;
+static struct searchstore_interface searchstore_s;
struct searchstore_interface *searchstore;
/// retrieves search function by type
@@ -55,7 +55,7 @@ static inline searchstore_searchall_t searchstore_getsearchallfunc(unsigned char
}
/// checks if the player has a store by type
-static inline bool searchstore_hasstore(struct map_session_data* sd, unsigned char type)
+static inline bool searchstore_hasstore(struct map_session_data *sd, unsigned char type)
{
nullpo_retr(false, sd);
switch( type ) {
@@ -66,7 +66,7 @@ static inline bool searchstore_hasstore(struct map_session_data* sd, unsigned ch
}
/// returns player's store id by type
-static inline unsigned int searchstore_getstoreid(struct map_session_data* sd, unsigned char type)
+static inline unsigned int searchstore_getstoreid(struct map_session_data *sd, unsigned char type)
{
nullpo_retr(false, sd);
switch( type ) {
@@ -76,7 +76,7 @@ static inline unsigned int searchstore_getstoreid(struct map_session_data* sd, u
return 0;
}
-bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect)
+static bool searchstore_open(struct map_session_data *sd, unsigned int uses, unsigned short effect)
{
nullpo_retr(false, sd);
if( !battle_config.feature_search_stores || sd->searchstore.open ) {
@@ -96,7 +96,7 @@ bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned s
return true;
}
-void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short* itemlist, unsigned int item_count, const unsigned short* cardlist, unsigned int card_count)
+static void searchstore_query(struct map_session_data *sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short *itemlist, unsigned int item_count, const unsigned short *cardlist, unsigned int card_count)
{
unsigned int i;
struct map_session_data* pl_sd;
@@ -209,7 +209,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
}
/// checks whether or not more results are available for the client
-bool searchstore_querynext(struct map_session_data* sd)
+static bool searchstore_querynext(struct map_session_data *sd)
{
nullpo_retr(false, sd);
if( sd->searchstore.count && ( sd->searchstore.count-1 )/SEARCHSTORE_RESULTS_PER_PAGE < sd->searchstore.pages ) {
@@ -219,7 +219,7 @@ bool searchstore_querynext(struct map_session_data* sd)
return false;
}
-void searchstore_next(struct map_session_data* sd)
+static void searchstore_next(struct map_session_data *sd)
{
nullpo_retv(sd);
if( !battle_config.feature_search_stores || !sd->searchstore.open || sd->searchstore.count <= sd->searchstore.pages*SEARCHSTORE_RESULTS_PER_PAGE )
@@ -234,7 +234,7 @@ void searchstore_next(struct map_session_data* sd)
sd->searchstore.pages++;
}
-void searchstore_clear(struct map_session_data* sd)
+static void searchstore_clear(struct map_session_data *sd)
{
nullpo_retv(sd);
searchstore->clearremote(sd);
@@ -248,7 +248,7 @@ void searchstore_clear(struct map_session_data* sd)
sd->searchstore.pages = 0;
}
-void searchstore_close(struct map_session_data* sd)
+static void searchstore_close(struct map_session_data *sd)
{
nullpo_retv(sd);
if( sd->searchstore.open ) {
@@ -259,7 +259,7 @@ void searchstore_close(struct map_session_data* sd)
}
}
-void searchstore_click(struct map_session_data* sd, int account_id, int store_id, unsigned short nameid)
+static void searchstore_click(struct map_session_data *sd, int account_id, int store_id, unsigned short nameid)
{
unsigned int i;
struct map_session_data* pl_sd;
@@ -327,20 +327,21 @@ void searchstore_click(struct map_session_data* sd, int account_id, int store_id
}
/// checks whether or not sd has opened account_id's shop remotely
-bool searchstore_queryremote(struct map_session_data* sd, int account_id)
+static bool searchstore_queryremote(struct map_session_data *sd, int account_id)
{
nullpo_retr(false, sd);
return (bool)( sd->searchstore.open && sd->searchstore.count && sd->searchstore.remote_id == account_id );
}
/// removes range-check bypassing for remotely opened stores
-void searchstore_clearremote(struct map_session_data* sd) {
+static void searchstore_clearremote(struct map_session_data *sd)
+{
nullpo_retv(sd);
sd->searchstore.remote_id = 0;
}
/// receives results from a store-specific callback
-bool searchstore_result(struct map_session_data* sd, unsigned int store_id, int account_id, const char* store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short* card, unsigned char refine, const struct item_option *option)
+static bool searchstore_result(struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short *card, unsigned char refine, const struct item_option *option)
{
struct s_search_store_info_item* ssitem;
@@ -365,7 +366,7 @@ bool searchstore_result(struct map_session_data* sd, unsigned int store_id, int
return true;
}
-void searchstore_defaults (void)
+void searchstore_defaults(void)
{
searchstore = &searchstore_s;