summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-04-02 22:36:10 +0200
committerHaru <haru@dotalux.com>2018-04-02 22:36:15 +0200
commit5d97abba7ee7c076eb18780e6779a45b8d006412 (patch)
treedd3b3bd080fce068070547810665bbd81c770705
parentd89690fbdbaa5dc78f98d96ee91403e329c12af1 (diff)
downloadhercules-5d97abba7ee7c076eb18780e6779a45b8d006412.tar.gz
hercules-5d97abba7ee7c076eb18780e6779a45b8d006412.tar.bz2
hercules-5d97abba7ee7c076eb18780e6779a45b8d006412.tar.xz
hercules-5d97abba7ee7c076eb18780e6779a45b8d006412.zip
Rename script->sprintf() to script->sprintf_helper()
This prevents compile errors in HPMHooking in case sprintf is defined as a macro by the C library Fixes #2003 Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/script.c10
-rw-r--r--src/map/script.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c
index d653800cc..30f5f26e7 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5625,7 +5625,7 @@ const char *script_getfuncname(struct script_state *st) {
* already initialized)
* @retval false if an error occurs.
*/
-bool script_sprintf(struct script_state *st, int start, struct StringBuf *out)
+bool script_sprintf_helper(struct script_state *st, int start, struct StringBuf *out)
{
const char *format = NULL;
const char *p = NULL, *np = NULL;
@@ -5678,7 +5678,7 @@ bool script_sprintf(struct script_state *st, int start, struct StringBuf *out)
}
// placeholder = "%n" ; (ignored)
if (*np == 'n') {
- ShowWarning("script_sprintf: Format %%n not supported! Skipping...\n");
+ ShowWarning("script_sprintf_helper: Format %%n not supported! Skipping...\n");
script->reportsrc(st);
lastarg = nextarg;
p = np + 1;
@@ -5881,7 +5881,7 @@ BUILDIN(mesf)
StrBuf->Init(&buf);
- if (!script_sprintf(st, 2, &buf)) {
+ if (!script->sprintf_helper(st, 2, &buf)) {
StrBuf->Destroy(&buf);
return false;
}
@@ -16793,7 +16793,7 @@ BUILDIN(sprintf)
struct StringBuf buf;
StrBuf->Init(&buf);
- if (!script_sprintf(st, 2, &buf)) {
+ if (!script->sprintf_helper(st, 2, &buf)) {
StrBuf->Destroy(&buf);
script_pushconststr(st, "");
return false;
@@ -25180,7 +25180,7 @@ void script_defaults(void)
script->search_str = script_search_str;
script->setd_sub = setd_sub;
script->attach_state = script_attach_state;
- script->sprintf = script_sprintf;
+ script->sprintf_helper = script_sprintf_helper;
script->queue = script_hqueue_get;
script->queue_add = script_hqueue_add;
diff --git a/src/map/script.h b/src/map/script.h
index 2dc3b2327..ede786481 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -909,7 +909,7 @@ struct script_interface {
int (*buildin_mobuseskill_sub) (struct block_list *bl, va_list ap);
int (*cleanfloor_sub) (struct block_list *bl, va_list ap);
int (*run_func) (struct script_state *st);
- bool (*sprintf) (struct script_state *st, int start, struct StringBuf *out);
+ bool (*sprintf_helper) (struct script_state *st, int start, struct StringBuf *out);
const char *(*getfuncname) (struct script_state *st);
// for ENABLE_CASE_CHECK
unsigned int (*calc_hash_ci) (const char *p);