Browse Source

Fix some compilation warnings

Vadim Markovtsev 9 years ago
parent
commit
c696746017
4 changed files with 6 additions and 54 deletions
  1. 4 0
      lib/NetPacksLib.cpp
  2. 0 50
      lib/filesystem/FileStream.cpp
  3. 2 2
      lib/rmg/CMapGenerator.cpp
  4. 0 2
      lib/rmg/CZonePlacer.cpp

+ 4 - 0
lib/NetPacksLib.cpp

@@ -962,14 +962,18 @@ DLL_LINKAGE void EraseArtifact::applyGs(CGameState *gs)
 		DisassembledArtifact dis;
 		dis.al.artHolder = al.artHolder;
 		auto aset = al.getHolderArtSet();
+		#ifndef NDEBUG
 		bool found = false;
+        #endif
 		for(auto& p : aset->artifactsWorn)
 		{
 			auto art = p.second.artifact;
 			if(art->canBeDisassembled() && art->isPart(slot->artifact))
 			{
 				dis.al.slot = aset->getArtPos(art);
+				#ifndef NDEBUG
 				found = true;
+                #endif
 				break;
 			}
 		}

+ 0 - 50
lib/filesystem/FileStream.cpp

@@ -62,7 +62,6 @@ ZPOS64_T call_ztell64(const zlib_filefunc64_32_def* pfilefunc, voidpf filestream
 	}
 }
 
-static voidpf  ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));
 static uLong   ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
 static uLong   ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
 static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
@@ -70,24 +69,6 @@ static long    ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPO
 static int     ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
 static int     ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
 
-static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
-{
-	FILE* file = NULL;
-	const char* mode_fopen = NULL;
-	if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ)
-		mode_fopen = "rb";
-	else
-		if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
-			mode_fopen = "r+b";
-		else
-			if (mode & ZLIB_FILEFUNC_MODE_CREATE)
-				mode_fopen = "wb";
-
-	if ((filename != NULL) && (mode_fopen != NULL))
-		file = fopen(filename, mode_fopen);
-	return file;
-}
-
 static voidpf ZCALLBACK fopen64_file_func(voidpf opaque, const void* filename, int mode)
 {
 	FILE* file = NULL;
@@ -121,14 +102,6 @@ static uLong ZCALLBACK fwrite_file_func(voidpf opaque, voidpf stream, const void
 	return ret;
 }
 
-static long ZCALLBACK ftell_file_func(voidpf opaque, voidpf stream)
-{
-	long ret;
-	ret = ftell((FILE *)stream);
-	return ret;
-}
-
-
 static ZPOS64_T ZCALLBACK ftell64_file_func(voidpf opaque, voidpf stream)
 {
 	ZPOS64_T ret;
@@ -136,29 +109,6 @@ static ZPOS64_T ZCALLBACK ftell64_file_func(voidpf opaque, voidpf stream)
 	return ret;
 }
 
-static long ZCALLBACK fseek_file_func(voidpf  opaque, voidpf stream, uLong offset, int origin)
-{
-	int fseek_origin = 0;
-	long ret;
-	switch (origin)
-	{
-	case ZLIB_FILEFUNC_SEEK_CUR:
-		fseek_origin = SEEK_CUR;
-		break;
-	case ZLIB_FILEFUNC_SEEK_END:
-		fseek_origin = SEEK_END;
-		break;
-	case ZLIB_FILEFUNC_SEEK_SET:
-		fseek_origin = SEEK_SET;
-		break;
-	default: return -1;
-	}
-	ret = 0;
-	if (fseek((FILE *)stream, offset, fseek_origin) != 0)
-		ret = -1;
-	return ret;
-}
-
 static long ZCALLBACK fseek64_file_func(voidpf  opaque, voidpf stream, ZPOS64_T offset, int origin)
 {
 	int fseek_origin = 0;

+ 2 - 2
lib/rmg/CMapGenerator.cpp

@@ -479,7 +479,7 @@ void CMapGenerator::createDirectConnections()
 
 		int3 posA = zoneA->getPos();
 		int3 posB = zoneB->getPos();
-		auto zoneAid = zoneA->getId();
+		// auto zoneAid = zoneA->getId();
 		auto zoneBid = zoneB->getId();
 
 		if (posA.z == posB.z)
@@ -630,7 +630,7 @@ void CMapGenerator::createConnections2()
 								else if ((result1 == EObjectPlacingResult::SEALED_OFF) || (result2 == EObjectPlacingResult::SEALED_OFF))
 								{
 									//sealed-off tiles were blocked, exit inner loop and get another tile set
-									bool continueOuterLoop = true;
+									continueOuterLoop = true;
 									break;
 								}
 								else

+ 0 - 2
lib/rmg/CZonePlacer.cpp

@@ -154,8 +154,6 @@ void CZonePlacer::placeZones(const CMapGenOptions * mapGenOptions, CRandomGenera
 
 void CZonePlacer::prepareZones(TZoneMap &zones, TZoneVector &zonesVector, const bool underground, CRandomGenerator * rand)
 {	
-	TRmgTemplateZoneId firstZone = zones.begin()->first; //we want lowest ID here
-
 	std::vector<float> totalSize = { 0, 0 }; //make sure that sum of zone sizes on surface and uderground match size of the map
 
 	const float radius = 0.4f;