Explorar o código

Fixed all warnings left from when compiling with -pedantic, confirmed with gcc, llvm and clang.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16415 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind %!s(int64=13) %!d(string=hai) anos
pai
achega
0f697714ac
Modificáronse 6 ficheiros con 23 adicións e 22 borrados
  1. 1 1
      src/common/malloc.c
  2. 16 15
      src/map/map.c
  3. 2 2
      src/map/mob.c
  4. 2 2
      src/map/pc.c
  5. 1 1
      src/map/pc.h
  6. 1 1
      src/map/skill.c

+ 1 - 1
src/common/malloc.c

@@ -327,7 +327,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
 	head->size  = (unsigned short)size;
 	*(long*)((char*)head + sizeof(struct unit_head) - sizeof(long) + size) = 0xdeadbeaf;
 	return (char *)head + sizeof(struct unit_head) - sizeof(long);
-};
+}
 
 void* _mcalloc(size_t num, size_t size, const char *file, int line, const char *func )
 {

+ 16 - 15
src/map/map.c

@@ -2463,21 +2463,22 @@ int map_random_dir(struct block_list *bl, short *x, short *y)
 }
 
 // gatŚn
-inline static struct mapcell map_gat2cell(int gat)
-{
-	struct mapcell cell = {0};
-	switch( gat )
-	{
-	case 0: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // walkable ground
-	case 1: cell.walkable = 0; cell.shootable = 0; cell.water = 0; break; // non-walkable ground
-	case 2: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
-	case 3: cell.walkable = 1; cell.shootable = 1; cell.water = 1; break; // walkable water
-	case 4: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
-	case 5: cell.walkable = 0; cell.shootable = 1; cell.water = 0; break; // gap (snipable)
-	case 6: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
-	default:
-		ShowWarning("map_gat2cell: unrecognized gat type '%d'\n", gat);
-		break;
+inline static struct mapcell map_gat2cell(int gat) {
+	struct mapcell cell;
+	
+	memset(&cell,0,sizeof(struct mapcell));
+	
+	switch( gat ) {
+		case 0: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // walkable ground
+		case 1: cell.walkable = 0; cell.shootable = 0; cell.water = 0; break; // non-walkable ground
+		case 2: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
+		case 3: cell.walkable = 1; cell.shootable = 1; cell.water = 1; break; // walkable water
+		case 4: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
+		case 5: cell.walkable = 0; cell.shootable = 1; cell.water = 0; break; // gap (snipable)
+		case 6: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
+		default:
+			ShowWarning("map_gat2cell: unrecognized gat type '%d'\n", gat);
+			break;
 	}
 
 	return cell;

+ 2 - 2
src/map/mob.c

@@ -1793,7 +1793,7 @@ static struct item_drop* mob_setdropitem(int nameid, int qty)
 	drop->item_data.identify = itemdb_isidentified(nameid);
 	drop->next = NULL;
 	return drop;
-};
+}
 
 /*==========================================
  * Initializes the delay drop structure for mob-looted items.
@@ -1804,7 +1804,7 @@ static struct item_drop* mob_setlootitem(struct item* item)
 	memcpy(&drop->item_data, item, sizeof(struct item));
 	drop->next = NULL;
 	return drop;
-};
+}
 
 /*==========================================
  * item drop with delay (timer function)

+ 2 - 2
src/map/pc.c

@@ -5575,12 +5575,12 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
 unsigned int pc_maxbaselv(struct map_session_data *sd)
 {
   	return max_level[pc_class2idx(sd->status.class_)][0];
-};
+}
 
 unsigned int pc_maxjoblv(struct map_session_data *sd)
 {
   	return max_level[pc_class2idx(sd->status.class_)][1];
-};
+}
 
 /*==========================================
  * base level‘¤•K—v??’lŒvŽZ

+ 1 - 1
src/map/pc.h

@@ -110,7 +110,7 @@ struct map_session_data {
 		unsigned int abra_flag : 2; // Abracadabra bugfix by Aru
 		unsigned int autocast : 1; // Autospell flag [Inkfish]
 		unsigned int autotrade : 1;	//By Fantik
-		unsigned int reg_dirty : 3; //By Skotlex (marks whether registry variables have been saved or not yet)
+		unsigned int reg_dirty : 4; //By Skotlex (marks whether registry variables have been saved or not yet)
 		unsigned int showdelay :1;
 		unsigned int showexp :1;
 		unsigned int showzeny :1;

+ 1 - 1
src/map/skill.c

@@ -268,7 +268,7 @@ int skill_get_casttype (int id)
 	if (skill_get_nk(id)&NK_NO_DAMAGE)
 		return CAST_NODAMAGE;
 	return CAST_DAMAGE;
-};
+}
 
 //Returns actual skill range taking into account attack range and AC_OWL [Skotlex]
 int skill_get_range2 (struct block_list *bl, int id, int lv)