From 8424e074e9ab224ba8540d856ab41b8ea2de934b Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 30 Aug 2005 16:30:48 +0000 Subject: [PATCH] fixed build errors and warnings caused by latest merge git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4233 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 16 ++++++++-------- Source/clzma.cpp | 6 ++++-- Source/growbuf.cpp | 4 +++- Source/script.cpp | 8 ++++---- Source/util.cpp | 1 + 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Source/build.cpp b/Source/build.cpp index 82c6636a..31fa7e6c 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -756,19 +756,19 @@ int CEXEBuild::datablock_optimize(int start_offset, int first_int) return start_offset; } -int CEXEBuild::add_db_data(IMMap *map) // returns offset +int CEXEBuild::add_db_data(IMMap *mmap) // returns offset { build_compressor_set = true; int done = 0; - if (!map) + if (!mmap) { ERROR_MSG("Error: add_db_data() called with invalid mapped file\n"); return -1; } - int length = map->getsize(); + int length = mmap->getsize(); if (length < 0) { @@ -802,14 +802,14 @@ int CEXEBuild::add_db_data(IMMap *map) // returns offset int in_len = min(build_filebuflen, avail_in); int out_len = min(build_filebuflen, avail_out); - compressor->SetNextIn((char *) map->get(length - avail_in, in_len), in_len); + compressor->SetNextIn((char *) mmap->get(length - avail_in, in_len), in_len); compressor->SetNextOut((char *) db->get(st + sizeof(int) + bufferlen - avail_out, out_len), out_len); if ((ret = compressor->Compress(0)) < 0) { ERROR_MSG("Error: add_db_data() - compress() failed(%s [%d])\n", compressor->GetErrStr(ret), ret); return -1; } - map->release(); + mmap->release(); db->flush(out_len); db->release(); avail_in -= in_len - compressor->GetAvailIn(); @@ -883,10 +883,10 @@ int CEXEBuild::add_db_data(IMMap *map) // returns offset { int l = min(build_filebuflen, left); int *p = (int *) db->get(st + sizeof(int) + length - left, l); - memcpy(p, map->get(length - left, l), l); + memcpy(p, mmap->get(length - left, l), l); db->flush(l); db->release(); - map->release(); + mmap->release(); left -= l; } @@ -3154,7 +3154,7 @@ void CEXEBuild::build_plugin_table(void) { sprintf(searchPath,"%s" PLATFORM_PATH_SEPARATOR_STR "Plugins",nsisdir); INFO_MSG("Processing plugin dlls: \"%s" PLATFORM_PATH_SEPARATOR_STR "*.dll\"\n",searchPath); - m_plugins.FindCommands(searchPath, display_info); + m_plugins.FindCommands(searchPath, display_info?true:false); INFO_MSG("\n"); delete[] searchPath; } diff --git a/Source/clzma.cpp b/Source/clzma.cpp index d6725e3b..295023b4 100644 --- a/Source/clzma.cpp +++ b/Source/clzma.cpp @@ -1,6 +1,8 @@ #include // for std::min #include "clzma.h" +using namespace std; + #ifndef _WIN32 struct evnet_t { @@ -343,7 +345,7 @@ HRESULT CLZMA::ReadPart(void *data, UINT32 size, UINT32 *processedSize) if (compressor_finished) return E_ABORT; } - UINT32 l = std::min(size, avail_in); + UINT32 l = min(size, avail_in); memcpy(data, next_in, l); avail_in -= l; size -= l; @@ -372,7 +374,7 @@ HRESULT CLZMA::WritePart(const void *data, UINT32 size, UINT32 *processedSize) if (!avail_out) return E_ABORT; } - UINT32 l = std::min(size, avail_out); + UINT32 l = min(size, avail_out); memcpy(next_out, data, l); avail_out -= l; size -= l; diff --git a/Source/growbuf.cpp b/Source/growbuf.cpp index 69c204af..cc18444f 100644 --- a/Source/growbuf.cpp +++ b/Source/growbuf.cpp @@ -7,6 +7,8 @@ #include "Platform.h" +using namespace std; + GrowBuf::GrowBuf() { m_alloc=m_used=m_zero=0; m_s=NULL; m_bs=32768; } GrowBuf::~GrowBuf() { free(m_s); } @@ -51,7 +53,7 @@ void GrowBuf::resize(int newlen) } quit(); } - memcpy(n,m_s,std::min(newlen,os)); + memcpy(n,m_s,min(newlen,os)); free(m_s); } m_s=n; diff --git a/Source/script.cpp b/Source/script.cpp index fe28dfc6..8cdfe405 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -5413,10 +5413,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) { SCRIPT_MSG("PluginDir: \"%s\"\n",line.gettoken_str(1)); #ifdef _WIN32 - m_plugins.FindCommands(line.gettoken_str(1), display_info); + m_plugins.FindCommands(line.gettoken_str(1), display_info?true:false); #else char *converted_path = my_convert(line.gettoken_str(1)); - m_plugins.FindCommands(converted_path, display_info); + m_plugins.FindCommands(converted_path, display_info?true:false); my_convert_free(converted_path); #endif return PS_OK; @@ -5429,7 +5429,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) const string command = m_plugins.NormalizedCommand(line.gettoken_str(0)); const string dllPath = m_plugins.GetPluginPath(command); - int data_handle = m_plugins.GetPluginHandle(uninstall_mode, command); + int data_handle = m_plugins.GetPluginHandle(uninstall_mode?true:false, command); if (uninstall_mode) uninst_plugin_used = true; else plugin_used = true; @@ -5461,7 +5461,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) if (ret != PS_OK) { return ret; } - m_plugins.SetDllDataHandle(uninstall_mode, line.gettoken_str(0), data_handle); + m_plugins.SetDllDataHandle(uninstall_mode?true:false, line.gettoken_str(0), data_handle); build_overwrite=old_build_overwrite; build_datesave=old_build_datesave; // Added by ramon 23 May 2003 diff --git a/Source/util.cpp b/Source/util.cpp index 5525c6b2..7a98e7af 100644 --- a/Source/util.cpp +++ b/Source/util.cpp @@ -15,6 +15,7 @@ #endif #include // for assert +#include using namespace std;