summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBrent Eagles <brent@zeroc.com>2007-02-06 00:38:49 +0000
committerBrent Eagles <brent@zeroc.com>2007-02-06 00:38:49 +0000
commit193a03a2e0987442269f8498a986cb8354c75721 (patch)
tree73ac99a76cee5812e7b82738ddf6e3410f771da4 /cpp/src
parentAdded Ruby (diff)
downloadice-193a03a2e0987442269f8498a986cb8354c75721.tar.bz2
ice-193a03a2e0987442269f8498a986cb8354c75721.tar.xz
ice-193a03a2e0987442269f8498a986cb8354c75721.zip
fix x64 warnings
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ImplicitContextI.cpp20
-rw-r--r--cpp/src/Ice/Initialize.cpp2
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp9
-rw-r--r--cpp/src/slice2html/Gen.cpp16
-rw-r--r--cpp/src/slice2html/Gen.h8
5 files changed, 37 insertions, 18 deletions
diff --git a/cpp/src/Ice/ImplicitContextI.cpp b/cpp/src/Ice/ImplicitContextI.cpp
index 7dd27c0fada..a2991b12e14 100644
--- a/cpp/src/Ice/ImplicitContextI.cpp
+++ b/cpp/src/Ice/ImplicitContextI.cpp
@@ -508,12 +508,26 @@ PerThreadImplicitContext::clearThreadContext() const
delete (*sv)[_index].context;
(*sv)[_index].context = 0;
- int i = sv->size() - 1;
- while(i >= 0 && (*sv)[i].context == 0)
+ //
+ // Trim tailing empty contexts.
+ //
+ size_t i = sv->size();
+
+ bool clear = true;
+ while(i != 0)
{
i--;
+ if((*sv)[i].context != 0)
+ {
+ clear = false;
+ break;
+ }
}
- if(i < 0)
+
+ //
+ // If we did not find any contexts, delete the SlotVector.
+ //
+ if(clear)
{
delete sv;
#ifdef _WIN32
diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp
index 6576599af6e..ae9d72aaee5 100644
--- a/cpp/src/Ice/Initialize.cpp
+++ b/cpp/src/Ice/Initialize.cpp
@@ -176,7 +176,7 @@ Ice::initialize(StringSeq& args, const InitializationData& initializationData, I
// Make a dummy argc/argv.
// (We can't use argsToStringSeq() because that requires an already initialized argv.)
//
- int argc = args.size();
+ int argc = static_cast<int>(args.size());
origArgc = argc;
argv = new char*[args.size() + 1];
int i;
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index b05a9697500..1255dee66c7 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -823,9 +823,14 @@ Ice::ObjectAdapterI::ObjectAdapterI(const InstancePtr& instance, const Communica
if(_threadPerConnection)
{
- _threadPerConnectionStackSize =
+ int stackSize =
properties->getPropertyAsIntWithDefault(_propertyPrefix + _name + ".ThreadPerConnection.StackSize",
- _instance->threadPerConnectionStackSize());
+ static_cast<Int>(_instance->threadPerConnectionStackSize()));
+ if(stackSize < 0)
+ {
+ stackSize = 0;
+ }
+ _threadPerConnectionStackSize = stackSize;
}
//
diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp
index dba70089b34..20d9f219684 100644
--- a/cpp/src/slice2html/Gen.cpp
+++ b/cpp/src/slice2html/Gen.cpp
@@ -97,8 +97,8 @@ string Slice::GeneratorBase::_footer;
string Slice::GeneratorBase::_imageDir;
string Slice::GeneratorBase::_logoURL;
string Slice::GeneratorBase::_searchAction;
-unsigned Slice::GeneratorBase::_indexCount = 0;
-unsigned Slice::GeneratorBase::_warnSummary = 0;
+size_t Slice::GeneratorBase::_indexCount = 0;
+size_t Slice::GeneratorBase::_warnSummary = 0;
ContainedList Slice::GeneratorBase::_symbols;
//
@@ -805,7 +805,7 @@ Slice::GeneratorBase::printLogo(const ContainedPtr& c, const ContainerPtr& conta
string
Slice::GeneratorBase::toString(const SyntaxTreeBasePtr& p, const ContainerPtr& container, bool asTarget, bool forIndex,
- unsigned* summarySize, bool shortName)
+ size_t* summarySize, bool shortName)
{
string anchor;
string linkpath;
@@ -989,7 +989,7 @@ Slice::GeneratorBase::toString(const SyntaxTreeBasePtr& p, const ContainerPtr& c
string
Slice::GeneratorBase::toString(const string& str, const ContainerPtr& container, bool asTarget, bool forIndex,
- unsigned* summarySize)
+ size_t* summarySize)
{
string s = str;
@@ -1016,7 +1016,7 @@ string
Slice::GeneratorBase::getComment(const ContainedPtr& contained, const ContainerPtr& container,
bool summary, bool forIndex)
{
- unsigned summarySize = 0;
+ size_t summarySize = 0;
string s = contained->comment();
string comment;
for(unsigned int i = 0; i < s.size(); ++i)
@@ -1036,10 +1036,10 @@ Slice::GeneratorBase::getComment(const ContainedPtr& contained, const ContainerP
{
break;
}
-
+
literal += s[i];
}
- unsigned sz = 0;
+ size_t sz = 0;
comment += toString(literal, container, false, forIndex, summary ? &sz : 0);
summarySize += sz;
}
@@ -1059,7 +1059,7 @@ Slice::GeneratorBase::getComment(const ContainedPtr& contained, const ContainerP
if(summary && _warnSummary && summarySize > _warnSummary)
{
cerr << contained->definitionContext()->filename() << ": summary size (" << summarySize << ") exceeds "
- << _warnSummary << " characters: `" << comment << "'" << endl;
+ << _warnSummary << " characters: `" << comment << "'" << endl;
}
return comment;
diff --git a/cpp/src/slice2html/Gen.h b/cpp/src/slice2html/Gen.h
index 88abf9651e3..a2cf62b692d 100644
--- a/cpp/src/slice2html/Gen.h
+++ b/cpp/src/slice2html/Gen.h
@@ -57,8 +57,8 @@ protected:
void printLogo(const ContainedPtr&, const ContainerPtr&, bool);
::std::string toString(const SyntaxTreeBasePtr&, const ContainerPtr&, bool = true, bool = false,
- unsigned* = 0, bool = false);
- ::std::string toString(const ::std::string&, const ContainerPtr&, bool = true, bool = false, unsigned* = 0);
+ size_t* = 0, bool = false);
+ ::std::string toString(const ::std::string&, const ContainerPtr&, bool = true, bool = false, size_t* = 0);
::std::string getComment(const ContainedPtr&, const ContainerPtr&, bool, bool = false);
static ::std::string getAnchor(const SyntaxTreeBasePtr&);
@@ -70,8 +70,8 @@ protected:
::IceUtil::XMLOutput& _out;
- static unsigned _indexCount;
- static unsigned _warnSummary;
+ static size_t _indexCount;
+ static size_t _warnSummary;
private: