diff options
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 |
commit | 817a048b554ed05fda836a9b55e0dc9a816334b7 (patch) | |
tree | 1ff6297e35e9c286198b0e5201f186d4cdb9f4c5 /src/char | |
parent | b50b9537644c77a4a9e03e5ad0e8d7ee3a952401 (diff) | |
download | hercules-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')
-rw-r--r-- | src/char/char.c | 28 | ||||
-rw-r--r-- | src/char/int_guild.c | 14 | ||||
-rw-r--r-- | src/char/int_party.c | 12 | ||||
-rw-r--r-- | src/char/int_pet.c | 18 | ||||
-rw-r--r-- | src/char/int_storage.c | 20 | ||||
-rw-r--r-- | src/char/inter.c | 18 |
6 files changed, 55 insertions, 55 deletions
diff --git a/src/char/char.c b/src/char/char.c index fb154c51c..d851ea854 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -853,14 +853,14 @@ int make_new_char(int fd, unsigned char *dat) { // remove control characters from the name dat[23] = '\0'; - if (remove_control_chars(dat)) { + if (remove_control_chars((char*)dat)) { char_log("Make new char error (control char received in the name): (connection #%d, account: %d)." RETCODE, fd, sd->account_id); return -1; } // check lenght of character name - if (strlen(dat) < 4) { + if (strlen((const char*)dat) < 4) { char_log("Make new char error (character name too small): (connection #%d, account: %d, name: '%s')." RETCODE, fd, sd->account_id, dat); return -1; @@ -902,8 +902,8 @@ int make_new_char(int fd, unsigned char *dat) { } for(i = 0; i < char_num; i++) { - if ((name_ignoring_case != 0 && strcmp(char_dat[i].name, dat) == 0) || - (name_ignoring_case == 0 && strcmpi(char_dat[i].name, dat) == 0)) { + if ((name_ignoring_case != 0 && strcmp(char_dat[i].name, (const char*)dat) == 0) || + (name_ignoring_case == 0 && strcmpi(char_dat[i].name, (const char*)dat) == 0)) { char_log("Make new char error (name already exists): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %d), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d." RETCODE, fd, sd->account_id, dat[30], dat, char_dat[i].name, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29], dat[33], dat[31]); return -1; @@ -915,7 +915,7 @@ int make_new_char(int fd, unsigned char *dat) { } } - if (strcmp(wisp_server_name, dat) == 0) { + if (strcmp(wisp_server_name, (const char*)dat) == 0) { char_log("Make new char error (name used is wisp name for server): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %d), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d." RETCODE, fd, sd->account_id, dat[30], dat, char_dat[i].name, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29], dat[33], dat[31]); return -1; @@ -949,7 +949,7 @@ int make_new_char(int fd, unsigned char *dat) { char_dat[i].char_id = char_id_count++; char_dat[i].account_id = sd->account_id; char_dat[i].char_num = dat[30]; - strcpy(char_dat[i].name, dat); + strcpy(char_dat[i].name, (const char*)dat); char_dat[i].class_ = 0; char_dat[i].base_level = 1; char_dat[i].job_level = 1; @@ -1507,9 +1507,9 @@ int char_divorce(struct mmo_charstatus *cs) { //------------------------------------------------------------ // E-mail check: return 0 (not correct) or 1 (valid). by [Yor] //------------------------------------------------------------ -int e_mail_check(unsigned char *email) { +int e_mail_check(char *email) { char ch; - unsigned char* last_arobas; + char* last_arobas; // athena limits if (strlen(email) < 3 || strlen(email) > 39) @@ -1585,7 +1585,7 @@ static int char_delete(struct mmo_charstatus *cs) { // 離婚 if (cs->partner_id){ // 離婚情報をmapに通知 - char buf[10]; + unsigned char buf[10]; WBUFW(buf,0) = 0x2b12; WBUFL(buf,2) = cs->char_id; WBUFL(buf,6) = cs->partner_id; @@ -1798,7 +1798,7 @@ int parse_tologin(int fd) { if (i == MAX_MAP_SERVERS) char_log("'ladmin': Receiving a message for broadcast, but no map-server is online." RETCODE); else { - char buf[128]; + unsigned char buf[128]; char message[RFIFOL(fd,4) + 1]; // +1 to add a null terminated if not exist in the packet int lp; char *p; @@ -1946,7 +1946,7 @@ int parse_tologin(int fd) { if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2)) return 0; { - char buf[32000]; + unsigned char buf[32000]; if (gm_account != NULL) aFree(gm_account); gm_account = (struct gm_account*)aCalloc(sizeof(struct gm_account) * ((RFIFOW(fd,2) - 4) / 5), 1); @@ -2559,7 +2559,7 @@ int parse_char(int fd) { else printf("Account Logged On; Account ID: %d.\n", RFIFOL(fd,2)); if (sd == NULL) { - sd = session[fd]->session_data = (struct char_session_data*)aCalloc(sizeof(struct char_session_data), 1); + sd = (struct char_session_data*)session[fd]->session_data = (struct char_session_data*)aCalloc(sizeof(struct char_session_data), 1); memset(sd, 0, sizeof(struct char_session_data)); memcpy(sd->email, "no mail", 40); // put here a mail without '@' to refuse deletion if we don't receive the e-mail sd->connect_until_time = 0; // unknow or illimited (not displaying on map-server) @@ -2881,7 +2881,7 @@ int parse_char(int fd) { if (server_fd[i] < 0) break; } - if (i == MAX_MAP_SERVERS || strcmp(RFIFOP(fd,2), userid) || strcmp(RFIFOP(fd,26), passwd)){ + if (i == MAX_MAP_SERVERS || strcmp((char*)RFIFOP(fd,2), userid) || strcmp((char*)RFIFOP(fd,26), passwd)){ WFIFOB(fd,2) = 3; WFIFOSET(fd,3); RFIFOSKIP(fd,60); @@ -3019,7 +3019,7 @@ int mapif_send(int fd, unsigned char *buf, unsigned int len) { int send_users_tologin(int tid, unsigned int tick, int id, int data) { int users = count_users(); - char buf[16]; + unsigned char buf[16]; if (login_fd > 0 && session[login_fd]) { // send number of user to login server diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 348008e1d..b95817599 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -1419,21 +1419,21 @@ int mapif_parse_GuildCheck(int fd, int guild_id, int account_id, int char_id) { // ・エラーなら0(false)、そうでないなら1(true)をかえさなければならない 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; diff --git a/src/char/int_party.c b/src/char/int_party.c index 6b7f4361e..c95d13620 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -94,7 +94,7 @@ int inter_party_init() { continue; } - p = aCalloc(sizeof(struct party), 1); + p = (struct party*)aCalloc(sizeof(struct party), 1); if (p == NULL){ printf("int_party: out of memory!\n"); exit(0); @@ -572,15 +572,15 @@ int mapif_parse_PartyCheck(int fd, int party_id, int account_id, char *nick) { // ・エラーなら0(false)、そうでないなら1(true)をかえさなければならない int inter_party_parse_frommap(int fd) { switch(RFIFOW(fd,0)) { - case 0x3020: mapif_parse_CreateParty(fd, RFIFOL(fd,2), RFIFOP(fd,6), RFIFOP(fd,30), RFIFOP(fd,54), RFIFOW(fd,70)); break; + case 0x3020: mapif_parse_CreateParty(fd, RFIFOL(fd,2), (char*)RFIFOP(fd,6), (char*)RFIFOP(fd,30), (char*)RFIFOP(fd,54), RFIFOW(fd,70)); break; case 0x3021: mapif_parse_PartyInfo(fd, RFIFOL(fd,2)); break; - case 0x3022: mapif_parse_PartyAddMember(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOP(fd,10), RFIFOP(fd,34), RFIFOW(fd,50)); break; + case 0x3022: mapif_parse_PartyAddMember(fd, RFIFOL(fd,2), RFIFOL(fd,6), (char*)RFIFOP(fd,10), (char*)RFIFOP(fd,34), RFIFOW(fd,50)); break; case 0x3023: mapif_parse_PartyChangeOption(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOW(fd,10), RFIFOW(fd,12)); break; case 0x3024: mapif_parse_PartyLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break; - case 0x3025: mapif_parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOP(fd,10), RFIFOB(fd,26), RFIFOW(fd,27)); break; + case 0x3025: mapif_parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), (char*)RFIFOP(fd,10), RFIFOB(fd,26), RFIFOW(fd,27)); break; case 0x3026: mapif_parse_BreakParty(fd, RFIFOL(fd,2)); break; - case 0x3027: mapif_parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break; - case 0x3028: mapif_parse_PartyCheck(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOP(fd,10)); break; + case 0x3027: mapif_parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), (char*)RFIFOP(fd,12), RFIFOW(fd,2)-12); break; + case 0x3028: mapif_parse_PartyCheck(fd, RFIFOL(fd,2), RFIFOL(fd,6), (char*)RFIFOP(fd,10)); break; default: return 0; } diff --git a/src/char/int_pet.c b/src/char/int_pet.c index 0dd334514..f690e554e 100644 --- a/src/char/int_pet.c +++ b/src/char/int_pet.c @@ -41,16 +41,16 @@ int inter_pet_fromstr(char *str,struct s_pet *p) int s; int tmp_int[16]; char tmp_str[256]; - + memset(p,0,sizeof(struct s_pet)); - + // printf("sscanf pet main info\n"); s=sscanf(str,"%d,%d,%[^\t]\t%d,%d,%d,%d,%d,%d,%d,%d,%d",&tmp_int[0],&tmp_int[1],tmp_str,&tmp_int[2], &tmp_int[3],&tmp_int[4],&tmp_int[5],&tmp_int[6],&tmp_int[7],&tmp_int[8],&tmp_int[9],&tmp_int[10]); if(s!=12) return 1; - + p->pet_id = tmp_int[0]; p->class_ = tmp_int[1]; memcpy(p->name,tmp_str,24); @@ -88,7 +88,7 @@ int inter_pet_init() if( (fp=fopen(pet_txt,"r"))==NULL ) return 1; while(fgets(line,sizeof(line),fp)){ - p=aCalloc(sizeof(struct s_pet), 1); + p = (struct s_pet*)aCalloc(sizeof(struct s_pet), 1); if(p==NULL){ printf("int_pet: out of memory!\n"); exit(0); @@ -242,11 +242,11 @@ int mapif_create_pet(int fd,int account_id,int char_id,short pet_class,short pet p->intimate = 0; else if(p->intimate > 1000) p->intimate = 1000; - + numdb_insert(pet_db,p->pet_id,p); - + mapif_pet_created(fd,account_id,p); - + return 0; } @@ -292,7 +292,7 @@ int mapif_save_pet(int fd,int account_id,struct s_pet *data) p->pet_id = data->pet_id; if(p->pet_id == 0) data->pet_id = p->pet_id = pet_newid++; - numdb_insert(pet_db,p->pet_id,p); + numdb_insert(pet_db,p->pet_id,p); } if(data->hungry < 0) data->hungry = 0; @@ -322,7 +322,7 @@ int mapif_delete_pet(int fd,int pet_id) int mapif_parse_CreatePet(int fd) { mapif_create_pet(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOW(fd,14),RFIFOW(fd,16),RFIFOL(fd,18), - RFIFOL(fd,20),RFIFOB(fd,22),RFIFOB(fd,23),RFIFOP(fd,24)); + RFIFOL(fd,20),RFIFOB(fd,22),RFIFOB(fd,23),(char*)RFIFOP(fd,24)); return 0; } diff --git a/src/char/int_storage.c b/src/char/int_storage.c index 73d50f323..8e4711cec 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -56,7 +56,7 @@ int storage_fromstr(char *str,struct storage *p) if(set!=2) return 1; if(str[next]=='\n' || str[next]=='\r') - return 0; + return 0; next++; for(i=0;str[next] && str[next]!='\t';i++){ if(sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n", @@ -76,7 +76,7 @@ int storage_fromstr(char *str,struct storage *p) p->storage[i].card[3] = tmp_int[10]; next += len; if (str[next] == ' ') - next++; + next++; } else if(sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n", @@ -96,9 +96,9 @@ int storage_fromstr(char *str,struct storage *p) p->storage[i].card[3] = tmp_int[10]; next += len; if (str[next] == ' ') - next++; + next++; } - + else return 1; } return 0; @@ -138,7 +138,7 @@ int guild_storage_fromstr(char *str,struct guild_storage *p) if(set!=2) return 1; if(str[next]=='\n' || str[next]=='\r') - return 0; + return 0; next++; for(i=0;str[next] && str[next]!='\t';i++){ if(sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n", @@ -158,7 +158,7 @@ int guild_storage_fromstr(char *str,struct guild_storage *p) p->storage[i].card[3] = tmp_int[10]; next += len; if (str[next] == ' ') - next++; + next++; } else if(sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n", @@ -178,9 +178,9 @@ int guild_storage_fromstr(char *str,struct guild_storage *p) p->storage[i].card[3] = tmp_int[10]; next += len; if (str[next] == ' ') - next++; + next++; } - + else return 1; } return 0; @@ -242,7 +242,7 @@ int inter_storage_init() } while(fgets(line,65535,fp)){ sscanf(line,"%d",&tmp_int); - s=aCalloc(sizeof(struct storage), 1); + s = (struct storage*)aCalloc(sizeof(struct storage), 1); if(s==NULL){ printf("int_storage: out of memory!\n"); exit(0); @@ -270,7 +270,7 @@ int inter_storage_init() } while(fgets(line,65535,fp)){ sscanf(line,"%d",&tmp_int); - gs=aCalloc(sizeof(struct guild_storage), 1); + gs = (struct guild_storage*)aCalloc(sizeof(struct guild_storage), 1); if(gs==NULL){ printf("int_storage: out of memory!\n"); exit(0); diff --git a/src/char/inter.c b/src/char/inter.c index f0fe38f60..ac460d4c4 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -114,7 +114,7 @@ int inter_accreg_init() { while(fgets(line, sizeof(line)-1, fp)){ line[sizeof(line)-1] = '\0'; - reg = aCalloc(sizeof(struct accreg), 1); + reg = (struct accreg*)aCalloc(sizeof(struct accreg), 1); if (reg == NULL) { printf("inter: accreg: out of memory!\n"); exit(0); @@ -325,7 +325,7 @@ int mapif_account_reg(int fd, unsigned char *src) { // アカウント変数要求返信 int mapif_account_reg_reply(int fd,int account_id) { - struct accreg *reg = numdb_search(accreg_db,account_id); + struct accreg *reg = (struct accreg*)numdb_search(accreg_db,account_id); WFIFOW(fd,0) = 0x3804; WFIFOL(fd,4) = account_id; @@ -366,7 +366,7 @@ int check_ttl_wisdata() { wis_delnum = 0; numdb_foreach(wis_db, check_ttl_wisdata_sub, tick); for(i = 0; i < wis_delnum; i++) { - struct WisData *wd = numdb_search(wis_db, wis_dellist[i]); + struct WisData *wd = (struct WisData*)numdb_search(wis_db, wis_dellist[i]); printf("inter: wis data id=%d time out : from %s to %s\n", wd->id, wd->src, wd->dst); // removed. not send information after a timeout. Just no answer for the player //mapif_wis_end(wd, 1); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target @@ -403,7 +403,7 @@ int mapif_parse_WisRequest(int fd) { } // search if character exists before to ask all map-servers - if ((index = search_character_index(RFIFOP(fd,28))) == -1) { + if ((index = search_character_index((char*)RFIFOP(fd,28))) == -1) { unsigned char buf[27]; WBUFW(buf, 0) = 0x3802; memcpy(WBUFP(buf, 2), RFIFOP(fd, 4), 24); @@ -413,9 +413,9 @@ int mapif_parse_WisRequest(int fd) { } else { // to be sure of the correct name, rewrite it memset(RFIFOP(fd,28), 0, 24); - strncpy(RFIFOP(fd,28), search_character_name(index), 24); + strncpy((char*)RFIFOP(fd,28), search_character_name(index), 24); // if source is destination, don't ask other servers. - if (strcmp(RFIFOP(fd,4),RFIFOP(fd,28)) == 0) { + if (strcmp((char*)RFIFOP(fd,4),(char*)RFIFOP(fd,28)) == 0) { unsigned char buf[27]; WBUFW(buf, 0) = 0x3802; memcpy(WBUFP(buf, 2), RFIFOP(fd, 4), 24); @@ -450,7 +450,7 @@ int mapif_parse_WisRequest(int fd) { // Wisp/page transmission result int mapif_parse_WisReply(int fd) { int id = RFIFOL(fd,2), flag = RFIFOB(fd,6); - struct WisData *wd = numdb_search(wis_db, id); + struct WisData *wd = (struct WisData*)numdb_search(wis_db, id); if (wd == NULL) return 0; // This wisp was probably suppress before, because it was timeout of because of target was found on another map-server @@ -478,10 +478,10 @@ int mapif_parse_WisToGM(int fd) { // アカウント変数保存要求 int mapif_parse_AccReg(int fd) { int j, p; - struct accreg *reg = numdb_search(accreg_db, RFIFOL(fd,4)); + struct accreg *reg = (struct accreg*)numdb_search(accreg_db, RFIFOL(fd,4)); if (reg == NULL) { - if ((reg = aCalloc(sizeof(struct accreg), 1)) == NULL) { + if ((reg = (struct accreg*)aCalloc(sizeof(struct accreg), 1)) == NULL) { printf("inter: accreg: out of memory !\n"); exit(0); } |