Jelajahi Sumber

Resolves compile warnings (#4652)

* Fixes #4649.
* Resolves some compile warnings for the mapcache and csv2yaml tools.
Thanks to @reigneil!
Aleos 5 tahun lalu
induk
melakukan
04a83ec774
2 mengubah file dengan 5 tambahan dan 5 penghapusan
  1. 4 4
      src/tool/csv2yaml.cpp
  2. 1 1
      src/tool/mapcache.cpp

+ 4 - 4
src/tool/csv2yaml.cpp

@@ -85,7 +85,7 @@ std::unordered_map<uint16, s_skill_db> skill_nearnpc;
 
 // Forward declaration of conversion functions
 static bool guild_read_guildskill_tree_db( char* split[], int columns, int current );
-static size_t pet_read_db( const char* file );
+static bool pet_read_db( const char* file );
 static bool skill_parse_row_magicmushroomdb(char* split[], int column, int current);
 static bool skill_parse_row_abradb(char* split[], int columns, int current);
 static bool skill_parse_row_improvisedb(char* split[], int columns, int current);
@@ -677,12 +677,12 @@ static bool guild_read_guildskill_tree_db( char* split[], int columns, int curre
 }
 
 // Copied and adjusted from pet.cpp
-static size_t pet_read_db( const char* file ){
+static bool pet_read_db( const char* file ){
 	FILE* fp = fopen( file, "r" );
 
 	if( fp == nullptr ){
 		ShowError( "can't read %s\n", file );
-		return 0;
+		return false;
 	}
 
 	int lines = 0;
@@ -851,7 +851,7 @@ static size_t pet_read_db( const char* file ){
 	fclose(fp);
 	ShowStatus("Done reading '" CL_WHITE "%d" CL_RESET "' pets in '" CL_WHITE "%s" CL_RESET "'.\n", entries, file );
 
-	return entries;
+	return true;
 }
 
 // Copied and adjusted from skill.cpp

+ 1 - 1
src/tool/mapcache.cpp

@@ -52,7 +52,7 @@ struct map_info {
 int read_map(char *name, struct map_data *m)
 {
 	char filename[256];
-	unsigned char *gat, *rsw;
+	unsigned char *gat;
 	int water_height;
 	size_t xy, off, num_cells;