summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceUtil')
-rw-r--r--cpp/src/IceUtil/Cond.cpp4
-rw-r--r--cpp/src/IceUtil/Makefile.mak4
-rw-r--r--cpp/src/IceUtil/StringUtil.cpp11
-rw-r--r--cpp/src/IceUtil/Thread.cpp2
4 files changed, 9 insertions, 12 deletions
diff --git a/cpp/src/IceUtil/Cond.cpp b/cpp/src/IceUtil/Cond.cpp
index 0b623a01507..34be360ef57 100644
--- a/cpp/src/IceUtil/Cond.cpp
+++ b/cpp/src/IceUtil/Cond.cpp
@@ -32,7 +32,7 @@ IceUtilInternal::Semaphore::~Semaphore()
void
IceUtilInternal::Semaphore::wait() const
{
- int rc = WaitForSingleObject(_sem, INFINITE);
+ DWORD rc = WaitForSingleObject(_sem, INFINITE);
if(rc != WAIT_OBJECT_0)
{
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, GetLastError());
@@ -48,7 +48,7 @@ IceUtilInternal::Semaphore::timedWait(const IceUtil::Time& timeout) const
throw IceUtil::InvalidTimeoutException(__FILE__, __LINE__, timeout);
}
- int rc = WaitForSingleObject(_sem, static_cast<DWORD>(msTimeout));
+ DWORD rc = WaitForSingleObject(_sem, static_cast<DWORD>(msTimeout));
if(rc != WAIT_TIMEOUT && rc != WAIT_OBJECT_0)
{
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, GetLastError());
diff --git a/cpp/src/IceUtil/Makefile.mak b/cpp/src/IceUtil/Makefile.mak
index 3a8cb2dffae..48982171f16 100644
--- a/cpp/src/IceUtil/Makefile.mak
+++ b/cpp/src/IceUtil/Makefile.mak
@@ -47,7 +47,7 @@ CPPFLAGS = $(CPPFLAGS) -DICE_UTIL_API_EXPORTS -I.. -DWIN32_LEAN_AND_MEAN
PDBFLAGS = /pdb:$(DLLNAME:.dll=.pdb)
!endif
-!if "$(CPP_COMPILER)" == "BCC2007"
+!if "$(BCPLUSPLUS)" == "yes"
RES_FILE = ,, IceUtil.res
!else
RES_FILE = IceUtil.res
@@ -81,7 +81,7 @@ install:: all
copy $(DLLNAME) $(install_bindir)
-!if "$(CPP_COMPILER)" == "BCC2007" && "$(OPTIMIZE)" != "yes"
+!if "$(BCPLUSPLUS)" == "yes" && "$(OPTIMIZE)" != "yes"
install:: all
copy $(DLLNAME:.dll=.tds) $(install_bindir)
diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/IceUtil/StringUtil.cpp
index 8965020fab8..a8499af2355 100644
--- a/cpp/src/IceUtil/StringUtil.cpp
+++ b/cpp/src/IceUtil/StringUtil.cpp
@@ -171,7 +171,6 @@ checkChar(char c)
static char
decodeChar(const string& s, string::size_type start, string::size_type end, string::size_type& nextStart)
{
- assert(start >= 0);
assert(start < end);
assert(end <= s.size());
@@ -282,10 +281,6 @@ static void decodeString(const string& s, string::size_type start, string::size_
bool
IceUtilInternal::unescapeString(const string& s, string::size_type start, string::size_type end, string& result)
{
- if(start < 0)
- {
- throw IllegalArgumentException(__FILE__, __LINE__, "start offset must be >= 0");
- }
if(end > s.size())
{
throw IllegalArgumentException(__FILE__, __LINE__, "end offset must be <= s.size()");
@@ -691,7 +686,8 @@ string
IceUtilInternal::toLower(const std::string& s)
{
string result;
- for(unsigned int i = 0; i < s.length(); ++ i)
+ result.reserve(s.size());
+ for(unsigned int i = 0; i < s.length(); ++i)
{
result += tolower(static_cast<unsigned char>(s[i]));
}
@@ -702,7 +698,8 @@ string
IceUtilInternal::toUpper(const std::string& s)
{
string result;
- for(unsigned int i = 0; i < s.length(); ++ i)
+ result.reserve(s.size());
+ for(unsigned int i = 0; i < s.length(); ++i)
{
result += toupper(static_cast<unsigned char>(s[i]));
}
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp
index d39014ae653..c04f6c07c33 100644
--- a/cpp/src/IceUtil/Thread.cpp
+++ b/cpp/src/IceUtil/Thread.cpp
@@ -58,7 +58,7 @@ IceUtil::ThreadControl::join()
throw BadThreadControlException(__FILE__, __LINE__);
}
- int rc = WaitForSingleObject(_handle, INFINITE);
+ DWORD rc = WaitForSingleObject(_handle, INFINITE);
if(rc != WAIT_OBJECT_0)
{
throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());