summaryrefslogtreecommitdiff
path: root/src/common/db.c
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-24 00:15:41 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-24 00:15:41 +0000
commit60c5d7f50c39c55f1ac7121fb1391e4c49966824 (patch)
tree714f721dbbf90725784b75d8ac89e236d5072d9a /src/common/db.c
parent4426eb53903895faa1e3db6c7db6c75716906dd1 (diff)
downloadhercules-60c5d7f50c39c55f1ac7121fb1391e4c49966824.tar.gz
hercules-60c5d7f50c39c55f1ac7121fb1391e4c49966824.tar.bz2
hercules-60c5d7f50c39c55f1ac7121fb1391e4c49966824.tar.xz
hercules-60c5d7f50c39c55f1ac7121fb1391e4c49966824.zip
Some more changes for g++
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@972 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/db.c')
-rw-r--r--src/common/db.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/db.c b/src/common/db.c
index d76b7a44c..12d54176c 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -42,18 +42,20 @@ static void free_dbn(struct dbn* add_dbn)
}
#endif
+// maybe change the void* to const char* ???
static int strdb_cmp(struct dbt* table,void* a,void* b)
{
if(table->maxlen)
- return strncmp(a,b,table->maxlen);
- return strcmp(a,b);
+ return strncmp((const char*)a,(const char*)b,table->maxlen);
+ return strcmp((const char*)a,(const char*)b);
}
+// maybe change the void* to unsigned char* ???
static unsigned int strdb_hash(struct dbt* table,void* a)
{
int i;
unsigned int h;
- unsigned char *p=a;
+ unsigned char *p = (unsigned char*)a;
i=table->maxlen;
if(i==0) i=0x7fffffff;
@@ -131,14 +133,14 @@ void * db_search2(struct dbt *table, const char *key)
{
int i,sp;
struct dbn *p,*pn,*stack[64];
- int slen = strlen(key);
+ int slen = strlen(key);
for(i=0;i<HASH_SIZE;i++){
if((p=table->ht[i])==NULL)
continue;
sp=0;
while(1){
- if (strnicmp(key, p->key, slen) == 0)
+ if (strnicmp(key, (const char*)p->key, slen) == 0)
return p->data;
if((pn=p->left)!=NULL){
if(p->right){