From 89a6ae3fe4f01dbc34d9000fb5e1a9be3a5cd057 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 29 Dec 2010 16:28:46 +0000 Subject: [PATCH] - updated win32 vc++ files to compile with new ftp server / client --- mk/windoze/shared_lib.vcproj | 52 ++++++++++++++++++- source/glest_game/world/unit_updater.cpp | 2 +- .../shared_lib/sources/feathery_ftp/ftpCmds.c | 8 +-- .../sources/feathery_ftp/ftpTargetWin32.c | 4 +- .../platform/common/simple_threads.cpp | 2 +- .../sources/platform/posix/ircclient.cpp | 2 +- 6 files changed, 60 insertions(+), 10 deletions(-) diff --git a/mk/windoze/shared_lib.vcproj b/mk/windoze/shared_lib.vcproj index eaae0f7a2..473aa179f 100755 --- a/mk/windoze/shared_lib.vcproj +++ b/mk/windoze/shared_lib.vcproj @@ -40,7 +40,7 @@ + + + + + + + + + + + + + + + + + + @@ -256,6 +292,10 @@ RelativePath="..\..\source\win32_deps\src\glprocs.c" > + + @@ -499,6 +539,14 @@ RelativePath="..\..\source\shared_lib\sources\platform\miniupnpc\igd_desc_parse.c" > + + + + diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index f92148856..da7e4f208 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -367,7 +367,7 @@ void UnitUpdater::updateAttack(Unit *unit) { else { //compute target pos Vec2i pos; - Command *nextCommand; + //Command *nextCommand; if(command->getUnit()!=NULL) { pos= command->getUnit()->getCenteredPos(); } diff --git a/source/shared_lib/sources/feathery_ftp/ftpCmds.c b/source/shared_lib/sources/feathery_ftp/ftpCmds.c index e9332baf4..51f0dd3a6 100755 --- a/source/shared_lib/sources/feathery_ftp/ftpCmds.c +++ b/source/shared_lib/sources/feathery_ftp/ftpCmds.c @@ -263,6 +263,7 @@ LOCAL int ftpCmdAbor(int sessionId, const char* args, int len) #define MLSD 8 LOCAL int sendListing(socket_t dataSocket, int sessionId, const char* path, int format) { + int haveAnySuccessfulFiles = 0; void *dir; const char monName[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", @@ -285,10 +286,10 @@ LOCAL int sendListing(socket_t dataSocket, int sessionId, const char* path, int printf("about to read dir contents [%s]\n", path); #endif - int haveAnySuccessfulFiles = 0; + haveAnySuccessfulFiles = 0; while((dirEntry = ftpReadDir(dir)) != NULL) { - char * realPath = ftpGetRealPath(sessionId, dirEntry, FALSE); + const char * realPath = ftpGetRealPath(sessionId, dirEntry, FALSE); int statResult = ftpStat(realPath, &fileInfo); #if DBG_LOG printf("ftpGetRealPath() returned [%s] stat() = %d\n", realPath, statResult); @@ -488,12 +489,13 @@ LOCAL int ftpCmdRetr(int sessionId, const char* args, int len) const char* realPath = ftpGetRealPath(sessionId, args, TRUE); socket_t s; void *fp; + int statResult = 0; #if DBG_LOG printf("ftpCmdRetr args [%s] realPath [%s]\n", args, realPath); #endif - int statResult = ftpStat(realPath, &fileInfo); + statResult = ftpStat(realPath, &fileInfo); #if DBG_LOG printf("stat() = %d fileInfo.type = %d\n", statResult,fileInfo.type); #endif diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c index 0e6918b2b..7c7804aaf 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c @@ -322,6 +322,7 @@ socket_t ftpCreateServerSocket(void) SOCKET theServer; struct sockaddr_in serverinfo; unsigned len; + int val = 1; theServer = socket(AF_INET, SOCK_STREAM, 0); if(theServer < 0) @@ -331,8 +332,7 @@ socket_t ftpCreateServerSocket(void) serverinfo.sin_addr.s_addr = INADDR_ANY; serverinfo.sin_port = htons(21); len = sizeof(serverinfo); - - int val = 1; + #ifndef WIN32 setsockopt(theServer, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); #else diff --git a/source/shared_lib/sources/platform/common/simple_threads.cpp b/source/shared_lib/sources/platform/common/simple_threads.cpp index 41761cb8b..22afd5481 100644 --- a/source/shared_lib/sources/platform/common/simple_threads.cpp +++ b/source/shared_lib/sources/platform/common/simple_threads.cpp @@ -283,7 +283,7 @@ void LogFileThread::saveToDisk(bool forceSaveAll,bool logListAlreadyLocked) { // logCount = min(logCount,(std::size_t)2000000); //} - for(int i = 0; i < logCount; ++i) { + for(unsigned int i = 0; i < logCount; ++i) { LogFileEntry &entry = tempLogList[i]; SystemFlags::logDebugEntry(entry.type, entry.entry, entry.entryDateTime); } diff --git a/source/shared_lib/sources/platform/posix/ircclient.cpp b/source/shared_lib/sources/platform/posix/ircclient.cpp index 49c79c4f0..36bb25ded 100644 --- a/source/shared_lib/sources/platform/posix/ircclient.cpp +++ b/source/shared_lib/sources/platform/posix/ircclient.cpp @@ -397,7 +397,7 @@ std::vector IRCThread::GetIRCConnectedNickList(string target, bool waitF bool IRCThread::isConnected() { bool ret = false; if(ircSession != NULL) { - ret = irc_is_connected(ircSession); + ret = (irc_is_connected(ircSession) != 0); } return ret;