summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-09 14:31:15 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-09 14:31:15 +0000
commit33369a948f2d6ba2059f81816ea7b16e486090ba (patch)
treeb08a112ecbacf193f3a98c2bcc05a01fddef5feb /src/map/atcommand.c
parent440542802577e5f3f67081803873bc87642a3f48 (diff)
downloadhercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.gz
hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.bz2
hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.tar.xz
hercules-33369a948f2d6ba2059f81816ea7b16e486090ba.zip
Code cleanup: replaced `DBIterator` function calls with macros where possible.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15668 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index bf7e7d66e..7bab524e7 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1608,13 +1608,13 @@ ACMD_FUNC(help)
StringBuf_AppendStr(&buf, "Available aliases:");
command_info = get_atcommandinfo_byname(command_name);
iter = db_iterator(atcommand_alias_db);
- for (alias_info = (AliasInfo*)dbi_first(iter); dbi_exists(iter); alias_info = (AliasInfo*)dbi_next(iter)) {
+ for (alias_info = dbi_first(iter); dbi_exists(iter); alias_info = dbi_next(iter)) {
if (alias_info->command == command_info) {
StringBuf_Printf(&buf, " %s", alias_info->alias);
has_aliases = true;
}
}
- iter->destroy(iter);
+ dbi_destroy(iter);
if (has_aliases)
clif_displaymessage(fd, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
@@ -8268,7 +8268,7 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
char line_buff[CHATBOX_SIZE];
char* cur = line_buff;
AtCommandInfo* cmd;
- DBIterator* iter = atcommand_db->iterator(atcommand_db);
+ DBIterator *iter = db_iterator(atcommand_db);
int count = 0;
memset(line_buff,' ',CHATBOX_SIZE);
@@ -8276,7 +8276,7 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
clif_displaymessage(fd, msg_txt(273)); // "Commands available:"
- for (cmd = (AtCommandInfo*)iter->first(iter, NULL); iter->exists(iter); cmd = (AtCommandInfo*)iter->next(iter, NULL)) {
+ for (cmd = dbi_first(iter); dbi_exists(iter); cmd = dbi_next(iter)) {
unsigned int slen = 0;
if (!pc_can_use_command(sd, cmd->command, type))
@@ -8298,7 +8298,7 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
count++;
}
- iter->destroy(iter);
+ dbi_destroy(iter);
clif_displaymessage(fd,line_buff);
sprintf(atcmd_output, msg_txt(274), count); // "%d commands found."