From 7bfe35400c79bf97a5b0bed9f170912c37cf9452 Mon Sep 17 00:00:00 2001 From: amber Date: Tue, 29 Mar 2005 05:05:50 +0000 Subject: Fixed use of storage variable to conform to ANSI C spec [MouseJstr] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1327 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/int_storage.c | 92 +++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'src/char_sql') diff --git a/src/char_sql/int_storage.c b/src/char_sql/int_storage.c index 7f059fcf8..c13c782a6 100644 --- a/src/char_sql/int_storage.c +++ b/src/char_sql/int_storage.c @@ -24,19 +24,19 @@ int storage_tosql(int account_id,struct storage *p){ int count=0; struct itemtmp mapitem[MAX_GUILD_STORAGE]; for(i=0;istorage[i].nameid>0){ + if(p->storage_[i].nameid>0){ mapitem[count].flag=0; - mapitem[count].id = p->storage[i].id; - mapitem[count].nameid=p->storage[i].nameid; - mapitem[count].amount = p->storage[i].amount; - mapitem[count].equip = p->storage[i].equip; - mapitem[count].identify = p->storage[i].identify; - mapitem[count].refine = p->storage[i].refine; - mapitem[count].attribute = p->storage[i].attribute; - mapitem[count].card[0] = p->storage[i].card[0]; - mapitem[count].card[1] = p->storage[i].card[1]; - mapitem[count].card[2] = p->storage[i].card[2]; - mapitem[count].card[3] = p->storage[i].card[3]; + mapitem[count].id = p->storage_[i].id; + mapitem[count].nameid=p->storage_[i].nameid; + mapitem[count].amount = p->storage_[i].amount; + mapitem[count].equip = p->storage_[i].equip; + mapitem[count].identify = p->storage_[i].identify; + mapitem[count].refine = p->storage_[i].refine; + mapitem[count].attribute = p->storage_[i].attribute; + mapitem[count].card[0] = p->storage_[i].card[0]; + mapitem[count].card[1] = p->storage_[i].card[1]; + mapitem[count].card[2] = p->storage_[i].card[2]; + mapitem[count].card[3] = p->storage_[i].card[3]; count++; } } @@ -64,17 +64,17 @@ int storage_fromsql(int account_id, struct storage *p){ if (sql_res) { while((sql_row = mysql_fetch_row(sql_res))) { //start to fetch - p->storage[i].id= atoi(sql_row[0]); - p->storage[i].nameid= atoi(sql_row[1]); - p->storage[i].amount= atoi(sql_row[2]); - p->storage[i].equip= atoi(sql_row[3]); - p->storage[i].identify= atoi(sql_row[4]); - p->storage[i].refine= atoi(sql_row[5]); - p->storage[i].attribute= atoi(sql_row[6]); - p->storage[i].card[0]= atoi(sql_row[7]); - p->storage[i].card[1]= atoi(sql_row[8]); - p->storage[i].card[2]= atoi(sql_row[9]); - p->storage[i].card[3]= atoi(sql_row[10]); + p->storage_[i].id= atoi(sql_row[0]); + p->storage_[i].nameid= atoi(sql_row[1]); + p->storage_[i].amount= atoi(sql_row[2]); + p->storage_[i].equip= atoi(sql_row[3]); + p->storage_[i].identify= atoi(sql_row[4]); + p->storage_[i].refine= atoi(sql_row[5]); + p->storage_[i].attribute= atoi(sql_row[6]); + p->storage_[i].card[0]= atoi(sql_row[7]); + p->storage_[i].card[1]= atoi(sql_row[8]); + p->storage_[i].card[2]= atoi(sql_row[9]); + p->storage_[i].card[3]= atoi(sql_row[10]); p->storage_amount = ++i; } mysql_free_result(sql_res); @@ -92,19 +92,19 @@ int guild_storage_tosql(int guild_id, struct guild_storage *p){ int count=0; struct itemtmp mapitem[MAX_GUILD_STORAGE]; for(i=0;istorage[i].nameid>0){ + if(p->storage_[i].nameid>0){ mapitem[count].flag=0; - mapitem[count].id = p->storage[i].id; - mapitem[count].nameid=p->storage[i].nameid; - mapitem[count].amount = p->storage[i].amount; - mapitem[count].equip = p->storage[i].equip; - mapitem[count].identify = p->storage[i].identify; - mapitem[count].refine = p->storage[i].refine; - mapitem[count].attribute = p->storage[i].attribute; - mapitem[count].card[0] = p->storage[i].card[0]; - mapitem[count].card[1] = p->storage[i].card[1]; - mapitem[count].card[2] = p->storage[i].card[2]; - mapitem[count].card[3] = p->storage[i].card[3]; + mapitem[count].id = p->storage_[i].id; + mapitem[count].nameid=p->storage_[i].nameid; + mapitem[count].amount = p->storage_[i].amount; + mapitem[count].equip = p->storage_[i].equip; + mapitem[count].identify = p->storage_[i].identify; + mapitem[count].refine = p->storage_[i].refine; + mapitem[count].attribute = p->storage_[i].attribute; + mapitem[count].card[0] = p->storage_[i].card[0]; + mapitem[count].card[1] = p->storage_[i].card[1]; + mapitem[count].card[2] = p->storage_[i].card[2]; + mapitem[count].card[3] = p->storage_[i].card[3]; count++; } } @@ -134,17 +134,17 @@ int guild_storage_fromsql(int guild_id, struct guild_storage *p){ if (sql_res) { while((sql_row = mysql_fetch_row(sql_res))) { //start to fetch - p->storage[i].id= atoi(sql_row[0]); - p->storage[i].nameid= atoi(sql_row[1]); - p->storage[i].amount= atoi(sql_row[2]); - p->storage[i].equip= atoi(sql_row[3]); - p->storage[i].identify= atoi(sql_row[4]); - p->storage[i].refine= atoi(sql_row[5]); - p->storage[i].attribute= atoi(sql_row[6]); - p->storage[i].card[0]= atoi(sql_row[7]); - p->storage[i].card[1]= atoi(sql_row[8]); - p->storage[i].card[2]= atoi(sql_row[9]); - p->storage[i].card[3]= atoi(sql_row[10]); + p->storage_[i].id= atoi(sql_row[0]); + p->storage_[i].nameid= atoi(sql_row[1]); + p->storage_[i].amount= atoi(sql_row[2]); + p->storage_[i].equip= atoi(sql_row[3]); + p->storage_[i].identify= atoi(sql_row[4]); + p->storage_[i].refine= atoi(sql_row[5]); + p->storage_[i].attribute= atoi(sql_row[6]); + p->storage_[i].card[0]= atoi(sql_row[7]); + p->storage_[i].card[1]= atoi(sql_row[8]); + p->storage_[i].card[2]= atoi(sql_row[9]); + p->storage_[i].card[3]= atoi(sql_row[10]); p->storage_amount = ++i; if (i >= MAX_GUILD_STORAGE) break; -- cgit v1.2.3-70-g09d2