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
This commit is contained in:
kichik 2005-08-30 16:30:48 +00:00
parent 57ad3c18b3
commit 8424e074e9
5 changed files with 20 additions and 15 deletions

View file

@ -756,19 +756,19 @@ int CEXEBuild::datablock_optimize(int start_offset, int first_int)
return start_offset; 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; build_compressor_set = true;
int done = 0; int done = 0;
if (!map) if (!mmap)
{ {
ERROR_MSG("Error: add_db_data() called with invalid mapped file\n"); ERROR_MSG("Error: add_db_data() called with invalid mapped file\n");
return -1; return -1;
} }
int length = map->getsize(); int length = mmap->getsize();
if (length < 0) 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 in_len = min(build_filebuflen, avail_in);
int out_len = min(build_filebuflen, avail_out); 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); compressor->SetNextOut((char *) db->get(st + sizeof(int) + bufferlen - avail_out, out_len), out_len);
if ((ret = compressor->Compress(0)) < 0) if ((ret = compressor->Compress(0)) < 0)
{ {
ERROR_MSG("Error: add_db_data() - compress() failed(%s [%d])\n", compressor->GetErrStr(ret), ret); ERROR_MSG("Error: add_db_data() - compress() failed(%s [%d])\n", compressor->GetErrStr(ret), ret);
return -1; return -1;
} }
map->release(); mmap->release();
db->flush(out_len); db->flush(out_len);
db->release(); db->release();
avail_in -= in_len - compressor->GetAvailIn(); 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 l = min(build_filebuflen, left);
int *p = (int *) db->get(st + sizeof(int) + length - left, l); 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->flush(l);
db->release(); db->release();
map->release(); mmap->release();
left -= l; left -= l;
} }
@ -3154,7 +3154,7 @@ void CEXEBuild::build_plugin_table(void)
{ {
sprintf(searchPath,"%s" PLATFORM_PATH_SEPARATOR_STR "Plugins",nsisdir); sprintf(searchPath,"%s" PLATFORM_PATH_SEPARATOR_STR "Plugins",nsisdir);
INFO_MSG("Processing plugin dlls: \"%s" PLATFORM_PATH_SEPARATOR_STR "*.dll\"\n",searchPath); 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"); INFO_MSG("\n");
delete[] searchPath; delete[] searchPath;
} }

View file

@ -1,6 +1,8 @@
#include <algorithm> // for std::min #include <algorithm> // for std::min
#include "clzma.h" #include "clzma.h"
using namespace std;
#ifndef _WIN32 #ifndef _WIN32
struct evnet_t struct evnet_t
{ {
@ -343,7 +345,7 @@ HRESULT CLZMA::ReadPart(void *data, UINT32 size, UINT32 *processedSize)
if (compressor_finished) if (compressor_finished)
return E_ABORT; return E_ABORT;
} }
UINT32 l = std::min(size, avail_in); UINT32 l = min(size, avail_in);
memcpy(data, next_in, l); memcpy(data, next_in, l);
avail_in -= l; avail_in -= l;
size -= l; size -= l;
@ -372,7 +374,7 @@ HRESULT CLZMA::WritePart(const void *data, UINT32 size, UINT32 *processedSize)
if (!avail_out) if (!avail_out)
return E_ABORT; return E_ABORT;
} }
UINT32 l = std::min(size, avail_out); UINT32 l = min(size, avail_out);
memcpy(next_out, data, l); memcpy(next_out, data, l);
avail_out -= l; avail_out -= l;
size -= l; size -= l;

View file

@ -7,6 +7,8 @@
#include "Platform.h" #include "Platform.h"
using namespace std;
GrowBuf::GrowBuf() { m_alloc=m_used=m_zero=0; m_s=NULL; m_bs=32768; } GrowBuf::GrowBuf() { m_alloc=m_used=m_zero=0; m_s=NULL; m_bs=32768; }
GrowBuf::~GrowBuf() { free(m_s); } GrowBuf::~GrowBuf() { free(m_s); }
@ -51,7 +53,7 @@ void GrowBuf::resize(int newlen)
} }
quit(); quit();
} }
memcpy(n,m_s,std::min(newlen,os)); memcpy(n,m_s,min(newlen,os));
free(m_s); free(m_s);
} }
m_s=n; m_s=n;

View file

@ -5413,10 +5413,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{ {
SCRIPT_MSG("PluginDir: \"%s\"\n",line.gettoken_str(1)); SCRIPT_MSG("PluginDir: \"%s\"\n",line.gettoken_str(1));
#ifdef _WIN32 #ifdef _WIN32
m_plugins.FindCommands(line.gettoken_str(1), display_info); m_plugins.FindCommands(line.gettoken_str(1), display_info?true:false);
#else #else
char *converted_path = my_convert(line.gettoken_str(1)); 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); my_convert_free(converted_path);
#endif #endif
return PS_OK; 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 command = m_plugins.NormalizedCommand(line.gettoken_str(0));
const string dllPath = m_plugins.GetPluginPath(command); 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; if (uninstall_mode) uninst_plugin_used = true;
else plugin_used = true; else plugin_used = true;
@ -5461,7 +5461,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (ret != PS_OK) { if (ret != PS_OK) {
return ret; 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_overwrite=old_build_overwrite;
build_datesave=old_build_datesave; build_datesave=old_build_datesave;
// Added by ramon 23 May 2003 // Added by ramon 23 May 2003

View file

@ -15,6 +15,7 @@
#endif #endif
#include <cassert> // for assert #include <cassert> // for assert
#include <algorithm>
using namespace std; using namespace std;