summaryrefslogtreecommitdiff
path: root/src/char_sql/int_guild.c
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-24 03:12:42 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-24 03:12:42 +0000
commit817a048b554ed05fda836a9b55e0dc9a816334b7 (patch)
tree1ff6297e35e9c286198b0e5201f186d4cdb9f4c5 /src/char_sql/int_guild.c
parentb50b9537644c77a4a9e03e5ad0e8d7ee3a952401 (diff)
downloadhercules-817a048b554ed05fda836a9b55e0dc9a816334b7.tar.gz
hercules-817a048b554ed05fda836a9b55e0dc9a816334b7.tar.bz2
hercules-817a048b554ed05fda836a9b55e0dc9a816334b7.tar.xz
hercules-817a048b554ed05fda836a9b55e0dc9a816334b7.zip
A lot of changes. login and char server compile under both TXT and SQL under g++. Same for the convertors (login and char). One change that I felt iffy about, but it worked, was the char* buf -> unsinged char* bug in clif.c
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@975 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/int_guild.c')
-rw-r--r--src/char_sql/int_guild.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index e3b8d30a8..de6fc0ed0 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -329,11 +329,11 @@ struct guild * inter_guild_fromsql(int guild_id)
if (guild_id==0) return 0;
- g = numdb_search(guild_db_,guild_id);
+ g = (struct guild*)numdb_search(guild_db_,guild_id);
if (g != NULL)
return g;
- g = (struct guild *) aMalloc(sizeof(struct guild));
+ g = (struct guild*)aMalloc(sizeof(struct guild));
memset(g,0,sizeof(struct guild));
// printf("Retrieve guild information from sql ......\n");
@@ -527,9 +527,9 @@ int inter_guildcastle_tosql(struct guild_castle *gc)
if (gc==NULL) return 0;
//printf("Save to guild_castle\n");
- gcopy = numdb_search(castle_db_,gc->castle_id);
+ gcopy = (struct guild_castle*)numdb_search(castle_db_,gc->castle_id);
if (gcopy == NULL) {
- gcopy = (struct guild_castle *) aMalloc(sizeof(struct guild_castle));
+ gcopy = (struct guild_castle*)aMalloc(sizeof(struct guild_castle));
numdb_insert(castle_db_, gc->castle_id, gcopy);
} else {
if ((gc->guild_id == gcopy->guild_id ) && ( gc->economy == gcopy->economy ) && ( gc->defense == gcopy->defense ) && ( gc->triggerE == gcopy->triggerE ) && ( gc->triggerD == gcopy->triggerD ) && ( gc->nextTime == gcopy->nextTime ) && ( gc->payTime == gcopy->payTime ) && ( gc->createTime == gcopy->createTime ) && ( gc->visibleC == gcopy->visibleC ) && ( gc->visibleG0 == gcopy->visibleG0 ) && ( gc->visibleG1 == gcopy->visibleG1 ) && ( gc->visibleG2 == gcopy->visibleG2 ) && ( gc->visibleG3 == gcopy->visibleG3 ) && ( gc->visibleG4 == gcopy->visibleG4 ) && ( gc->visibleG5 == gcopy->visibleG5 ) && ( gc->visibleG6 == gcopy->visibleG6 ) && ( gc->visibleG7 == gcopy->visibleG7 ) && ( gc->Ghp0 == gcopy->Ghp0 ) && ( gc->Ghp1 == gcopy->Ghp1 ) && ( gc->Ghp2 == gcopy->Ghp2 ) && ( gc->Ghp3 == gcopy->Ghp3 ) && ( gc->Ghp4 == gcopy->Ghp4 ) && ( gc->Ghp5 == gcopy->Ghp5 ) && ( gc->Ghp6 == gcopy->Ghp6 ) && ( gc->Ghp7 == gcopy->Ghp7 ))
@@ -573,13 +573,13 @@ int inter_guildcastle_tosql(struct guild_castle *gc)
// Read guild_castle from sql
int inter_guildcastle_fromsql(int castle_id,struct guild_castle *gc)
{
- struct guild_castle *gcopy;
+ struct guild_castle *gcopy;
if (gc==NULL) return 0;
//printf("Read from guild_castle\n");
- gcopy = numdb_search(castle_db_, castle_id);
+ gcopy = (struct guild_castle*)numdb_search(castle_db_, castle_id);
if (gcopy == NULL) {
- gcopy = (struct guild_castle *) aMalloc(sizeof(struct guild_castle));
+ gcopy = (struct guild_castle*)aMalloc(sizeof(struct guild_castle));
numdb_insert(castle_db_, gc->castle_id, gcopy);
} else {
memcpy(gc, gcopy, sizeof(struct guild_castle));
@@ -678,9 +678,9 @@ int inter_guild_sql_init()
guild_castleinfoevent_db_=numdb_init();
printf("interserver guild memory initialize.... (%d byte)\n",sizeof(struct guild));
- guild_pt = aCalloc(sizeof(struct guild), 1);
- guild_pt2= aCalloc(sizeof(struct guild), 1);
- guildcastle_pt=aCalloc(sizeof(struct guild_castle), 1);
+ guild_pt = (struct guild*)aCalloc(sizeof(struct guild), 1);
+ guild_pt2= (struct guild*)aCalloc(sizeof(struct guild), 1);
+ guildcastle_pt = (struct guild_castle*)aCalloc(sizeof(struct guild_castle), 1);
inter_guild_readdb(); // Read exp
@@ -1094,7 +1094,7 @@ int mapif_guild_castle_alldataload(int fd) {
gc->Ghp7 = atoi(sql_row[25]);
memcpy(WFIFOP(fd,len), gc, sizeof(struct guild_castle));
- gcopy = numdb_search(castle_db_,gc->castle_id);
+ gcopy = (struct guild_castle*)numdb_search(castle_db_,gc->castle_id);
if (gcopy == NULL) {
gcopy = (struct guild_castle *) aMalloc(sizeof(struct guild_castle));
numdb_insert(castle_db_, gc->castle_id, gcopy);
@@ -1671,21 +1671,21 @@ int mapif_parse_GuildCheck(int fd,int guild_id,int account_id,int char_id)
int inter_guild_parse_frommap(int fd)
{
switch(RFIFOW(fd,0)){
- case 0x3030: mapif_parse_CreateGuild(fd,RFIFOL(fd,4),RFIFOP(fd,8),(struct guild_member *)RFIFOP(fd,32)); break;
+ case 0x3030: mapif_parse_CreateGuild(fd,RFIFOL(fd,4),(char*)RFIFOP(fd,8),(struct guild_member *)RFIFOP(fd,32)); break;
case 0x3031: mapif_parse_GuildInfo(fd,RFIFOL(fd,2)); break;
case 0x3032: mapif_parse_GuildAddMember(fd,RFIFOL(fd,4),(struct guild_member *)RFIFOP(fd,8)); break;
- case 0x3034: mapif_parse_GuildLeave(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOP(fd,15)); break;
+ case 0x3034: mapif_parse_GuildLeave(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(const char*)RFIFOP(fd,15)); break;
case 0x3035: mapif_parse_GuildChangeMemberInfoShort(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17)); break;
case 0x3036: mapif_parse_BreakGuild(fd,RFIFOL(fd,2)); break;
- case 0x3037: mapif_parse_GuildMessage(fd,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOP(fd,12),RFIFOW(fd,2)-12); break;
+ case 0x3037: mapif_parse_GuildMessage(fd,RFIFOL(fd,4),RFIFOL(fd,8),(char*)RFIFOP(fd,12),RFIFOW(fd,2)-12); break;
case 0x3038: mapif_parse_GuildCheck(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); break;
- case 0x3039: mapif_parse_GuildBasicInfoChange(fd,RFIFOL(fd,4),RFIFOW(fd,8),RFIFOP(fd,10),RFIFOW(fd,2)-10); break;
- case 0x303A: mapif_parse_GuildMemberInfoChange(fd,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOL(fd,12),RFIFOW(fd,16),RFIFOP(fd,18),RFIFOW(fd,2)-18); break;
+ case 0x3039: mapif_parse_GuildBasicInfoChange(fd,RFIFOL(fd,4),RFIFOW(fd,8),(const char*)RFIFOP(fd,10),RFIFOW(fd,2)-10); break;
+ case 0x303A: mapif_parse_GuildMemberInfoChange(fd,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOL(fd,12),RFIFOW(fd,16),(const char*)RFIFOP(fd,18),RFIFOW(fd,2)-18); break;
case 0x303B: mapif_parse_GuildPosition(fd,RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12)); break;
case 0x303C: mapif_parse_GuildSkillUp(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); break;
case 0x303D: mapif_parse_GuildAlliance(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18)); break;
- case 0x303E: mapif_parse_GuildNotice(fd,RFIFOL(fd,2),RFIFOP(fd,6),RFIFOP(fd,66)); break;
- case 0x303F: mapif_parse_GuildEmblem(fd,RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOP(fd,12)); break;
+ case 0x303E: mapif_parse_GuildNotice(fd,RFIFOL(fd,2),(const char*)RFIFOP(fd,6),(const char*)RFIFOP(fd,66)); break;
+ case 0x303F: mapif_parse_GuildEmblem(fd,RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8),(const char*)RFIFOP(fd,12)); break;
case 0x3040: mapif_parse_GuildCastleDataLoad(fd,RFIFOW(fd,2),RFIFOB(fd,4)); break;
case 0x3041: mapif_parse_GuildCastleDataSave(fd,RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5)); break;