From 5a2668b326471874ca69357af831cdcf1575c621 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 30 Mar 2006 13:49:56 -0500 Subject: ENH: add support for win64 for visual studio 2005 ide and nmake, also fix warnings produced by building for win64 --- Modules/Platform/Windows-cl.cmake | 33 +++++++++++++++- Modules/Platform/Windows-cl.cmake.in | 1 + Source/CMakeLists.txt | 2 + Source/CTest/cmCTestHandlerCommand.cxx | 2 +- Source/CTest/cmCTestMemCheckHandler.cxx | 6 +-- Source/CTest/cmCTestSubmitHandler.cxx | 2 +- Source/cmCommandArgumentParserHelper.cxx | 4 +- Source/cmDependsJavaParserHelper.cxx | 4 +- Source/cmExecuteProcessCommand.cxx | 2 +- Source/cmGlobalGenerator.cxx | 4 +- Source/cmGlobalVisualStudio8Generator.cxx | 10 +++-- Source/cmGlobalVisualStudio8Generator.h | 1 + Source/cmGlobalVisualStudio8Win64Generator.cxx | 53 ++++++++++++++++++++++++++ Source/cmGlobalVisualStudio8Win64Generator.h | 52 +++++++++++++++++++++++++ Source/cmIfCommand.cxx | 2 +- Source/cmListCommand.cxx | 18 ++++----- Source/cmLocalVisualStudio7Generator.cxx | 9 +++-- Source/cmLocalVisualStudio7Generator.h | 2 + Source/cmXMLParser.cxx | 4 +- Source/cmake.cxx | 3 ++ Source/kwsys/CommandLineArguments.cxx | 4 +- Source/kwsys/Glob.cxx | 4 +- Source/kwsys/ProcessWin32.c | 2 +- Source/kwsys/Registry.cxx | 6 +-- Source/kwsys/SystemTools.cxx | 6 +-- Source/kwsys/hashtable.hxx.in | 2 +- Source/kwsys/testDynamicLoader.cxx | 3 ++ Utilities/cmcurl/CMakeLists.txt | 10 ++++- Utilities/cmcurl/getdate.c | 4 +- Utilities/cmcurl/inet_pton.c | 4 +- Utilities/cmcurl/md5.c | 2 +- Utilities/cmcurl/mprintf.c | 4 +- Utilities/cmtar/CMakeLists.txt | 10 ++++- Utilities/cmtar/append.c | 6 +-- Utilities/cmtar/block.c | 8 ++-- Utilities/cmtar/compat/snprintf.c | 10 ++--- Utilities/cmtar/extract.c | 6 +-- Utilities/cmtar/handle.c | 4 +- Utilities/cmtar/output.c | 2 +- Utilities/cmxmlrpc/xmlrpc_array.c | 6 +-- Utilities/cmxmlrpc/xmlrpc_client.c | 4 +- Utilities/cmxmlrpc/xmlrpc_data.c | 16 ++++---- Utilities/cmxmlrpc/xmlrpc_expat.c | 2 +- Utilities/cmxmlrpc/xmlrpc_parse.c | 12 +++--- Utilities/cmxmlrpc/xmlrpc_registry.c | 8 ++-- Utilities/cmxmlrpc/xmlrpc_serialize.c | 6 +-- Utilities/cmxmlrpc/xmlrpc_struct.c | 4 +- Utilities/cmxmlrpc/xmlrpc_strutil.c | 2 +- Utilities/cmxmlrpc/xmlrpc_support.c | 2 +- 49 files changed, 270 insertions(+), 103 deletions(-) create mode 100644 Source/cmGlobalVisualStudio8Win64Generator.cxx create mode 100644 Source/cmGlobalVisualStudio8Win64Generator.h diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 39fea0d..c004b2f 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -140,9 +140,36 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles") MESSAGE(STATUS "Check if this is a free VC compiler - no") SET(CMAKE_USING_VC_FREE_TOOLS 0) ENDIF(CMAKE_COMPILER_RETURN) + MAKE_DIRECTORY("${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp3") + MESSAGE(STATUS "Check for CL win64") + EXEC_PROGRAM(${CMAKE_C_COMPILER} ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp3 + ARGS /nologo /link /machine:i386 + \"${testForFreeVCFile}\" + OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT + RETURN_VALUE CMAKE_COMPILER_RETURN + ) + # if there was an error assume it is a 64bit system + IF(CMAKE_COMPILER_RETURN) + FILE(APPEND + ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + "Determining if this is a 64 bit system passed:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + MESSAGE(STATUS "Check if this is a 64 bit system - yes") + SET(CMAKE_CL_64 1) + ELSE(CMAKE_COMPILER_RETURN) + FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + "Determining if this is a 32 bit system passed:\n" + "${CMAKE_COMPILER_OUTPUT}\n\n") + MESSAGE(STATUS "Check if this is 32 bit system - yes") + SET(CMAKE_CL_64 0) + ENDIF(CMAKE_COMPILER_RETURN) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) ENDIF(CMAKE_GENERATOR MATCHES "NMake Makefiles") +IF(CMAKE_FORCE_WIN64) + SET(CMAKE_CL_64 1) +ENDIF(CMAKE_FORCE_WIN64) + # default to Debug builds IF(CMAKE_COMPILER_2005) @@ -213,7 +240,11 @@ MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386 /INCREMENTAL:YES") +IF(CMAKE_CL_64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:x64 /INCREMENTAL:YES") +ELSE(CMAKE_CL_64) + SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386 /INCREMENTAL:YES") +ENDIF(CMAKE_CL_64) IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept") SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept") diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in index 7c42a54..2e01327 100644 --- a/Modules/Platform/Windows-cl.cmake.in +++ b/Modules/Platform/Windows-cl.cmake.in @@ -2,3 +2,4 @@ SET(CMAKE_VC_COMPILER_TESTS_RUN 1) SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@) SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@) SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@) +SET(CMAKE_CL_64 @CMAKE_CL_64@) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 10921ca..077872b 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -198,6 +198,8 @@ IF (WIN32) cmGlobalVisualStudio7Generator.h cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio8Generator.h + cmGlobalVisualStudio8Win64Generator.cxx + cmGlobalVisualStudio8Win64Generator.h cmGlobalWatcomWMakeGenerator.cxx cmLocalVisualStudio6Generator.cxx cmLocalVisualStudio6Generator.h diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 25662cb..89420bf 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -38,7 +38,7 @@ cmCTestHandlerCommand::cmCTestHandlerCommand() bool cmCTestHandlerCommand::InitialPass( std::vector const& args) { - if ( !this->ProcessArguments(args, this->Last, &*this->Arguments.begin(), + if ( !this->ProcessArguments(args, (unsigned int)this->Last, &*this->Arguments.begin(), this->Values) ) { return false; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 51954ba..e9b6c09 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -211,9 +211,9 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os) os << "\t\n"; cmCTestLog(this->CTest, HANDLER_OUTPUT, "-- Processing memory checking output: "); - unsigned int total = this->TestResults.size(); - unsigned int step = total / 10; - unsigned int current = 0; + size_t total = this->TestResults.size(); + size_t step = total / 10; + size_t current = 0; for ( cc = 0; cc < this->TestResults.size(); cc ++ ) { cmCTestTestResult *result = &this->TestResults[cc]; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 2524f16..8d5effa 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -39,7 +39,7 @@ static size_t cmCTestSubmitHandlerWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) { - register int realsize = size * nmemb; + register int realsize = (int)(size * nmemb); cmCTestSubmitHandlerVectorOfChar *vec = static_cast(data); diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 31c4bc0..f24cab6 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -119,7 +119,7 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2) { return in1; } - int len = strlen(in1) + strlen(in2) + 1; + size_t len = strlen(in1) + strlen(in2) + 1; char* out = new char [ len ]; strcpy(out, in1); strcat(out, in2); @@ -133,7 +133,7 @@ void cmCommandArgumentParserHelper::AllocateParserType(cmCommandArgumentParserHe pt->str = 0; if ( len == 0 ) { - len = strlen(str); + len = (int)strlen(str); } if ( len == 0 ) { diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index f0fc0b5..b9d0775 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -143,7 +143,7 @@ void cmDependsJavaParserHelper::Print(const char* place, const char* str) void cmDependsJavaParserHelper::CombineUnions(char** out, const char* in1, char** in2, const char* sep) { - int len = 1; + size_t len = 1; if ( in1 ) { len += strlen(in1); @@ -202,7 +202,7 @@ void cmDependsJavaParserHelper::AllocateParserType(cmDependsJavaParserHelper::Pa pt->str = 0; if ( len == 0 ) { - len = strlen(str); + len = (int)strlen(str); } if ( len == 0 ) { diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 4090529..fec9070 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -32,7 +32,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector const& args) std::vector< std::vector > cmds; std::string arguments; bool doing_command = false; - unsigned int command_index = 0; + size_t command_index = 0; bool output_quiet = false; bool error_quiet = false; std::string timeout_string; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 7f2ba80..b8ae64b 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1207,8 +1207,8 @@ void cmGlobalGenerator::SetupTests() } // Add run_test only if any tests are foun - long total_tests = 0; - unsigned int i; + size_t total_tests = 0; + size_t i; for (i = 0; i < this->LocalGenerators.size(); ++i) { total_tests += this->LocalGenerators[i]->GetMakefile()->GetTests()->size(); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index cbc7822..969999d 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -26,6 +26,7 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() { this->FindMakeProgramFile = "CMakeVS8FindMake.cmake"; this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->PlatformName = "Win32"; } @@ -206,7 +207,8 @@ cmGlobalVisualStudio8Generator for(std::vector::iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { - fout << "\t\t" << *i << "|Win32 = " << *i << "|Win32\n"; + fout << "\t\t" << *i << "|" << this->PlatformName << " = " << *i << "|" + << this->PlatformName << "\n"; } fout << "\tEndGlobalSection\n"; } @@ -221,10 +223,12 @@ cmGlobalVisualStudio8Generator for(std::vector::iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { - fout << "\t\t{" << guid << "}." << *i << "|Win32.ActiveCfg = " << *i << "|Win32\n"; + fout << "\t\t{" << guid << "}." << *i << "|" << this->PlatformName << ".ActiveCfg = " + << *i << "|" << this->PlatformName << "\n"; if (in_all_build) { - fout << "\t\t{" << guid << "}." << *i << "|Win32.Build.0 = " << *i << "|Win32\n"; + fout << "\t\t{" << guid << "}." << *i << "|" << this->PlatformName << ".Build.0 = " + << *i << "|" << this->PlatformName << "\n"; } } } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 8542b6f..c4992e0 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -55,5 +55,6 @@ protected: virtual void WriteSolutionConfigurations(std::ostream& fout); virtual void WriteProjectConfigurations(std::ostream& fout, const char* name, bool in_all); + std::string PlatformName; // Win32 or x64 }; #endif diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx new file mode 100644 index 0000000..5408a0c --- /dev/null +++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx @@ -0,0 +1,53 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8Win64Generator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + + + +cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator() +{ + this->PlatformName = "x64"; +} + +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio8Win64Generator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetVersion8(); + lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetGlobalGenerator(this); + return lg; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8Win64Generator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates Visual Studio .NET 2005 Win64 project files."; + entry.full = ""; +} + +void cmGlobalVisualStudio8Win64Generator::EnableLanguage(std::vectorconst & lang, + cmMakefile *mf) +{ + mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); + cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf); +} diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h new file mode 100644 index 0000000..dda7f18 --- /dev/null +++ b/Source/cmGlobalVisualStudio8Win64Generator.h @@ -0,0 +1,52 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio8Win64Generator_h +#define cmGlobalVisualStudio8Win64Generator_h + +#include "cmGlobalVisualStudio8Generator.h" + + +/** \class cmGlobalVisualStudio8Win64Generator + * \brief Write a Unix makefiles. + * + * cmGlobalVisualStudio8Win64Generator manages UNIX build process for a tree + */ +class cmGlobalVisualStudio8Win64Generator : public cmGlobalVisualStudio8Generator +{ +public: + cmGlobalVisualStudio8Win64Generator(); + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio8Win64Generator; } + + ///! Get the name for the generator. + virtual const char* GetName() const { + return cmGlobalVisualStudio8Win64Generator::GetActualName();} + static const char* GetActualName() {return "Visual Studio 8 2005 Win64";} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! create the correct local generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /** + * Try to determine system infomation such as shared library + * extension, pthreads, byte order etc. + */ + virtual void EnableLanguage(std::vectorconst& languages, + cmMakefile *); +}; +#endif diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index bd608f8..b611796 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -278,7 +278,7 @@ bool cmIfCommand::IsTrue(const std::vector &args, // is a variable defined if (*arg == "DEFINED" && argP1 != newArgs.end()) { - unsigned int argP1len = argP1->size(); + size_t argP1len = argP1->size(); if(argP1len > 4 && argP1->substr(0, 4) == "ENV{" && argP1->operator[](argP1len-1) == '}') { diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index a41b5e8..398c63e 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -145,12 +145,12 @@ bool cmListCommand::HandleGetCommand(std::vector const& args) { value += ";"; } - int nitem = varArgsExpanded.size(); + size_t nitem = varArgsExpanded.size(); if ( item < 0 ) { - item = nitem + item; + item = (int)nitem + item; } - if ( item < 0 || nitem <= item ) + if ( item < 0 || nitem <= (size_t)item ) { cmOStringStream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; @@ -213,12 +213,12 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) int item = atoi(args[2].c_str()); - int nitem = varArgsExpanded.size(); + size_t nitem = varArgsExpanded.size(); if ( item < 0 ) { - item = nitem + item; + item = (int)nitem + item; } - if ( item < 0 || nitem <= item ) + if ( item < 0 || nitem <= (size_t)item ) { cmOStringStream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; @@ -314,12 +314,12 @@ bool cmListCommand::HandleRemoveItemCommand(std::vector const& args for ( cc = 2; cc < args.size(); ++ cc ) { int item = atoi(args[cc].c_str()); - int nitem = varArgsExpanded.size(); + size_t nitem = varArgsExpanded.size(); if ( item < 0 ) { - item = nitem + item; + item = (int)nitem + item; } - if ( item < 0 || nitem <= item ) + if ( item < 0 || nitem <= (size_t)item ) { cmOStringStream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 446f884..38b9700 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -25,6 +25,7 @@ cmLocalVisualStudio7Generator::cmLocalVisualStudio7Generator() { this->Version = 7; + this->PlatformName = "Win32"; } cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator() @@ -343,7 +344,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, mfcFlag = "0"; } fout << "\t\tPlatformName << "\"\n" << "\t\t\tOutputDirectory=\"" << configName << "\"\n"; // This is an internal type to Visual Studio, it seems that: // 4 == static library @@ -1043,7 +1044,7 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget i != configs->end(); ++i) { fout << "\t\t\t\t\n" + << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n" << "\t\t\t\t\tbegin(); i != configs->end(); ++i) { fout << "\t\t\t\t\n"; + fout << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n"; if(compileFlags) { fout << "\t\t\t\t\t\n" << "\t\n" - << "\t\t\n" + << "\t\tPlatformName << "\"/>\n" << "\t\n"; } diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index fadf7e7..387762b 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -62,6 +62,7 @@ public: } void SetVersion71() {this->Version = 71;} void SetVersion8() {this->Version = 8;} + void SetPlatformName(const char* n) { this->PlatformName = n;} virtual void ConfigureFinalPass(); private: void FillFlagMapFromCommandFlags(std::map& flagMap, @@ -119,6 +120,7 @@ private: std::string ExecutableOutputPath; std::string ModuleDefinitionFile; int Version; + std::string PlatformName; // Win32 or x64 }; #endif diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index bc3ed6c..58f3656 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -38,8 +38,8 @@ cmXMLParser::~cmXMLParser() //---------------------------------------------------------------------------- int cmXMLParser::Parse(const char* string) { - return this->InitializeParser() && - this->ParseChunk(string, strlen(string)) && + return (int)this->InitializeParser() && + this->ParseChunk(string, (unsigned int)strlen(string)) && this->CleanupParser(); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7ed09a9..1a0cfdc 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -49,6 +49,7 @@ # include "cmGlobalVisualStudio7Generator.h" # include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio8Generator.h" +# include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" # include "cmGlobalWatcomWMakeGenerator.h" @@ -1675,6 +1676,8 @@ void cmake::AddDefaultGenerators() &cmGlobalVisualStudio71Generator::New; this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = &cmGlobalVisualStudio8Generator::New; + this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = + &cmGlobalVisualStudio8Win64Generator::New; this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = &cmGlobalBorlandMakefileGenerator::New; this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx index b84c9b7..b1ee992 100644 --- a/Source/kwsys/CommandLineArguments.cxx +++ b/Source/kwsys/CommandLineArguments.cxx @@ -513,7 +513,7 @@ const char* CommandLineArguments::GetArgv0() //---------------------------------------------------------------------------- unsigned int CommandLineArguments::GetLastArgument() { - return this->Internals->LastArgument + 1; + return (unsigned int)this->Internals->LastArgument + 1; } //---------------------------------------------------------------------------- @@ -620,7 +620,7 @@ void CommandLineArguments::GenerateHelp() str << buffer; } const char* ptr = this->Internals->Callbacks[mpit->first].Help; - int len = strlen(ptr); + size_t len = strlen(ptr); int cnt = 0; while ( len > 0) { diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index b6765dd..f395126 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -338,7 +338,7 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr) { if ( cc > 0 && expr[cc] == '/' && expr[cc-1] != '\\' ) { - last_slash = cc; + last_slash = (int)cc; } if ( cc > 0 && (expr[cc] == '[' || expr[cc] == '?' || expr[cc] == '*') && @@ -371,7 +371,7 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr) } } } - skip = cc + 1; + skip = int(cc + 1); } else #endif diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index c368d27..97e5706 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -2141,7 +2141,7 @@ void kwsysProcessCleanup(kwsysProcess* cp, int error) void kwsysProcessCleanErrorMessage(kwsysProcess* cp) { /* Remove trailing period and newline, if any. */ - int length = strlen(cp->ErrorMessage); + size_t length = strlen(cp->ErrorMessage); if(cp->ErrorMessage[length-1] == '\n') { cp->ErrorMessage[length-1] = 0; diff --git a/Source/kwsys/Registry.cxx b/Source/kwsys/Registry.cxx index 43f69a6..b09898a 100644 --- a/Source/kwsys/Registry.cxx +++ b/Source/kwsys/Registry.cxx @@ -705,7 +705,7 @@ void RegistryHelper::SetSubKey(const char* sk) char *RegistryHelper::Strip(char *str) { int cc; - int len; + size_t len; char *nstr; if ( !str ) { @@ -713,7 +713,7 @@ char *RegistryHelper::Strip(char *str) } len = strlen(str); nstr = str; - for( cc=0; cc=0; cc-- ) + for( cc=int(strlen(nstr)-1); cc>=0; cc-- ) { if ( !isspace( nstr[cc] ) ) { diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 19c55a2..0e77dbe 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1166,7 +1166,7 @@ int SystemTools::EstimateFormatLength(const char *format, va_list ap) // Start with the length of the format string itself. - int length = strlen(format); + size_t length = strlen(format); // Increase the length for every argument in the format. @@ -1219,7 +1219,7 @@ int SystemTools::EstimateFormatLength(const char *format, va_list ap) } } - return length; + return (int)length; } kwsys_stl::string SystemTools::EscapeChars( @@ -2581,7 +2581,7 @@ int OldWindowsGetLongPath(kwsys_stl::string const& shortPath, { longPath = shortPath; } - return longPath.size(); + return (int)longPath.size(); } diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in index ce5c7dd..889fe15 100644 --- a/Source/kwsys/hashtable.hxx.in +++ b/Source/kwsys/hashtable.hxx.in @@ -392,7 +392,7 @@ static const unsigned long _stl_prime_list[_stl_num_primes] = 1610612741ul, 3221225473ul, 4294967291ul }; -inline unsigned long _stl_next_prime(unsigned long __n) +inline size_t _stl_next_prime(size_t __n) { const unsigned long* __first = _stl_prime_list; const unsigned long* __last = _stl_prime_list + (int)_stl_num_primes; diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx index 444f6d9..bd4fc22 100644 --- a/Source/kwsys/testDynamicLoader.cxx +++ b/Source/kwsys/testDynamicLoader.cxx @@ -86,6 +86,9 @@ int TestDynamicLoader(const char* libname, const char* symbol, int r1, int r2, i int main(int argc, char *argv[]) { +#if defined(_WIN32) + SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); +#endif int res; if( argc == 3 ) { diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index b615242..6cec671 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -255,10 +255,18 @@ CHECK_INCLUDE_FILE_CONCAT("sys/utsname.h" HAVE_SYS_UTSNAME_H) CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T) CHECK_TYPE_SIZE(ssize_t SIZEOF_SSIZE_T) CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) +CHECK_TYPE_SIZE("long" SIZEOF_LONG) +CHECK_TYPE_SIZE("__int64" SIZEOF___INT64) CHECK_TYPE_SIZE("long double" SIZEOF_LONG_DOUBLE) IF(NOT HAVE_SIZEOF_SSIZE_T) - SET(ssize_t int) + IF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T) + SET(ssize_t long) + ENDIF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T) + IF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T) + SET(ssize_t __int64) + ENDIF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T) ENDIF(NOT HAVE_SIZEOF_SSIZE_T) + IF(HAVE_SIZEOF_LONG_LONG) SET(HAVE_LONGLONG 1) ENDIF(HAVE_SIZEOF_LONG_LONG) diff --git a/Utilities/cmcurl/getdate.c b/Utilities/cmcurl/getdate.c index 6aca48e..2b97cf8 100644 --- a/Utilities/cmcurl/getdate.c +++ b/Utilities/cmcurl/getdate.c @@ -1105,7 +1105,7 @@ int yynerrs; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = (YYSIZE_T)(yyssp - yyss + 1); #ifdef yyoverflow { @@ -1281,7 +1281,7 @@ yyreduce: break; case 5: -#line 251 "getdate.y" + //#line 251 "getdate.y" { context->yyHaveZone++; } diff --git a/Utilities/cmcurl/inet_pton.c b/Utilities/cmcurl/inet_pton.c index 5e8e9b3..ed74c26 100644 --- a/Utilities/cmcurl/inet_pton.c +++ b/Utilities/cmcurl/inet_pton.c @@ -113,11 +113,11 @@ inet_pton4(const char *src, unsigned char *dst) const char *pch; if ((pch = strchr(digits, ch)) != NULL) { - u_int new = *tp * 10 + (pch - digits); + size_t new = *tp * 10 + (pch - digits); if (new > 255) return (0); - *tp = new; + *tp = (unsigned char)new; if (! saw_digit) { if (++octets > 4) return (0); diff --git a/Utilities/cmcurl/md5.c b/Utilities/cmcurl/md5.c index 269726b..a70b344 100644 --- a/Utilities/cmcurl/md5.c +++ b/Utilities/cmcurl/md5.c @@ -343,6 +343,6 @@ void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */ { MD5_CTX ctx; MD5_Init(&ctx); - MD5_Update(&ctx, input, strlen((char *)input)); + MD5_Update(&ctx, input, (unsigned int)strlen((char *)input)); MD5_Final(outbuffer, &ctx); } diff --git a/Utilities/cmcurl/mprintf.c b/Utilities/cmcurl/mprintf.c index 569207a..12d1208 100644 --- a/Utilities/cmcurl/mprintf.c +++ b/Utilities/cmcurl/mprintf.c @@ -619,10 +619,10 @@ static int dprintf_formatf( char alt; /* Width of a field. */ - long width; + ssize_t width; /* Precision of a field. */ - long prec; + ssize_t prec; /* Decimal integer is negative. */ char is_neg; diff --git a/Utilities/cmtar/CMakeLists.txt b/Utilities/cmtar/CMakeLists.txt index 038c38c..3ef4100 100644 --- a/Utilities/cmtar/CMakeLists.txt +++ b/Utilities/cmtar/CMakeLists.txt @@ -169,7 +169,6 @@ ELSE(HAVE_SIZEOF_OFF_T) SET (HAVE_OFF_T 0) SET (off_t "long") ENDIF(HAVE_SIZEOF_OFF_T) - CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T) IF(HAVE_SIZEOF_SIZE_T) SET (HAVE_SIZE_T 1) @@ -183,7 +182,14 @@ IF(HAVE_SIZEOF_SSIZE_T) SET (HAVE_SSIZE_T 1) ELSE(HAVE_SIZEOF_SSIZE_T) SET (HAVE_SSIZE_T 0) - SET (ssize_t "int") + CHECK_TYPE_SIZE("long" SIZEOF_LONG) + CHECK_TYPE_SIZE("__int64" SIZEOF___INT64) + IF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T) + SET(ssize_t "long") + ENDIF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T) + IF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T) + SET(ssize_t "__int64") + ENDIF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T) ENDIF(HAVE_SIZEOF_SSIZE_T) CHECK_TYPE_SIZE("uid_t" SIZEOF_UID_T) diff --git a/Utilities/cmtar/append.c b/Utilities/cmtar/append.c index cc845ab..7cee558 100644 --- a/Utilities/cmtar/append.c +++ b/Utilities/cmtar/append.c @@ -217,7 +217,7 @@ tar_append_file(TAR *t, char *realname, char *savename) int tar_append_eof(TAR *t) { - int i, j; + ssize_t i, j; char block[T_BLOCKSIZE]; memset(&block, 0, T_BLOCKSIZE); @@ -242,7 +242,7 @@ tar_append_regfile(TAR *t, char *realname) { char block[T_BLOCKSIZE]; int filefd; - int i, j; + ssize_t i, j; size_t size; #if defined( _WIN32 ) || defined(__CYGWIN__) @@ -278,7 +278,7 @@ tar_append_regfile(TAR *t, char *realname) if (i > 0) { - j = read(filefd, &block, i); + j = (size_t)read(filefd, &block, (unsigned int)i); if (j == -1) return -1; memset(&(block[i]), 0, T_BLOCKSIZE - i); diff --git a/Utilities/cmtar/block.c b/Utilities/cmtar/block.c index f47f7ba..e618d79 100644 --- a/Utilities/cmtar/block.c +++ b/Utilities/cmtar/block.c @@ -27,7 +27,7 @@ int th_read_internal(TAR *t) { - int i; + ssize_t i; int num_zero_blocks = 0; #ifdef DEBUG @@ -82,7 +82,7 @@ th_read_internal(TAR *t) #ifdef DEBUG printf("<== th_read_internal(): returning %d\n", i); #endif - return i; + return (int)i; } @@ -90,7 +90,7 @@ th_read_internal(TAR *t) int th_read(TAR *t) { - int i, j; + ssize_t i, j; size_t sz; char *ptr; @@ -247,7 +247,7 @@ th_read(TAR *t) int th_write(TAR *t) { - int i, j; + ssize_t i, j; char type2; size_t sz, sz2; char *ptr; diff --git a/Utilities/cmtar/compat/snprintf.c b/Utilities/cmtar/compat/snprintf.c index 26a203e..ef6e2f1 100644 --- a/Utilities/cmtar/compat/snprintf.c +++ b/Utilities/cmtar/compat/snprintf.c @@ -316,7 +316,7 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args) case 's': strvalue = va_arg (args, char *); if (max < 0) - max = maxlen; /* ie, no max */ + max = (int)maxlen; /* ie, no max */ fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); break; case 'p': @@ -328,19 +328,19 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args) { short int *num; num = va_arg (args, short int *); - *num = currlen; + *num = (int)currlen; } else if (cflags == DP_C_LONG) { long int *num; num = va_arg (args, long int *); - *num = currlen; + *num = (int)currlen; } else { int *num; num = va_arg (args, int *); - *num = currlen; + *num = (int)currlen; } break; case '%': @@ -713,7 +713,7 @@ int mutt_snprintf (va_alist) va_dcl (void) mutt_vsnprintf(str, count, fmt, ap); #endif VA_END; - return(strlen(str)); + return((int)strlen(str)); } #ifdef TEST_SNPRINTF diff --git a/Utilities/cmtar/extract.c b/Utilities/cmtar/extract.c index 6d37659..3ebdeeb 100644 --- a/Utilities/cmtar/extract.c +++ b/Utilities/cmtar/extract.c @@ -224,7 +224,7 @@ tar_extract_regfile(TAR *t, char *realname) uid_t uid; gid_t gid; int fdout; - int i, k; + ssize_t i, k; char buf[T_BLOCKSIZE]; char *filename; char *pathname = 0; @@ -334,7 +334,7 @@ tar_extract_regfile(TAR *t, char *realname) /* write block to output file */ if (write(fdout, buf, - ((i > T_BLOCKSIZE) ? T_BLOCKSIZE : i)) == -1) + ((i > T_BLOCKSIZE) ? T_BLOCKSIZE : (unsigned int)i)) == -1) { if (pathname) { @@ -375,7 +375,7 @@ tar_extract_regfile(TAR *t, char *realname) int tar_skip_regfile(TAR *t) { - int i, k; + ssize_t i, k; size_t size; char buf[T_BLOCKSIZE]; diff --git a/Utilities/cmtar/handle.c b/Utilities/cmtar/handle.c index de324cb..4f6dd10 100644 --- a/Utilities/cmtar/handle.c +++ b/Utilities/cmtar/handle.c @@ -56,12 +56,12 @@ static int libtar_close(void* call_data) static ssize_t libtar_read(void* call_data, void* buf, size_t count) { struct libtar_fd_file* lf = (struct libtar_fd_file*)call_data; - return read(lf->fd, buf, count); + return (ssize_t)read(lf->fd, buf, (unsigned int)count); } static ssize_t libtar_write(void* call_data, const void* buf, size_t count) { struct libtar_fd_file* lf = (struct libtar_fd_file*)call_data; - return write(lf->fd, buf, count); + return (ssize_t) write(lf->fd, buf, (unsigned int)count); } static tartype_t default_type = { libtar_open, libtar_close, libtar_read, libtar_write, &libtar_fd_file_pointer }; diff --git a/Utilities/cmtar/output.c b/Utilities/cmtar/output.c index 56e5a74..283c594 100644 --- a/Utilities/cmtar/output.c +++ b/Utilities/cmtar/output.c @@ -118,7 +118,7 @@ th_print_long_ls(TAR *t) mtime = th_get_mtime(t); mtm = localtime(&mtime); #ifdef HAVE_STRFTIME - strftime(timebuf, sizeof(timebuf), "%h %e %H:%M %Y", mtm); + strftime(timebuf, sizeof(timebuf), "%b %d %H:%M %Y", mtm); printf("%s", timebuf); #else printf("%.3s %2d %2d:%02d %4d", diff --git a/Utilities/cmxmlrpc/xmlrpc_array.c b/Utilities/cmxmlrpc/xmlrpc_array.c index 31576f0..36010c6 100644 --- a/Utilities/cmxmlrpc/xmlrpc_array.c +++ b/Utilities/cmxmlrpc/xmlrpc_array.c @@ -22,7 +22,7 @@ xmlrpc_abort_if_array_bad(xmlrpc_value * const arrayP) { else if (arrayP->_type != XMLRPC_TYPE_ARRAY) abort(); else { - unsigned int const arraySize = + size_t const arraySize = XMLRPC_MEMBLOCK_SIZE(xmlrpc_value*, &arrayP->_block); xmlrpc_value ** const contents = XMLRPC_MEMBLOCK_CONTENTS(xmlrpc_value*, &arrayP->_block); @@ -51,7 +51,7 @@ xmlrpc_destroyArrayContents(xmlrpc_value * const arrayP) { Dispose of the contents of an array (but not the array value itself). The value is not valid after this. -----------------------------------------------------------------------------*/ - unsigned int const arraySize = + size_t const arraySize = XMLRPC_MEMBLOCK_SIZE(xmlrpc_value*, &arrayP->_block); xmlrpc_value ** const contents = XMLRPC_MEMBLOCK_CONTENTS(xmlrpc_value*, &arrayP->_block); @@ -83,7 +83,7 @@ xmlrpc_array_size(xmlrpc_env * const env, XMLRPC_ASSERT_VALUE_OK(array); XMLRPC_TYPE_CHECK(env, array, XMLRPC_TYPE_ARRAY); - retval = XMLRPC_TYPED_MEM_BLOCK_SIZE(xmlrpc_value*, &array->_block); + retval = (int)XMLRPC_TYPED_MEM_BLOCK_SIZE(xmlrpc_value*, &array->_block); cleanup: if (env->fault_occurred) diff --git a/Utilities/cmxmlrpc/xmlrpc_client.c b/Utilities/cmxmlrpc/xmlrpc_client.c index 329b160..a5ad65c 100644 --- a/Utilities/cmxmlrpc/xmlrpc_client.c +++ b/Utilities/cmxmlrpc/xmlrpc_client.c @@ -269,7 +269,7 @@ call_info_new(xmlrpc_env * const envP, if (!envP->fault_occurred) { xmlrpc_traceXml("XML-RPC CALL", XMLRPC_MEMBLOCK_CONTENTS(char, callXmlP), - XMLRPC_MEMBLOCK_SIZE(char, callXmlP)); + (unsigned int)XMLRPC_MEMBLOCK_SIZE(char, callXmlP)); callInfoP->serialized_xml = callXmlP; @@ -312,7 +312,7 @@ clientCallServerParams(xmlrpc_env * const envP, if (!envP->fault_occurred) { xmlrpc_traceXml("XML-RPC RESPONSE", XMLRPC_MEMBLOCK_CONTENTS(char, respXmlP), - XMLRPC_MEMBLOCK_SIZE(char, respXmlP)); + (unsigned int)XMLRPC_MEMBLOCK_SIZE(char, respXmlP)); *resultPP = xmlrpc_parse_response( envP, diff --git a/Utilities/cmxmlrpc/xmlrpc_data.c b/Utilities/cmxmlrpc/xmlrpc_data.c index fc6840f..0d3c3ca 100644 --- a/Utilities/cmxmlrpc/xmlrpc_data.c +++ b/Utilities/cmxmlrpc/xmlrpc_data.c @@ -254,12 +254,12 @@ xmlrpc_read_string(xmlrpc_env * const envP, -----------------------------------------------------------------------------*/ validateType(envP, valueP, XMLRPC_TYPE_STRING); if (!envP->fault_occurred) { - unsigned int const size = + size_t const size = XMLRPC_MEMBLOCK_SIZE(char, &valueP->_block); const char * const contents = XMLRPC_MEMBLOCK_CONTENTS(char, &valueP->_block); - verifyNoNulls(envP, contents, size); + verifyNoNulls(envP, contents, (unsigned int)size); if (!envP->fault_occurred) { char * stringValue; @@ -289,7 +289,7 @@ xmlrpc_read_string_lp(xmlrpc_env * const envP, validateType(envP, valueP, XMLRPC_TYPE_STRING); if (!envP->fault_occurred) { - unsigned int const size = + size_t const size = XMLRPC_MEMBLOCK_SIZE(char, &valueP->_block); const char * const contents = XMLRPC_MEMBLOCK_CONTENTS(char, &valueP->_block); @@ -304,7 +304,7 @@ xmlrpc_read_string_lp(xmlrpc_env * const envP, else { memcpy(stringValue, contents, size); *stringValueP = stringValue; - *lengthP = size; + *lengthP = (unsigned int)size; } } } @@ -449,7 +449,7 @@ getString(xmlrpc_env * const envP, xmlrpc_value ** const valPP) { const char * str; - unsigned int len; + size_t len; str = (const char*) va_arg(*args, char*); if (**formatP == '#') { @@ -458,7 +458,7 @@ getString(xmlrpc_env * const envP, } else len = strlen(str); - mkString(envP, str, len, valPP); + mkString(envP, str, (unsigned int)len, valPP); } @@ -1143,7 +1143,7 @@ parsevalue(xmlrpc_env * const envP, (*format)++; *sizeptr = len; } else - verifyNoNulls(envP, contents, len); + verifyNoNulls(envP, contents, (unsigned int)len); *strptr = contents; } break; @@ -1173,7 +1173,7 @@ parsevalue(xmlrpc_env * const envP, (*format)++; *sizeptr = len; } else - verifyNoNullsW(envP, wcontents, len); + verifyNoNullsW(envP, wcontents, (unsigned int)len); *wcsptr = wcontents; } } diff --git a/Utilities/cmxmlrpc/xmlrpc_expat.c b/Utilities/cmxmlrpc/xmlrpc_expat.c index 7fbc0c9..cb467d1 100644 --- a/Utilities/cmxmlrpc/xmlrpc_expat.c +++ b/Utilities/cmxmlrpc/xmlrpc_expat.c @@ -139,7 +139,7 @@ void xml_element_free (xml_element *elem) /* Deallocate all of our children recursively. */ children = &elem->_children; contents = XMLRPC_TYPED_MEM_BLOCK_CONTENTS(xml_element*, children); - size = XMLRPC_TYPED_MEM_BLOCK_SIZE(xml_element*, children); + size = (int)XMLRPC_TYPED_MEM_BLOCK_SIZE(xml_element*, children); for (i = 0; i < size; i++) xml_element_free(contents[i]); diff --git a/Utilities/cmxmlrpc/xmlrpc_parse.c b/Utilities/cmxmlrpc/xmlrpc_parse.c index 74e4c2d..0999eb6 100644 --- a/Utilities/cmxmlrpc/xmlrpc_parse.c +++ b/Utilities/cmxmlrpc/xmlrpc_parse.c @@ -248,7 +248,7 @@ static xmlrpc_value * convert_value(xmlrpc_env *env, unsigned *depth, xml_element *elem) { xml_element *child; - int child_count; + size_t child_count; char *cdata, *child_name; size_t cdata_size, ascii_len; xmlrpc_mem_block *decoded; @@ -356,7 +356,7 @@ convert_array(xmlrpc_env *env, unsigned *depth, xml_element *elem) { xml_element *data, **values, *value; xmlrpc_value *array, *item; - int size, i; + size_t size, i; XMLRPC_ASSERT_ENV_OK(env); XMLRPC_ASSERT(elem != NULL); @@ -413,7 +413,7 @@ convert_struct(xmlrpc_env *env, unsigned *depth, xml_element *elem) { xmlrpc_value *strct, *key, *value; xml_element **members, *member, *name_elem, *value_elem; - int size, i; + size_t size, i; char *cdata; size_t cdata_size; @@ -490,7 +490,7 @@ static xmlrpc_value * convert_params(xmlrpc_env *env, unsigned *depth, xml_element *elem) { xmlrpc_value *array, *item; - int size, i; + size_t size, i; xml_element **params, *param, *value; XMLRPC_ASSERT_ENV_OK(env); @@ -546,7 +546,7 @@ parseCallXml(xmlrpc_env * const envP, xmlrpc_env env; xmlrpc_env_init(&env); - *callElemP = xml_parse(&env, xmlData, xmlLen); + *callElemP = xml_parse(&env, xmlData, (int)xmlLen); if (env.fault_occurred) xmlrpc_env_set_fault_formatted( envP, env.fault_code, "Call is not valid XML. %s", @@ -697,7 +697,7 @@ xmlrpc_parse_response(xmlrpc_env *env, depth = 0; /* Parse our XML data. */ - response = xml_parse(env, xml_data, xml_len); + response = xml_parse(env, xml_data, (int)xml_len); XMLRPC_FAIL_IF_FAULT(env); /* Pick apart and verify our structure. */ diff --git a/Utilities/cmxmlrpc/xmlrpc_registry.c b/Utilities/cmxmlrpc/xmlrpc_registry.c index a0498b1..ae3b21c 100644 --- a/Utilities/cmxmlrpc/xmlrpc_registry.c +++ b/Utilities/cmxmlrpc/xmlrpc_registry.c @@ -367,7 +367,7 @@ xmlrpc_registry_process_call(xmlrpc_env * const envP, XMLRPC_ASSERT_ENV_OK(envP); XMLRPC_ASSERT_PTR_OK(xml_data); - xmlrpc_traceXml("XML-RPC CALL", xml_data, xml_len); + xmlrpc_traceXml("XML-RPC CALL", xml_data, (unsigned int)xml_len); /* Allocate our output buffer. ** If this fails, we need to die in a special fashion. */ @@ -412,7 +412,7 @@ xmlrpc_registry_process_call(xmlrpc_env * const envP, else xmlrpc_traceXml("XML-RPC RESPONSE", XMLRPC_MEMBLOCK_CONTENTS(char, output), - XMLRPC_MEMBLOCK_SIZE(char, output)); + (unsigned int)XMLRPC_MEMBLOCK_SIZE(char, output)); } return output; } @@ -507,7 +507,7 @@ system_multicall(xmlrpc_env *env, size = xmlrpc_array_size(env, methlist); XMLRPC_ASSERT_ENV_OK(env); for (i = 0; i < size; i++) { - methinfo = xmlrpc_array_get_item(env, methlist, i); + methinfo = xmlrpc_array_get_item(env, methlist, (int)i); XMLRPC_ASSERT_ENV_OK(env); /* Call our method. */ @@ -588,7 +588,7 @@ system_listMethods(xmlrpc_env *env, size = xmlrpc_struct_size(env, registry->_methods); XMLRPC_FAIL_IF_FAULT(env); for (i = 0; i < size; i++) { - xmlrpc_struct_get_key_and_value(env, registry->_methods, i, + xmlrpc_struct_get_key_and_value(env, registry->_methods, (int)i, &method_name, &method_info); XMLRPC_FAIL_IF_FAULT(env); xmlrpc_array_append_item(env, method_names, method_name); diff --git a/Utilities/cmxmlrpc/xmlrpc_serialize.c b/Utilities/cmxmlrpc/xmlrpc_serialize.c index debf218..5315ff9 100644 --- a/Utilities/cmxmlrpc/xmlrpc_serialize.c +++ b/Utilities/cmxmlrpc/xmlrpc_serialize.c @@ -295,7 +295,7 @@ xmlrpc_serialize_struct(xmlrpc_env *env, size = xmlrpc_struct_size(env, strct); XMLRPC_FAIL_IF_FAULT(env); for (i = 0; i < size; i++) { - xmlrpc_struct_get_key_and_value(env, strct, i, &key, &value); + xmlrpc_struct_get_key_and_value(env, strct, (int)i, &key, &value); XMLRPC_FAIL_IF_FAULT(env); format_out(env, output, ""); XMLRPC_FAIL_IF_FAULT(env); @@ -379,7 +379,7 @@ xmlrpc_serialize_value(xmlrpc_env *env, size = xmlrpc_array_size(env, value); XMLRPC_FAIL_IF_FAULT(env); for (i = 0; i < size; i++) { - item = xmlrpc_array_get_item(env, value, i); + item = xmlrpc_array_get_item(env, value, (int)i); XMLRPC_FAIL_IF_FAULT(env); xmlrpc_serialize_value(env, output, item); XMLRPC_FAIL_IF_FAULT(env); @@ -469,7 +469,7 @@ xmlrpc_serialize_params(xmlrpc_env *env, for (i = 0; i < size; i++) { format_out(env, output, ""); XMLRPC_FAIL_IF_FAULT(env); - item = xmlrpc_array_get_item(env, param_array, i); + item = xmlrpc_array_get_item(env, param_array, (int)i); XMLRPC_FAIL_IF_FAULT(env); xmlrpc_serialize_value(env, output, item); XMLRPC_FAIL_IF_FAULT(env); diff --git a/Utilities/cmxmlrpc/xmlrpc_struct.c b/Utilities/cmxmlrpc/xmlrpc_struct.c index 6dbbd66..50cc6db 100644 --- a/Utilities/cmxmlrpc/xmlrpc_struct.c +++ b/Utilities/cmxmlrpc/xmlrpc_struct.c @@ -120,7 +120,7 @@ xmlrpc_struct_size(xmlrpc_env* env, xmlrpc_value* strct) XMLRPC_ASSERT_VALUE_OK(strct); XMLRPC_TYPE_CHECK(env, strct, XMLRPC_TYPE_STRUCT); - retval = XMLRPC_MEMBLOCK_SIZE(_struct_member, &strct->_block); + retval = (int)XMLRPC_MEMBLOCK_SIZE(_struct_member, &strct->_block); cleanup: if (env->fault_occurred) @@ -186,7 +186,7 @@ find_member(xmlrpc_value * const strctP, keystr = XMLRPC_MEMBLOCK_CONTENTS(char, &keyval->_block); keystr_size = XMLRPC_MEMBLOCK_SIZE(char, &keyval->_block)-1; if (key_len == keystr_size && memcmp(key, keystr, key_len) == 0) - return i; + return (int)i; } } return -1; diff --git a/Utilities/cmxmlrpc/xmlrpc_strutil.c b/Utilities/cmxmlrpc/xmlrpc_strutil.c index 1f1b9a7..8efdb40 100644 --- a/Utilities/cmxmlrpc/xmlrpc_strutil.c +++ b/Utilities/cmxmlrpc/xmlrpc_strutil.c @@ -19,7 +19,7 @@ xmlrpc_makePrintable(const char * const input) { get the storage. -----------------------------------------------------------------------------*/ char * output; - const unsigned int inputLength = strlen(input); + const size_t inputLength = strlen(input); output = malloc(inputLength*4+1); diff --git a/Utilities/cmxmlrpc/xmlrpc_support.c b/Utilities/cmxmlrpc/xmlrpc_support.c index 4b0923a..ac29a12 100644 --- a/Utilities/cmxmlrpc/xmlrpc_support.c +++ b/Utilities/cmxmlrpc/xmlrpc_support.c @@ -326,7 +326,7 @@ xmlrpc_mem_block_append(xmlrpc_env * const env, void * const data, size_t const len) { - int size; + size_t size; XMLRPC_ASSERT_ENV_OK(env); XMLRPC_ASSERT(block != NULL); -- cgit v0.12