Explorar o código

Fixed some addtional cppcheck warnings
int8 is not readable with scanf though

Lemongrass3110 %!s(int64=10) %!d(string=hai) anos
pai
achega
be3376f470
Modificáronse 2 ficheiros con 4 adicións e 6 borrados
  1. 2 2
      src/char/int_guild.c
  2. 2 4
      src/tool/mapcache.c

+ 2 - 2
src/char/int_guild.c

@@ -1489,12 +1489,12 @@ int mapif_parse_GuildMemberInfoChange(int fd,int guild_id,uint32 account_id,uint
 		  }
 		case GMI_EXP:
 		{	// EXP
-			uint64 exp, old_exp=g->member[i].exp;
+			uint64 old_exp=g->member[i].exp;
 			g->member[i].exp=*((uint64 *)data);
 			g->member[i].modified = GS_MEMBER_MODIFIED;
 			if (g->member[i].exp > old_exp)
 			{
-				exp = g->member[i].exp - old_exp;
+				uint64 exp = g->member[i].exp - old_exp;
 
 				// Compute gained exp
 				if (charserv_config.guild_exp_rate != 100)

+ 2 - 4
src/tool/mapcache.c

@@ -58,8 +58,6 @@ int read_map(char *name, struct map_data *m)
 	unsigned char *gat, *rsw;
 	int water_height;
 	size_t xy, off, num_cells;
-	float height;
-	uint32 type;
 
 	// Open map GAT
 	sprintf(filename,"data\\%s.gat", name);
@@ -93,9 +91,9 @@ int read_map(char *name, struct map_data *m)
 	for (xy = 0; xy < num_cells; xy++)
 	{
 		// Height of the bottom-left corner
-		height = GetFloat( gat + off      );
+		float height = GetFloat( gat + off      );
 		// Type of cell
-		type   = GetULong( gat + off + 16 );
+		uint32 type   = GetULong( gat + off + 16 );
 		off += 20;
 
 		if (type == 0 && water_height != NO_WATER && height > water_height)