summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-12 15:24:20 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-12 15:24:20 +0000
commit1427a87a2ad9a4fc947996fff2c7d85d265b67d3 (patch)
tree1934d74b7c394395db385425ca0391562361812d
parent00f7f9b9e2f72595e56af9c40d97fbd73408df54 (diff)
downloadhercules-1427a87a2ad9a4fc947996fff2c7d85d265b67d3.tar.gz
hercules-1427a87a2ad9a4fc947996fff2c7d85d265b67d3.tar.bz2
hercules-1427a87a2ad9a4fc947996fff2c7d85d265b67d3.tar.xz
hercules-1427a87a2ad9a4fc947996fff2c7d85d265b67d3.zip
- Minor changes to ers.
- Removed unused/hardly used cbasetypes typedefs. - Updated txt-converter's makefile to include utils.o git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9473 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/common/cbasetypes.h31
-rw-r--r--src/common/db.c4
-rw-r--r--src/common/db.h2
-rw-r--r--src/common/ers.c137
-rw-r--r--src/common/ers.h32
-rw-r--r--src/common/showmsg.c12
-rw-r--r--src/map/atcommand.c3
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/guild.c2
-rw-r--r--src/map/mob.c4
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/pet.c4
-rw-r--r--src/map/skill.c4
-rw-r--r--src/txt-converter/Makefile4
-rw-r--r--src/txt-converter/char-converter.c2
-rw-r--r--src/txt-converter/login-converter.c6
18 files changed, 90 insertions, 166 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 35b0c92cc..606a3d8eb 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/12/12
+ * Minor changes to ers.
+ * Removed unused/hardly used cbasetypes typedefs.
+ * Updated txt-converter's makefile to include utils.o [FlavioJS]
* Updated npc_event_dequeue to free up your current npc information, and
not just the npc_id.
* Modified the skill damage packet and the knockback packets to mimic aegis
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index ff00aaa49..f02b8734c 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -54,35 +54,6 @@
//////////////////////////////////////////////////////////////////////////
-// useful typedefs
-//////////////////////////////////////////////////////////////////////////
-#define HAVE_UCHAR
-typedef unsigned char uchar;
-typedef signed char schar;
-typedef signed short sshort;
-
-#if !defined(__FREEBSD__) && !defined(_SYS_TYPES_H)
- typedef unsigned short ushort;
-#endif
-typedef signed int sint; // don't use (only for ie. scanf)
-#if !defined(__FREEBSD__) && !defined(_SYS_TYPES_H)
- typedef unsigned int uint; // don't use
-#endif
-typedef signed long slong; // don't use (only for ie. file-io)
-#ifndef _SYS_TYPES_H
- typedef unsigned long ulong; // don't use
-#endif
-
-#ifndef WIN32
-typedef char* pchar;
-typedef unsigned char* puchar;
-#endif
-typedef const char* cchar;
-typedef void* ptr;
-typedef int* pint;
-
-
-//////////////////////////////////////////////////////////////////////////
// typedefs to compensate type size change from 32bit to 64bit
// MS implements LLP64 model, normal unix does LP64,
// only Silicon Graphics/Cray goes ILP64 so don't care (and don't support)
@@ -235,7 +206,7 @@ typedef unsigned long long uint64;
//////////////////////////////
// boolean types for C
-typedef int bool;
+typedef char bool;
#define false (1==0)
#define true (1==1)
diff --git a/src/common/db.c b/src/common/db.c
index 28b5721e9..a65e87918 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -186,7 +186,7 @@ typedef struct db {
unsigned int free_max;
unsigned int free_lock;
// Other
- ERInterface nodes;
+ ERS nodes;
DBComparator cmp;
DBHasher hash;
DBReleaser release;
@@ -2165,7 +2165,7 @@ DBInterface db_alloc(const char *file, int line, DBType type, DBOptions options,
db->free_max = 0;
db->free_lock = 0;
/* Other */
- db->nodes = ers_new((uint32)sizeof(struct dbn));
+ db->nodes = ers_new(sizeof(struct dbn));
db->cmp = db_default_cmp(type);
db->hash = db_default_hash(type);
db->release = db_default_release(type, options);
diff --git a/src/common/db.h b/src/common/db.h
index b17ae27f9..2f02c1bfa 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -159,7 +159,7 @@ typedef enum {
typedef union {
int i;
unsigned int ui;
- unsigned char *str;
+ unsigned char *str;//## TODO change to 'const char *'
} DBKey;
/**
diff --git a/src/common/ers.c b/src/common/ers.c
index 22dd8d87e..485bab7d9 100644
--- a/src/common/ers.c
+++ b/src/common/ers.c
@@ -50,15 +50,14 @@
* ERS_BLOCK_ENTRIES - Number of entries in each block. *
* ERS_ROOT_SIZE - Maximum number of root entry managers. *
* ERLinkedList - Structure of a linked list of reusable entries. *
- * ERSystem - Class of an entry manager. *
+ * ERS_impl - Class of an entry manager. *
* ers_root - Array of root entry managers. *
* ers_num - Number of root entry managers in the array. *
\*****************************************************************************/
/**
* Number of entries in each block.
- * @private
- * @see #ers_obj_alloc_entry(ERInterface eri)
+ * @see #ers_obj_alloc_entry(ERS eri)
*/
#define ERS_BLOCK_ENTRIES 4096
@@ -74,7 +73,7 @@
* Linked list of reusable entries.
* The minimum size of the entries is the size of this structure.
* @private
- * @see ERSystem#reuse
+ * @see ERS_impl#reuse
*/
typedef struct ers_ll {
struct ers_ll *next;
@@ -92,7 +91,7 @@ typedef struct ers_ll {
* @param size Size of the entries of the manager
* @private
*/
-typedef struct ers {
+typedef struct ers_impl {
/**
* Public interface of the entry manager.
@@ -101,61 +100,45 @@ typedef struct ers {
* @param entry_size Return the size of the entries of this manager
* @param destroy Destroy this instance of the manager
* @public
- * @see #ERSystem
- * @see common\ers.h#ERInterface
*/
- struct eri eri;
+ struct eri vtable;
/**
* Linked list of reusable entries.
- * @private
- * @see #ERSystem
*/
ERLinkedList reuse;
/**
* Array with blocks of entries.
- * @private
- * @see #ERSystem
*/
uint8 **blocks;
/**
* Number of unused entries in the last block.
- * @private
- * @see #ERSystem
*/
uint32 free;
/**
* Number of blocks in the array.
- * @private
- * @see #ERSystem
*/
uint32 num;
/**
* Current maximum capacity of the array.
- * @private
- * @see #ERSystem
*/
uint32 max;
/**
* Destroy lock.
- * @private
- * @see #ERSystem
*/
uint32 destroy;
/**
* Size of the entries of the manager.
- * @private
- * @see #ERSystem
*/
- uint32 size;
+ size_t size;
-} *ERSystem;
+} *ERS_impl;
/**
* Root array with entry managers.
@@ -164,7 +147,7 @@ typedef struct ers {
* @see #ERS_ROOT_SIZE
* @see #ers_num
*/
-static ERSystem ers_root[ERS_ROOT_SIZE];
+static ERS_impl ers_root[ERS_ROOT_SIZE];
/**
* Number of entry managers in the root array.
@@ -176,7 +159,7 @@ static ERSystem ers_root[ERS_ROOT_SIZE];
static uint32 ers_num = 0;
/*****************************************************************************\
- * (2) Protected functions. *
+ * (2) Object functions. *
* ers_obj_alloc_entry - Allocate an entry from the manager. *
* ers_obj_free_entry - Free an entry allocated from the manager. *
* ers_obj_entry_size - Return the size of the entries of the manager. *
@@ -188,19 +171,17 @@ static uint32 ers_num = 0;
* If there are reusable entries available, it reuses one instead.
* @param self Interface of the entry manager
* @return An entry
- * @protected
* @see #ERS_BLOCK_ENTRIES
* @see #ERLinkedList
- * @see #ERSystem
- * @see common\ers.h\ERInterface#alloc(ERInterface)
+ * @see ERS_impl::vtable#alloc
*/
-static void *ers_obj_alloc_entry(ERInterface self)
+static void *ers_obj_alloc_entry(ERS self)
{
- ERSystem obj = (ERSystem)self;
+ ERS_impl obj = (ERS_impl)self;
void *ret;
if (obj == NULL) {
- ShowError("ers_obj_alloc_entry: NULL object, aborting entry allocation.\n");
+ ShowError("ers::alloc : NULL object, aborting entry allocation.\n");
return NULL;
}
@@ -213,11 +194,11 @@ static void *ers_obj_alloc_entry(ERInterface self)
} else { // allocate a new block
if (obj->num == obj->max) { // expand the block array
if (obj->max == UINT32_MAX) { // No more space for blocks
- ShowFatalError("ers_obj_alloc_entry: maximum number of blocks reached, increase ERS_BLOCK_ENTRIES.\n"
+ ShowFatalError("ers::alloc : maximum number of blocks reached, increase ERS_BLOCK_ENTRIES.\n"
"exiting the program...\n");
exit(EXIT_FAILURE);
}
- obj->max = (obj->max<<2) +3; // = obj->max*4 +3; - overflow won't happen
+ obj->max = (obj->max*4)+3; // left shift bits '11' - overflow won't happen
RECREATE(obj->blocks, uint8 *, obj->max);
}
CREATE(obj->blocks[obj->num], uint8, obj->size*ERS_BLOCK_ENTRIES);
@@ -234,22 +215,20 @@ static void *ers_obj_alloc_entry(ERInterface self)
* Freeing such an entry can lead to unexpected behaviour.
* @param self Interface of the entry manager
* @param entry Entry to be freed
- * @protected
* @see #ERLinkedList
- * @see #ERSystem
- * @see ERSystem#reuse
- * @see common\ers.h\ERInterface#free(ERInterface,void *)
+ * @see ERS_impl#reuse
+ * @see ERS_impl::vtable#free
*/
-static void ers_obj_free_entry(ERInterface self, void *entry)
+static void ers_obj_free_entry(ERS self, void *entry)
{
- ERSystem obj = (ERSystem)self;
+ ERS_impl obj = (ERS_impl)self;
ERLinkedList reuse;
if (obj == NULL) {
- ShowError("ers_obj_free_entry: NULL object, aborting entry freeing.\n");
+ ShowError("ers::free : NULL object, aborting entry freeing.\n");
return;
} else if (entry == NULL) {
- ShowError("ers_obj_free_entry: NULL entry, nothing to free.\n");
+ ShowError("ers::free : NULL entry, nothing to free.\n");
return;
}
@@ -262,17 +241,15 @@ static void ers_obj_free_entry(ERInterface self, void *entry)
* Return the size of the entries allocated from this manager.
* @param self Interface of the entry manager
* @return Size of the entries of this manager in bytes
- * @protected
- * @see #ERSystem
- * @see ERSystem#size
- * @see common\ers.h\ERInterface#enty_size(ERInterface)
+ * @see ERS_impl#size
+ * @see ERS_impl::vtable#entry_size
*/
-static uint32 ers_obj_entry_size(ERInterface self)
+static uint32 ers_obj_entry_size(ERS self)
{
- ERSystem obj = (ERSystem)self;
+ ERS_impl obj = (ERS_impl)self;
if (obj == NULL) {
- ShowError("ers_obj_entry_size: NULL object, returning 0.\n");
+ ShowError("ers::entry_size : NULL object, returning 0.\n");
return 0;
}
@@ -285,19 +262,18 @@ static uint32 ers_obj_entry_size(ERInterface self)
* When destroying the manager a warning is shown if the manager has
* missing/extra entries.
* @param self Interface of the entry manager
- * @protected
* @see #ERLinkedList
- * @see #ERSystem
- * @see common\ers.h\ERInterface#destroy(ERInterface)
+ * @see ERS_impl::vtable#destroy
*/
-static void ers_obj_destroy(ERInterface self)
+static void ers_obj_destroy(ERS self)
{
- ERSystem obj = (ERSystem)self;
+ ERS_impl obj = (ERS_impl)self;
ERLinkedList reuse,old;
- uint32 i, count;
+ uint32 i;
+ uint32 count;
if (obj == NULL) {
- ShowError("ers_obj_destroy: NULL object, aborting instance destruction.\n");
+ ShowError("ers::destroy: NULL object, aborting instance destruction.\n");
return;
}
@@ -334,14 +310,14 @@ static void ers_obj_destroy(ERInterface self)
}
}
if (count) { // missing entries
- ShowWarning("ers_obj_destroy: %u entries missing (possible double free), continuing destruction (entry size=%u).",
+ ShowWarning("ers::destroy : %u entries missing (possible double free), continuing destruction (entry size=%u).",
count, obj->size);
} else if (reuse) { // extra entries
while (reuse && count != UINT32_MAX) {
count++;
reuse = reuse->next;
}
- ShowWarning("ers_obj_destroy: %u extra entries found, continuing destruction (entry size=%u).",
+ ShowWarning("ers::destroy : %u extra entries found, continuing destruction (entry size=%u).",
count, obj->size);
}
// destroy the entry manager
@@ -369,17 +345,13 @@ static void ers_obj_destroy(ERInterface self)
* ERS_ALIGNED that is greater or equal to size is what's actually used.
* @param The requested size of the entry in bytes
* @return Interface of the object
- * @public
- * @see #ERSystem
+ * @see #ERS_impl
* @see #ers_root
* @see #ers_num
- * @see common\ers.h#ERInterface
- * @see common\ers.h\ERInterface#destroy(ERInterface)
- * @see common\ers.h#ers_new_(uint32)
*/
-ERInterface ers_new(uint32 size)
+ERS ers_new(size_t size)
{
- ERSystem obj;
+ ERS_impl obj;
uint32 i;
if (size == 0) {
@@ -398,7 +370,7 @@ ERInterface ers_new(uint32 size)
if (obj->size == size) {
// found a manager that handles the entry size
obj->destroy++;
- return &obj->eri;
+ return &obj->vtable;
}
}
// create a new manager to handle the entry size
@@ -407,12 +379,12 @@ ERInterface ers_new(uint32 size)
"exiting the program...\n");
exit(EXIT_FAILURE);
}
- obj = (ERSystem)aMalloc(sizeof(struct ers));
+ obj = (ERS_impl)aMalloc(sizeof(struct ers_impl));
// Public interface
- obj->eri.alloc = ers_obj_alloc_entry;
- obj->eri.free = ers_obj_free_entry;
- obj->eri.entry_size = ers_obj_entry_size;
- obj->eri.destroy = ers_obj_destroy;
+ obj->vtable.alloc = ers_obj_alloc_entry;
+ obj->vtable.free = ers_obj_free_entry;
+ obj->vtable.entry_size = ers_obj_entry_size;
+ obj->vtable.destroy = ers_obj_destroy;
// Block reusage system
obj->reuse = NULL;
obj->blocks = NULL;
@@ -423,7 +395,7 @@ ERInterface ers_new(uint32 size)
// Properties
obj->size = size;
ers_root[ers_num++] = obj;
- return &obj->eri;
+ return &obj->vtable;
}
/**
@@ -432,18 +404,20 @@ ERInterface ers_new(uint32 size)
* The number of entries are checked and a warning is shown if extra reusable
* entries are found.
* The extra entries are included in the count of reusable entries.
- * @public
* @see #ERLinkedList
- * @see #ERSystem
+ * @see #ERS_impl
* @see #ers_root
* @see #ers_num
- * @see common\ers.h#ers_report(void)
*/
void ers_report(void)
{
- uint32 i, j, used, reusable, extra;
+ uint32 i;
+ uint32 j;
+ uint32 used;
+ uint32 reusable;
+ uint32 extra;
ERLinkedList reuse;
- ERSystem obj;
+ ERS_impl obj;
// Root system report
ShowMessage(CL_BOLD"Entry Reusage System report:\n"CL_NORMAL);
@@ -506,16 +480,15 @@ void ers_report(void)
* The use of this is NOT recommended.
* It should only be used in extreme situations to make shure all the memory
* allocated by this system is released.
- * @public
- * @see #ERSystem
+ * @see #ERS_impl
* @see #ers_root
* @see #ers_num
- * @see common\ers.h#ers_force_destroy_all(void)
*/
void ers_force_destroy_all(void)
{
- uint32 i, j;
- ERSystem obj;
+ uint32 i;
+ uint32 j;
+ ERS_impl obj;
for (i = 0; i < ers_num; i++) {
obj = ers_root[i];
diff --git a/src/common/ers.h b/src/common/ers.h
index 9b6b4b62d..e07ec7137 100644
--- a/src/common/ers.h
+++ b/src/common/ers.h
@@ -36,7 +36,6 @@
* @version 0.1 - Initial version *
* @author Flavio @ Amazon Project *
* @encoding US-ASCII *
- * @see common#ers.c *
\*****************************************************************************/
#ifndef _ERS_H_
#define _ERS_H_
@@ -47,7 +46,7 @@
* (1) All public parts of the Entry Reusage System. *
* DISABLE_ERS - Define to disable this system. *
* ERS_ALIGNED - Alignment of the entries in the blocks. *
- * ERInterface - Interface of the entry manager. *
+ * ERS - Entry manager. *
* ers_new - Allocate an instance of an entry manager. *
* ers_report - Print a report about the current state. *
* ers_force_destroy_all - Force the destruction of all the managers. *
@@ -57,7 +56,6 @@
* Define this to disable the Entry Reusage System.
* All code except the typedef of ERInterface will be disabled.
* To allow a smooth transition,
- * @public
*/
//#define DISABLE_ERS
@@ -67,8 +65,6 @@
* This should NEVER be set to zero or less.
* If greater than one, some memory can be wasted. This should never be needed
* but is here just in case some aligment issues arise.
- * @public
- * @see #ers_new(uint32)
*/
#ifndef ERS_ALIGNED
# define ERS_ALIGNED 1
@@ -80,8 +76,6 @@
* @param free Free an entry allocated from this manager
* @param entry_size Return the size of the entries of this manager
* @param destroy Destroy this instance of the manager
- * @public
- * @see #ers_new(uint32)
*/
typedef struct eri {
@@ -90,9 +84,6 @@ typedef struct eri {
* If there are reusable entries available, it reuses one instead.
* @param self Interface of the entry manager
* @return An entry
- * @protected
- * @see #ERInterface
- * @see ERInterface#free(ERInterface,void *)
*/
void *(*alloc)(struct eri *self);
@@ -102,9 +93,6 @@ typedef struct eri {
* Freeing such an entry can lead to unexpected behaviour.
* @param self Interface of the entry manager
* @param entry Entry to be freed
- * @protected
- * @see #ERInterface
- * @see ERInterface#alloc(ERInterface)
*/
void (*free)(struct eri *self, void *entry);
@@ -112,8 +100,6 @@ typedef struct eri {
* Return the size of the entries allocated from this manager.
* @param self Interface of the entry manager
* @return Size of the entries of this manager in bytes
- * @protected
- * @see #ERInterface
*/
uint32 (*entry_size)(struct eri *self);
@@ -123,13 +109,10 @@ typedef struct eri {
* When destroying the manager a warning is shown if the manager has
* missing/extra entries.
* @param self Interface of the entry manager
- * @protected
- * @see #ERInterface
- * @see #ers_new(uint32)
*/
void (*destroy)(struct eri *self);
-} *ERInterface;
+} *ERS;
#ifdef DISABLE_ERS
// Use memory manager to allocate/free and disable other interface functions
@@ -158,13 +141,8 @@ typedef struct eri {
* ERS_ALIGNED that is greater or equal to size is what's actually used.
* @param The requested size of the entry in bytes
* @return Interface of the object
- * @public
- * @see #ERS_ALIGNED
- * @see #ERInterface
- * @see ERInterface#destroy(ERInterface)
- * @see common\ers.c#ers_new(uint32)
*/
-ERInterface ers_new(uint32 size);
+ERS ers_new(size_t size);
/**
* Print a report about the current state of the Entry Reusage System.
@@ -172,8 +150,6 @@ ERInterface ers_new(uint32 size);
* The number of entries are checked and a warning is shown if extra reusable
* entries are found.
* The extra entries are included in the count of reusable entries.
- * @public
- * @see common\ers.c#ers_report(void)
*/
void ers_report(void);
@@ -184,8 +160,6 @@ void ers_report(void);
* The use of this is NOT recommended.
* It should only be used in extreme situations to make shure all the memory
* allocated by this system is released.
- * @public
- * @see common\ers.c#ers_force_destroy_all(void)
*/
void ers_force_destroy_all(void);
#endif /* DISABLE_ERS / not DISABLE_ERS */
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index fa9ea650b..4d4fcafd6 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -230,7 +230,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
{ // from here, we will skip the '\033['
// we break at the first unprocessible position
// assuming regular text is starting there
- uchar numbers[16], numpoint=0;
+ uint8 numbers[16], numpoint=0;
CONSOLE_SCREEN_BUFFER_INFO info;
// initialize
@@ -266,7 +266,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
}
else if( *q == 'm' )
{ // \033[#;...;#m - Set Graphics Rendition (SGR)
- uint i;
+ uint8 i;
for(i=0; i<= numpoint; ++i)
{
if( 0x00 == (0xF0 & numbers[i]) )
@@ -314,7 +314,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
}
else if( 0x30 == (0xF0 & numbers[i]) )
{ // foreground
- uint num = numbers[i]&0x0F;
+ uint8 num = numbers[i]&0x0F;
if(num==9) info.wAttributes |= FOREGROUND_INTENSITY;
if(num>7) num=7; // set white for 37, 38 and 39
info.wAttributes &= ~(FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
@@ -327,7 +327,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
}
else if( 0x40 == (0xF0 & numbers[i]) )
{ // background
- uint num = numbers[i]&0x0F;
+ uint8 num = numbers[i]&0x0F;
if(num==9) info.wAttributes |= BACKGROUND_INTENSITY;
if(num>7) num=7; // set white for 47, 48 and 49
info.wAttributes &= ~(BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE);
@@ -347,7 +347,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
// \033[0J - Clears the screen from cursor to end of display. The cursor position is unchanged.
// \033[1J - Clears the screen from start to cursor. The cursor position is unchanged.
// \033[2J - Clears the screen and moves the cursor to the home position (line 1, column 1).
- uint num = (numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F);
+ uint8 num = (numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F);
int cnt;
COORD origin = {0,0};
if(num==1)
@@ -373,7 +373,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
// \033[1K - Clears all characters from start of line to the cursor position.
// \033[2K - Clears all characters of the whole line.
- uint num = (numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F);
+ uint8 num = (numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F);
COORD origin = {0,info.dwCursorPosition.Y};
SHORT cnt;
if(num==1)
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 823dde505..2ee492e53 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8,10 +8,9 @@
#include <math.h>
#include <limits.h>
-#include "../common/cbasetypes.h"
+#include "../common/mmo.h"
#include "../common/timer.h"
#include "../common/nullpo.h"
-#include "../common/mmo.h"
#include "../common/core.h"
#include "../common/showmsg.h"
#include "../common/malloc.h"
diff --git a/src/map/battle.c b/src/map/battle.c
index b1e194247..e315142f9 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4480,7 +4480,7 @@ int battle_config_read(const char *cfgName)
}
void do_init_battle(void) {
- delay_damage_ers = ers_new((uint32)sizeof(struct delay_damage));
+ delay_damage_ers = ers_new(sizeof(struct delay_damage));
}
void do_final_battle(void) {
diff --git a/src/map/clif.c b/src/map/clif.c
index a1fc5447d..78fcb647b 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3242,7 +3242,7 @@ int clif_changeoption(struct block_list* bl)
WBUFW(buf,6) = sc->opt1;
WBUFW(buf,8) = sc->opt2;
WBUFL(buf,10) = sc->option;
- WBUFB(buf,14) = 0; // ??
+ WBUFB(buf,14) = 0; // PK???
if(disguised(bl)) {
clif_send(buf,packet_len_table[0x229],bl,AREA_WOS);
WBUFL(buf,2) = -bl->id;
diff --git a/src/map/guild.c b/src/map/guild.c
index 6ad15968e..0ddb966d5 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -206,7 +206,7 @@ void do_init_guild(void)
castle_db=db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
guild_expcache_db=db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_BASE,sizeof(int));
guild_infoevent_db=db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_BASE,sizeof(int));
- expcache_ers = ers_new((uint32)sizeof(struct guild_expcache));
+ expcache_ers = ers_new(sizeof(struct guild_expcache));
guild_castleinfoevent_db=db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_BASE,sizeof(int));
guild_read_castledb();
diff --git a/src/map/mob.c b/src/map/mob.c
index d357c1199..286146e5c 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4195,8 +4195,8 @@ int do_init_mob(void)
malloc_set(mob_db_data,0,sizeof(mob_db_data)); //Clear the array
mob_db_data[0] = aCalloc(1, sizeof (struct mob_data)); //This mob is used for random spawns
mob_makedummymobdb(0); //The first time this is invoked, it creates the dummy mob
- item_drop_ers = ers_new((uint32)sizeof(struct item_drop));
- item_drop_list_ers = ers_new((uint32)sizeof(struct item_drop_list));
+ item_drop_ers = ers_new(sizeof(struct item_drop));
+ item_drop_list_ers = ers_new(sizeof(struct item_drop_list));
#ifndef TXT_ONLY
if(db_use_sqldbs)
diff --git a/src/map/npc.c b/src/map/npc.c
index 6e39f3a20..629d9e94f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3013,7 +3013,7 @@ int do_init_npc(void)
npcname_db = db_alloc(__FILE__,__LINE__,DB_STRING,DB_OPT_BASE,NAME_LENGTH);
malloc_set(&ev_tm_b, -1, sizeof(ev_tm_b));
- timer_event_ers = ers_new((uint32)sizeof(struct timer_event_data));
+ timer_event_ers = ers_new(sizeof(struct timer_event_data));
for (nsl = npc_src_first; nsl; nsl = nsl->next) {
npc_parsesrcfile(nsl->name);
diff --git a/src/map/pet.c b/src/map/pet.c
index 4d153be8d..035514bd1 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -1371,8 +1371,8 @@ int do_init_pet(void)
malloc_set(pet_db,0,sizeof(pet_db));
read_petdb();
- item_drop_ers = ers_new((uint32)sizeof(struct item_drop));
- item_drop_list_ers = ers_new((uint32)sizeof(struct item_drop_list));
+ item_drop_ers = ers_new(sizeof(struct item_drop));
+ item_drop_list_ers = ers_new(sizeof(struct item_drop_list));
add_timer_func_list(pet_hungry,"pet_hungry");
add_timer_func_list(pet_ai_hard,"pet_ai_hard");
diff --git a/src/map/skill.c b/src/map/skill.c
index fc440ecf0..c7f135df1 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11647,8 +11647,8 @@ int do_init_skill (void)
skill_readdb();
skill_dance_switch_sub(NULL, NULL, 2); //Initialize Song/Dance overlap switch code.
- skill_unit_ers = ers_new((uint32)sizeof(struct skill_unit_group));
- skill_timer_ers = ers_new((uint32)sizeof(struct skill_timerskill));
+ skill_unit_ers = ers_new(sizeof(struct skill_unit_group));
+ skill_timer_ers = ers_new(sizeof(struct skill_timerskill));
if (battle_config.skill_sp_override_grffile)
skill_read_skillspamount();
diff --git a/src/txt-converter/Makefile b/src/txt-converter/Makefile
index 284f8dc81..2e40e838d 100644
--- a/src/txt-converter/Makefile
+++ b/src/txt-converter/Makefile
@@ -2,14 +2,14 @@ all sql: char-converter login-converter
char-converter: char-converter.o ../common/obj/minicore.o \
../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/strlib.o \
- ../common/obj/mapindex.o ../common/obj/ers.o \
+ ../common/obj/mapindex.o ../common/obj/ers.o ../common/obj/utils.o \
../char/char.o ../char/int_pet.o ../char/int_storage.o ../char/inter.o \
../char/int_party.o ../char/int_guild.o \
../char_sql/char.o ../char_sql/int_pet.o ../char_sql/int_storage.o \
../char_sql/inter.o ../char_sql/int_party.o ../char_sql/int_guild.o
$(CC) -o ../../tools/$@ $^ $(LIB_S)
-login-converter: login-converter.o ../common/obj/minicore.o ../common/obj/db.o ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/ers.o
+login-converter: login-converter.o ../common/obj/minicore.o ../common/obj/db.o ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/ers.o ../common/obj/utils.o
$(CC) -o ../../tools/$@ $^ $(LIB_S)
clean:
diff --git a/src/txt-converter/char-converter.c b/src/txt-converter/char-converter.c
index 29d1c393f..6db1aceb6 100644
--- a/src/txt-converter/char-converter.c
+++ b/src/txt-converter/char-converter.c
@@ -5,9 +5,9 @@
#include <stdlib.h>
#include <string.h>
+#include "../common/mmo.h"
#include "../common/core.h"
#include "../common/strlib.h"
-#include "../common/mmo.h"
#include "../common/showmsg.h"
#include "../common/mapindex.h"
diff --git a/src/txt-converter/login-converter.c b/src/txt-converter/login-converter.c
index ab236d322..840d61e1c 100644
--- a/src/txt-converter/login-converter.c
+++ b/src/txt-converter/login-converter.c
@@ -4,12 +4,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "cbasetypes.h"
+#ifdef __WIN32
#include <my_global.h>
+#include <my_sys.h>
+#endif
#include <mysql.h>
+#include "../common/mmo.h"
#include "../common/core.h"
#include "../common/db.h"
-#include "../common/mmo.h"
struct auth_dat_ {
int account_id, sex;