]> git.pld-linux.org Git - packages/ice.git/blame - ice-gcc47.patch
multi-php-version support; build with php53 for now
[packages/ice.git] / ice-gcc47.patch
CommitLineData
bb6d4d37
JR
1From 3bf59648721e8b63ccc76cb47a77d45ab4924484 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Ha=C3=AFkel=20Gu=C3=A9mar?= <hguemar@fedoraproject.org>
3Date: Tue, 29 May 2012 16:39:46 +0200
4Subject: [PATCH 9/9] gcc47 fix
5
6---
7 cpp/allTests.py | 7 ++---
8 cpp/include/Freeze/Map.h | 2 +-
9 cpp/include/Ice/Buffer.h | 1 +
10 cpp/include/Ice/ConnectionIF.h | 2 +-
11 cpp/include/Ice/IconvStringConverter.h | 10 +++++--
12 cpp/include/Ice/IncomingAsyncF.h | 6 -----
13 cpp/include/Ice/LocalObjectF.h | 6 -----
14 cpp/include/Ice/ObjectF.h | 11 --------
15 cpp/include/Ice/OutgoingAsyncF.h | 2 +-
16 cpp/include/Ice/Proxy.h | 12 ++++-----
17 cpp/include/Ice/ProxyF.h | 40 ++++++++++++----------------
18 cpp/include/Ice/Stream.h | 21 ++++++++-------
19 cpp/include/Ice/StreamF.h | 6 -----
20 cpp/include/IceUtil/Mutex.h | 5 +++-
21 cpp/src/Freeze/MapDb.cpp | 6 ++++-
22 cpp/src/Freeze/MapI.cpp | 16 +++++++++---
23 cpp/src/Freeze/SharedDbEnv.cpp | 5 +++-
24 cpp/src/Ice/ConnectionI.cpp | 4 ++-
25 cpp/src/Ice/IncomingAsync.cpp | 2 +-
26 cpp/src/Ice/LocalObject.cpp | 2 +-
27 cpp/src/Ice/Object.cpp | 2 +-
28 cpp/src/Ice/OutgoingAsync.cpp | 2 +-
29 cpp/src/Ice/ProxyFactory.cpp | 1 +
30 cpp/src/Ice/Service.cpp | 15 ++++++++---
31 cpp/src/Ice/Stream.cpp | 13 ++++++++--
32 cpp/src/IceGrid/AdminCallbackRouter.cpp | 7 ++++-
33 cpp/src/IceGrid/DescriptorHelper.cpp | 19 +++++++-------
34 cpp/src/IceGrid/ReplicaCache.cpp | 2 +-
35 cpp/src/IceGrid/SessionI.h | 2 +-
36 cpp/src/IceSSL/Instance.cpp | 2 +-
37 cpp/src/IceSSL/InstanceF.h | 2 +-
38 cpp/src/IceSSL/TrustManager.cpp | 2 +-
39 cpp/src/IceSSL/TrustManagerF.h | 2 +-
40 cpp/src/IceSSL/Util.cpp | 2 +-
41 cpp/src/IceSSL/UtilF.h | 2 +-
42 cpp/src/IceStorm/NodeI.cpp | 5 ----
43 cpp/src/IceUtil/Cond.cpp | 5 +++-
44 cpp/src/IceUtil/CountDownLatch.cpp | 10 +++++--
45 cpp/src/IceUtil/CtrlCHandler.cpp | 20 +++++++++++---
46 cpp/src/IceUtil/FileUtil.cpp | 4 +++
47 cpp/src/IceUtil/RecMutex.cpp | 10 +++++--
48 cpp/src/Slice/CPlusPlusUtil.cpp | 4 +--
49 cpp/src/Slice/FileTracker.cpp | 4 +++
50 cpp/src/slice2cpp/Gen.cpp | 43 +++++++++++++++++--------------
51 cpp/src/slice2cs/Gen.cpp | 12 +--------
52 cpp/src/slice2java/Gen.cpp | 4 +--
53 cpp/test/Glacier2/ssl/Server.cpp | 19 ++++++++++----
54 cpp/test/Ice/background/EndpointI.h | 2 +-
55 cpp/test/Ice/custom/AllTests.cpp | 9 ++++---
56 cpp/test/Ice/info/AllTests.cpp | 15 +++++++----
57 cpp/test/Ice/properties/run.py | 2 +-
58 cpp/test/IceUtil/unicode/Client.cpp | 4 +++
59 cpp/test/Slice/keyword/Client.cpp | 4 +++
60 cpp/test/include/TestCommon.h | 16 ++++++++++++
61 scripts/TestUtil.py | 27 +++++++++++++++++++
62 55 files changed, 287 insertions(+), 173 deletions(-)
63
64diff --git a/cpp/allTests.py b/cpp/allTests.py
65index 33b7d88..8a5effd 100755
66--- a/cpp/allTests.py
67+++ b/cpp/allTests.py
68@@ -25,6 +25,7 @@ from scripts import *
69 # List of all basic tests.
70 #
71 tests = [
72+
73 ("IceUtil/condvar", ["once", "win32only"]),
74 ("IceUtil/thread", ["once"]),
75 ("IceUtil/unicode", ["once"]),
76@@ -62,7 +63,7 @@ tests = [
77 ("Ice/servantLocator", ["core"]),
78 ("Ice/interceptor", ["core"]),
79 ("Ice/stringConverter", ["core"]),
80- ("Ice/udp", ["core"]),
81+ ("Ice/udp", ["core", "nofreebsdjail"]),
82 ("Ice/defaultServant", ["core"]),
83 ("Ice/defaultValue", ["core"]),
84 ("Ice/invoke", ["core", "novc6"]),
85@@ -106,8 +107,8 @@ tests = [
86 #
87 if TestUtil.isWin32() or os.getuid() == 0:
88 tests += [
89- ("IceUtil/priority", ["core", "nodarwin"]),
90- ("Ice/threadPoolPriority", ["core", "nodarwin"])
91+ ("IceUtil/priority", ["core", "nodarwin", "nofreebsd"]),
92+ ("Ice/threadPoolPriority", ["core", "nodarwin", "nofreebsd"])
93 ]
94
95 if __name__ == "__main__":
96diff --git a/cpp/include/Freeze/Map.h b/cpp/include/Freeze/Map.h
97index d8ef692..901b3bc 100644
98--- a/cpp/include/Freeze/Map.h
99+++ b/cpp/include/Freeze/Map.h
100@@ -426,7 +426,7 @@ public:
101
102 ConstIterator(MapHelper& mapHelper, const Ice::CommunicatorPtr& communicator) :
103 _helper(IteratorHelper::create(mapHelper, true)),
104- _communicator(_communicator),
105+ _communicator(communicator),
106 _refValid(false)
107 {
108 }
109diff --git a/cpp/include/Ice/Buffer.h b/cpp/include/Ice/Buffer.h
110index 9501f08..8679d03 100644
111--- a/cpp/include/Ice/Buffer.h
112+++ b/cpp/include/Ice/Buffer.h
113@@ -10,6 +10,7 @@
114 #ifndef ICEE_BUFFER_H
115 #define ICEE_BUFFER_H
116
117+#include <cstddef>
118 #include <Ice/Config.h>
119
120 #include <cstddef>
121diff --git a/cpp/include/Ice/ConnectionIF.h b/cpp/include/Ice/ConnectionIF.h
122index ca954c0..81ceb01 100644
123--- a/cpp/include/Ice/ConnectionIF.h
124+++ b/cpp/include/Ice/ConnectionIF.h
125@@ -17,13 +17,13 @@ namespace Ice
126 {
127
128 class ConnectionI;
129+ICE_API Ice::LocalObject* upCast(Ice::ConnectionI*);
130
131 }
132
133 namespace IceInternal
134 {
135
136-ICE_API Ice::LocalObject* upCast(Ice::ConnectionI*);
137
138 enum AsyncStatus
139 {
140diff --git a/cpp/include/Ice/IconvStringConverter.h b/cpp/include/Ice/IconvStringConverter.h
141index 017fb1e..68aa54b 100644
142--- a/cpp/include/Ice/IconvStringConverter.h
143+++ b/cpp/include/Ice/IconvStringConverter.h
144@@ -225,10 +225,16 @@ IconvStringConverter<charT>::cleanupKey(void* val)
145 template<typename charT> /*static*/ void
146 IconvStringConverter<charT>::close(std::pair<iconv_t, iconv_t> cdp)
147 {
148- int rs = iconv_close(cdp.first);
149+#ifndef NDEBUG
150+ int rs =
151+#endif
152+ iconv_close(cdp.first);
153 assert(rs == 0);
154
155- rs = iconv_close(cdp.second);
156+#ifndef NDEBUG
157+ rs =
158+#endif
159+ iconv_close(cdp.second);
160 assert(rs == 0);
161 }
162
163diff --git a/cpp/include/Ice/IncomingAsyncF.h b/cpp/include/Ice/IncomingAsyncF.h
164index 7d9228a..d861180 100644
165--- a/cpp/include/Ice/IncomingAsyncF.h
166+++ b/cpp/include/Ice/IncomingAsyncF.h
167@@ -28,12 +28,6 @@ namespace Ice
168
169 class AMD_Object_ice_invoke;
170 class AMD_Array_Object_ice_invoke;
171-
172-}
173-
174-namespace IceInternal
175-{
176-
177 ICE_API IceUtil::Shared* upCast(::Ice::AMD_Object_ice_invoke*);
178 ICE_API IceUtil::Shared* upCast(::Ice::AMD_Array_Object_ice_invoke*);
179
180diff --git a/cpp/include/Ice/LocalObjectF.h b/cpp/include/Ice/LocalObjectF.h
181index 69a28d3..6e613b7 100644
182--- a/cpp/include/Ice/LocalObjectF.h
183+++ b/cpp/include/Ice/LocalObjectF.h
184@@ -18,12 +18,6 @@ namespace Ice
185 {
186
187 class LocalObject;
188-
189-}
190-
191-namespace IceInternal
192-{
193-
194 ICE_API IceUtil::Shared* upCast(::Ice::LocalObject*);
195
196 }
197diff --git a/cpp/include/Ice/ObjectF.h b/cpp/include/Ice/ObjectF.h
198index eaabadd..2baff11 100644
199--- a/cpp/include/Ice/ObjectF.h
200+++ b/cpp/include/Ice/ObjectF.h
201@@ -17,19 +17,8 @@ namespace Ice
202 {
203
204 class Object;
205-
206-}
207-
208-namespace IceInternal
209-{
210-
211 ICE_API IceUtil::Shared* upCast(::Ice::Object*);
212
213-}
214-
215-namespace Ice
216-{
217-
218 typedef IceInternal::Handle< Object > ObjectPtr;
219
220 void ICE_API __patch__ObjectPtr(void*, ObjectPtr&);
221diff --git a/cpp/include/Ice/OutgoingAsyncF.h b/cpp/include/Ice/OutgoingAsyncF.h
222index 0e9398c..334ca7a 100644
223--- a/cpp/include/Ice/OutgoingAsyncF.h
224+++ b/cpp/include/Ice/OutgoingAsyncF.h
225@@ -19,13 +19,13 @@ namespace Ice
226
227 class AsyncResult;
228 typedef IceInternal::Handle<AsyncResult> AsyncResultPtr;
229+ICE_API IceUtil::Shared* upCast(::Ice::AsyncResult*);
230
231 }
232
233 namespace IceInternal
234 {
235
236-ICE_API IceUtil::Shared* upCast(::Ice::AsyncResult*);
237
238 class OutgoingAsync;
239 ICE_API IceUtil::Shared* upCast(OutgoingAsync*);
240diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h
241index 250c700..0ae9e72 100644
242--- a/cpp/include/Ice/Proxy.h
243+++ b/cpp/include/Ice/Proxy.h
244@@ -38,6 +38,8 @@ namespace Ice
245
246 class Locator;
247 class Router;
248+ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Locator*);
249+ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Router*);
250
251 }
252
253@@ -46,8 +48,6 @@ class Router;
254 namespace IceInternal
255 {
256
257-ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Locator*);
258-ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Router*);
259
260 class LocalExceptionWrapper;
261
262@@ -1172,7 +1172,7 @@ public:
263
264 TwowayCallbackNC(const TPtr& instance, bool cb, Exception excb, Sent sentcb) : CallbackNC<T>(instance, excb, sentcb)
265 {
266- checkCallback(instance, cb || excb != 0);
267+ this->checkCallback(instance, cb || excb != 0);
268 }
269 };
270
271@@ -1188,7 +1188,7 @@ public:
272
273 TwowayCallback(const TPtr& instance, bool cb, Exception excb, Sent sentcb) : Callback<T, CT>(instance, excb, sentcb)
274 {
275- checkCallback(instance, cb || excb != 0);
276+ this->checkCallback(instance, cb || excb != 0);
277 }
278 };
279
280@@ -1209,7 +1209,7 @@ public:
281 OnewayCallbackNC(const TPtr& instance, Response cb, Exception excb, Sent sentcb) :
282 CallbackNC<T>(instance, excb, sentcb), response(cb)
283 {
284- checkCallback(instance, cb != 0 || excb != 0);
285+ this->checkCallback(instance, cb != 0 || excb != 0);
286 }
287
288 virtual void __completed(const ::Ice::AsyncResultPtr& result) const
289@@ -1254,7 +1254,7 @@ public:
290 OnewayCallback(const TPtr& instance, Response cb, Exception excb, Sent sentcb) :
291 Callback<T, CT>(instance, excb, sentcb), response(cb)
292 {
293- checkCallback(instance, cb != 0 || excb != 0);
294+ this->checkCallback(instance, cb != 0 || excb != 0);
295 }
296
297 virtual void __completed(const ::Ice::AsyncResultPtr& result) const
298diff --git a/cpp/include/Ice/ProxyF.h b/cpp/include/Ice/ProxyF.h
299index 27b7ec6..67b2b05 100644
300--- a/cpp/include/Ice/ProxyF.h
301+++ b/cpp/include/Ice/ProxyF.h
302@@ -22,6 +22,11 @@ namespace Ice
303 {
304
305 class Object;
306+inline ::IceProxy::Ice::Object*
307+upCast(::IceProxy::Ice::Object* o)
308+{
309+ return o;
310+}
311
312 }
313
314@@ -34,6 +39,11 @@ namespace Ice
315 {
316
317 class Object;
318+inline ::IceDelegate::Ice::Object*
319+upCast(::IceDelegate::Ice::Object* o)
320+{
321+ return o;
322+}
323
324 }
325
326@@ -47,6 +57,12 @@ namespace Ice
327
328 class Object;
329
330+inline ::IceDelegateM::Ice::Object*
331+upCast(::IceDelegateM::Ice::Object* o)
332+{
333+ return o;
334+}
335+
336 }
337
338 }
339@@ -58,36 +74,12 @@ namespace Ice
340 {
341
342 class Object;
343-
344-}
345-
346-}
347-
348-namespace IceInternal
349-{
350-
351-inline ::IceProxy::Ice::Object*
352-upCast(::IceProxy::Ice::Object* o)
353-{
354- return o;
355-}
356-
357-inline ::IceDelegate::Ice::Object*
358-upCast(::IceDelegate::Ice::Object* o)
359-{
360- return o;
361-}
362-
363 inline ::IceDelegateD::Ice::Object*
364 upCast(::IceDelegateD::Ice::Object* o)
365 {
366 return o;
367 }
368
369-inline ::IceDelegateM::Ice::Object*
370-upCast(::IceDelegateM::Ice::Object* o)
371-{
372- return o;
373 }
374
375 }
376diff --git a/cpp/include/Ice/Stream.h b/cpp/include/Ice/Stream.h
377index 40cd611..36ab56b 100644
378--- a/cpp/include/Ice/Stream.h
379+++ b/cpp/include/Ice/Stream.h
380@@ -17,6 +17,12 @@
381 #include <Ice/Proxy.h>
382 #include <IceUtil/Shared.h>
383
384+namespace IceInternal
385+{
386+ // Forward declaration required for writer specializations.
387+ void delegateThrowMarshalException(const char*, int, const ::std::string&);
388+}
389+
390 namespace Ice
391 {
392
393@@ -45,9 +51,6 @@ enum StreamTraitType
394 StreamTraitTypeUnknown
395 };
396
397-// Forward declaration required for writer specializations.
398-class MarshalException;
399-
400 //
401 // Base trait template. This doesn't actually do anything -- we just
402 // use it as a template that we can specialize.
403@@ -542,7 +545,7 @@ struct StreamWriter<StreamTraitTypeByteEnum>
404 {
405 if(static_cast<int>(v) < 0 || static_cast<int>(v) >= StreamTrait<T>::enumLimit)
406 {
407- throw MarshalException(__FILE__, __LINE__, "enumerator out of range");
408+ IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range");
409 }
410 outS->write(static_cast<Byte>(v));
411 }
412@@ -558,7 +561,7 @@ struct StreamReader<StreamTraitTypeByteEnum>
413 inS->read(val);
414 if(val > StreamTrait<T>::enumLimit)
415 {
416- throw MarshalException(__FILE__, __LINE__, "enumerator out of range");
417+ IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range");
418 }
419 v = static_cast<T>(val);
420 }
421@@ -573,7 +576,7 @@ struct StreamWriter<StreamTraitTypeShortEnum>
422 {
423 if(static_cast<int>(v) < 0 || static_cast<int>(v) >= StreamTrait<T>::enumLimit)
424 {
425- throw MarshalException(__FILE__, __LINE__, "enumerator out of range");
426+ IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range");
427 }
428 outS->write(static_cast<Short>(v));
429 }
430@@ -589,7 +592,7 @@ struct StreamReader<StreamTraitTypeShortEnum>
431 inS->read(val);
432 if(val < 0 || val > StreamTrait<T>::enumLimit)
433 {
434- throw MarshalException(__FILE__, __LINE__, "enumerator out of range");
435+ IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range");
436 }
437 v = static_cast<T>(val);
438 }
439@@ -603,7 +606,7 @@ struct StreamWriter<StreamTraitTypeIntEnum>
440 {
441 if(static_cast<int>(v) < 0 || static_cast<int>(v) >= StreamTrait<T>::enumLimit)
442 {
443- throw MarshalException(__FILE__, __LINE__, "enumerator out of range");
444+ IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range");
445 }
446 outS->write(static_cast<Int>(v));
447 }
448@@ -619,7 +622,7 @@ struct StreamReader<StreamTraitTypeIntEnum>
449 inS->read(val);
450 if(val < 0 || val > StreamTrait<T>::enumLimit)
451 {
452- throw MarshalException(__FILE__, __LINE__, "enumerator out of range");
453+ IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range");
454 }
455 v = static_cast<T>(val);
456 }
457diff --git a/cpp/include/Ice/StreamF.h b/cpp/include/Ice/StreamF.h
458index d94ba2b..f114206 100644
459--- a/cpp/include/Ice/StreamF.h
460+++ b/cpp/include/Ice/StreamF.h
461@@ -19,12 +19,6 @@ namespace Ice
462
463 class InputStream;
464 class OutputStream;
465-
466-}
467-
468-namespace IceInternal
469-{
470-
471 ICE_API IceUtil::Shared* upCast(::Ice::InputStream*);
472 ICE_API IceUtil::Shared* upCast(::Ice::OutputStream*);
473
474diff --git a/cpp/include/IceUtil/Mutex.h b/cpp/include/IceUtil/Mutex.h
475index 2726c74..5d72113 100644
476--- a/cpp/include/IceUtil/Mutex.h
477+++ b/cpp/include/IceUtil/Mutex.h
478@@ -251,8 +251,11 @@ Mutex::init(MutexProtocol protocol)
479 inline
480 Mutex::~Mutex()
481 {
482+#ifndef NDEBUG
483 int rc = 0;
484- rc = pthread_mutex_destroy(&_mutex);
485+ rc =
486+#endif
487+ pthread_mutex_destroy(&_mutex);
488 assert(rc == 0);
489 }
490
491diff --git a/cpp/src/Freeze/MapDb.cpp b/cpp/src/Freeze/MapDb.cpp
492index ad573cf..397151e 100644
493--- a/cpp/src/Freeze/MapDb.cpp
494+++ b/cpp/src/Freeze/MapDb.cpp
495@@ -229,7 +229,11 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection,
496 #ifndef NDEBUG
497 bool inserted =
498 #endif
499- _indices.insert(IndexMap::value_type(indexBase->name(), indexI.get())).second;
500+ _indices.insert(IndexMap::value_type(indexBase->name(), indexI.get()))
501+#ifndef NDEBUG
502+ .second
503+#endif
504+ ;
505 assert(inserted);
506
507 indexBase->_impl = indexI.release();
508diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp
509index c7f0719..820cef8 100644
510--- a/cpp/src/Freeze/MapI.cpp
511+++ b/cpp/src/Freeze/MapI.cpp
512@@ -749,8 +749,11 @@ Freeze::IteratorHelperI::set(const Value& value)
513
514 try
515 {
516+#ifndef NDEBUG
517 int err;
518- err = _dbc->put(&dbKey, &dbValue, DB_CURRENT);
519+ err =
520+#endif
521+ _dbc->put(&dbKey, &dbValue, DB_CURRENT);
522 assert(err == 0);
523 }
524 catch(const ::DbDeadlockException& dx)
525@@ -1023,7 +1026,11 @@ Freeze::MapHelperI::MapHelperI(const ConnectionIPtr& connection,
526 #ifndef NDEBUG
527 bool inserted =
528 #endif
529- _indices.insert(IndexMap::value_type(indexBase->name(), indexBase)).second;
530+ _indices.insert(IndexMap::value_type(indexBase->name(), indexBase))
531+#ifndef NDEBUG
532+ .second
533+#endif
534+ ;
535 assert(inserted);
536 indexBase->_map = this;
537 }
538@@ -1360,8 +1367,11 @@ Freeze::MapHelperI::clear()
539 try
540 {
541 u_int32_t count;
542+#ifndef NDEBUG
543 int err;
544- err = _db->truncate(txn, &count, txn != 0 ? 0 : DB_AUTO_COMMIT);
545+ err =
546+#endif
547+ _db->truncate(txn, &count, txn != 0 ? 0 : DB_AUTO_COMMIT);
548 assert(err == 0);
549 break;
550 }
551diff --git a/cpp/src/Freeze/SharedDbEnv.cpp b/cpp/src/Freeze/SharedDbEnv.cpp
552index 1365e7f..8cadc0c 100644
553--- a/cpp/src/Freeze/SharedDbEnv.cpp
554+++ b/cpp/src/Freeze/SharedDbEnv.cpp
555@@ -336,8 +336,11 @@ void Freeze::SharedDbEnv::__decRef()
556 // Remove from map
557 //
558
559+#ifndef NDEBUG
560 size_t one;
561- one = sharedDbEnvMap->erase(key);
562+ one =
563+#endif
564+ sharedDbEnvMap->erase(key);
565 assert(one == 1);
566
567 if(sharedDbEnvMap->size() == 0)
568diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
569index a864509..2577a56 100644
570--- a/cpp/src/Ice/ConnectionI.cpp
571+++ b/cpp/src/Ice/ConnectionI.cpp
572@@ -32,7 +32,7 @@ using namespace std;
573 using namespace Ice;
574 using namespace IceInternal;
575
576-Ice::LocalObject* IceInternal::upCast(ConnectionI* p) { return p; }
577+Ice::LocalObject* Ice::upCast(ConnectionI* p) { return p; }
578
579 namespace
580 {
581@@ -601,6 +601,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncPtr& out, bool compress, b
582 }
583 catch(const LocalException& ex)
584 {
585+ status = IceInternal::AsyncStatusQueued; // this is only to apeace the compiler
586 setState(StateClosed, ex);
587 assert(_exception.get());
588 _exception->ice_throw();
589@@ -972,6 +973,7 @@ Ice::ConnectionI::flushAsyncBatchRequests(const BatchOutgoingAsyncPtr& outAsync)
590 }
591 catch(const Ice::LocalException& ex)
592 {
593+ status = IceInternal::AsyncStatusQueued; // this is only to apeace the compiler
594 setState(StateClosed, ex);
595 assert(_exception.get());
596 _exception->ice_throw();
597diff --git a/cpp/src/Ice/IncomingAsync.cpp b/cpp/src/Ice/IncomingAsync.cpp
598index ca108ee..91c0580 100644
599--- a/cpp/src/Ice/IncomingAsync.cpp
600+++ b/cpp/src/Ice/IncomingAsync.cpp
601@@ -24,7 +24,7 @@ using namespace Ice;
602 using namespace IceInternal;
603
604 IceUtil::Shared* IceInternal::upCast(IncomingAsync* p) { return p; }
605-IceUtil::Shared* IceInternal::upCast(AMD_Object_ice_invoke* p) { return p; }
606+IceUtil::Shared* Ice::upCast(AMD_Object_ice_invoke* p) { return p; }
607
608 namespace
609 {
610diff --git a/cpp/src/Ice/LocalObject.cpp b/cpp/src/Ice/LocalObject.cpp
611index 77bee3d..ee74c0b 100644
612--- a/cpp/src/Ice/LocalObject.cpp
613+++ b/cpp/src/Ice/LocalObject.cpp
614@@ -13,7 +13,7 @@ using namespace std;
615 using namespace Ice;
616 using namespace IceInternal;
617
618-IceUtil::Shared* IceInternal::upCast(LocalObject* obj) { return obj; }
619+IceUtil::Shared* Ice::upCast(LocalObject* obj) { return obj; }
620
621 bool
622 Ice::LocalObject::operator==(const LocalObject& r) const
623diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp
624index fa7793a..9705ce9 100644
625--- a/cpp/src/Ice/Object.cpp
626+++ b/cpp/src/Ice/Object.cpp
627@@ -19,7 +19,7 @@ using namespace std;
628 using namespace Ice;
629 using namespace IceInternal;
630
631-IceUtil::Shared* IceInternal::upCast(Object* p) { return p; }
632+IceUtil::Shared* Ice::upCast(Object* p) { return p; }
633
634 bool
635 Ice::Object::operator==(const Object& r) const
636diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp
637index 527d29c..d707321 100644
638--- a/cpp/src/Ice/OutgoingAsync.cpp
639+++ b/cpp/src/Ice/OutgoingAsync.cpp
640@@ -30,7 +30,7 @@ using namespace std;
641 using namespace Ice;
642 using namespace IceInternal;
643
644-IceUtil::Shared* IceInternal::upCast(AsyncResult* p) { return p; }
645+IceUtil::Shared* Ice::upCast(AsyncResult* p) { return p; }
646
647 IceUtil::Shared* IceInternal::upCast(OutgoingAsyncMessageCallback* p) { return p; }
648 IceUtil::Shared* IceInternal::upCast(OutgoingAsync* p) { return p; }
649diff --git a/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp
650index c68b3e3..db0fe72 100644
651--- a/cpp/src/Ice/ProxyFactory.cpp
652+++ b/cpp/src/Ice/ProxyFactory.cpp
653@@ -229,6 +229,7 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex,
654 }
655 else if(cnt > static_cast<int>(_retryIntervals.size()))
656 {
657+ interval = 0; // apeace compiler
658 if(traceLevels->retry >= 1)
659 {
660 Trace out(logger, traceLevels->retryCat);
661diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
662index dd28221..cc95541 100644
663--- a/cpp/src/Ice/Service.cpp
664+++ b/cpp/src/Ice/Service.cpp
665@@ -2136,17 +2136,26 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
666 //
667 // Associate stdin, stdout and stderr with /dev/null.
668 //
669+#ifndef NDEBUG
670 int fd;
671- fd = open("/dev/null", O_RDWR);
672+ fd =
673+#endif
674+ open("/dev/null", O_RDWR);
675 assert(fd == 0);
676 if(stdOut.empty())
677 {
678- fd = dup2(0, 1);
679+#ifndef NDEBUG
680+ fd =
681+#endif
682+ dup2(0, 1);
683 assert(fd == 1);
684 }
685 if(stdErr.empty())
686 {
687- fd = dup2(1, 2);
688+#ifndef NDEBUG
689+ fd =
690+#endif
691+ dup2(1, 2);
692 assert(fd == 2);
693 }
694 }
695diff --git a/cpp/src/Ice/Stream.cpp b/cpp/src/Ice/Stream.cpp
696index 9924da0..2ecdc08 100644
697--- a/cpp/src/Ice/Stream.cpp
698+++ b/cpp/src/Ice/Stream.cpp
699@@ -8,10 +8,19 @@
700 // **********************************************************************
701
702 #include <Ice/Stream.h>
703+#include <Ice/LocalException.h>
704
705 using namespace std;
706 using namespace Ice;
707 using namespace IceInternal;
708
709-IceUtil::Shared* IceInternal::upCast(InputStream* p) { return p; }
710-IceUtil::Shared* IceInternal::upCast(OutputStream* p) { return p; }
711+IceUtil::Shared* Ice::upCast(InputStream* p) { return p; }
712+IceUtil::Shared* Ice::upCast(OutputStream* p) { return p; }
713+
714+namespace IceInternal
715+{
716+ void delegateThrowMarshalException(const char* file, int line , const ::std::string& message)
717+ {
718+ throw Ice::MarshalException(file, line, message);
719+ }
720+}
721diff --git a/cpp/src/IceGrid/AdminCallbackRouter.cpp b/cpp/src/IceGrid/AdminCallbackRouter.cpp
722index e4d21ef..ce63c9f 100644
723--- a/cpp/src/IceGrid/AdminCallbackRouter.cpp
724+++ b/cpp/src/IceGrid/AdminCallbackRouter.cpp
725@@ -49,7 +49,12 @@ IceGrid::AdminCallbackRouter::addMapping(const string& category, const Connectio
726 #ifndef NDEBUG
727 bool inserted =
728 #endif
729- _categoryToConnection.insert(map<string, ConnectionPtr>::value_type(category, con)).second;
730+ _categoryToConnection.insert(map<string, ConnectionPtr>::value_type(category, con))
731+#ifndef NDEBUG
732+ .second
733+#endif
734+ ;
735+
736
737 assert(inserted == true);
738 }
739diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp
740index 9126c2f..0bc0111 100644
741--- a/cpp/src/IceGrid/DescriptorHelper.cpp
742+++ b/cpp/src/IceGrid/DescriptorHelper.cpp
743@@ -198,15 +198,6 @@ updateSeqElts(const Seq& seq, const Seq& update, const Ice::StringSeq& remove, G
744 return result;
745 }
746
747-template<typename Dict> Dict
748-getDictUpdatedElts(const Dict& ldict, const Dict& rdict)
749-{
750-#if defined(_MSC_VER) && (_MSC_VER < 1300)
751- return getDictUpdatedEltsWithEq(ldict, rdict, equal_to<Dict::mapped_type>());
752-#else
753- return getDictUpdatedEltsWithEq(ldict, rdict, equal_to<typename Dict::mapped_type>());
754-#endif
755-}
756
757 template<typename EqFunc, typename Dict> Dict
758 getDictUpdatedEltsWithEq(const Dict& ldict, const Dict& rdict, EqFunc eq)
759@@ -223,6 +214,16 @@ getDictUpdatedEltsWithEq(const Dict& ldict, const Dict& rdict, EqFunc eq)
760 return result;
761 }
762
763+template<typename Dict> Dict
764+getDictUpdatedElts(const Dict& ldict, const Dict& rdict)
765+{
766+#if defined(_MSC_VER) && (_MSC_VER < 1300)
767+ return getDictUpdatedEltsWithEq(ldict, rdict, equal_to<Dict::mapped_type>());
768+#else
769+ return getDictUpdatedEltsWithEq(ldict, rdict, equal_to<typename Dict::mapped_type>());
770+#endif
771+}
772+
773 template <typename Dict> Ice::StringSeq
774 getDictRemovedElts(const Dict& ldict, const Dict& rdict)
775 {
776diff --git a/cpp/src/IceGrid/ReplicaCache.cpp b/cpp/src/IceGrid/ReplicaCache.cpp
777index 53ad03e..154853d 100644
778--- a/cpp/src/IceGrid/ReplicaCache.cpp
779+++ b/cpp/src/IceGrid/ReplicaCache.cpp
780@@ -40,7 +40,7 @@ ReplicaCache::add(const string& name, const ReplicaSessionIPtr& session)
781 Lock sync(*this);
782
783 ReplicaEntryPtr entry;
784- while(entry = getImpl(name))
785+ while((entry = getImpl(name)))
786 {
787 ReplicaSessionIPtr session = entry->getSession();
788 if(session->isDestroyed())
789diff --git a/cpp/src/IceGrid/SessionI.h b/cpp/src/IceGrid/SessionI.h
790index 3c67e20..f5c1b2e 100644
791--- a/cpp/src/IceGrid/SessionI.h
792+++ b/cpp/src/IceGrid/SessionI.h
793@@ -35,7 +35,7 @@ typedef IceUtil::Handle<Allocatable> AllocatablePtr;
794 class SessionI;
795 typedef IceUtil::Handle<SessionI> SessionIPtr;
796
797-class BaseSessionI : virtual Ice::Object, public IceUtil::Mutex
798+class BaseSessionI : virtual public Ice::Object, public IceUtil::Mutex
799 {
800 public:
801
802diff --git a/cpp/src/IceSSL/Instance.cpp b/cpp/src/IceSSL/Instance.cpp
803index 5eb4c58..585620c 100644
804--- a/cpp/src/IceSSL/Instance.cpp
805+++ b/cpp/src/IceSSL/Instance.cpp
806@@ -38,7 +38,7 @@ using namespace std;
807 using namespace Ice;
808 using namespace IceSSL;
809
810-IceUtil::Shared* IceInternal::upCast(IceSSL::Instance* p) { return p; }
811+IceUtil::Shared* IceSSL::upCast(IceSSL::Instance* p) { return p; }
812
813 namespace
814 {
815diff --git a/cpp/src/IceSSL/InstanceF.h b/cpp/src/IceSSL/InstanceF.h
816index d08a3a9..b03d995 100644
817--- a/cpp/src/IceSSL/InstanceF.h
818+++ b/cpp/src/IceSSL/InstanceF.h
819@@ -18,13 +18,13 @@ namespace IceSSL
820 {
821
822 class Instance;
823+IceUtil::Shared* upCast(IceSSL::Instance*);
824
825 }
826
827 namespace IceInternal
828 {
829
830-IceUtil::Shared* upCast(IceSSL::Instance*);
831
832 }
833
834diff --git a/cpp/src/IceSSL/TrustManager.cpp b/cpp/src/IceSSL/TrustManager.cpp
835index 0ec6e28..c4549b9 100644
836--- a/cpp/src/IceSSL/TrustManager.cpp
837+++ b/cpp/src/IceSSL/TrustManager.cpp
838@@ -20,7 +20,7 @@
839 using namespace std;
840 using namespace IceSSL;
841
842-IceUtil::Shared* IceInternal::upCast(IceSSL::TrustManager* p) { return p; }
843+IceUtil::Shared* IceSSL::upCast(IceSSL::TrustManager* p) { return p; }
844
845 TrustManager::TrustManager(const Ice::CommunicatorPtr& communicator) :
846 _communicator(communicator)
847diff --git a/cpp/src/IceSSL/TrustManagerF.h b/cpp/src/IceSSL/TrustManagerF.h
848index 346775c..e1af0d1 100644
849--- a/cpp/src/IceSSL/TrustManagerF.h
850+++ b/cpp/src/IceSSL/TrustManagerF.h
851@@ -18,13 +18,13 @@ namespace IceSSL
852 {
853
854 class TrustManager;
855+IceUtil::Shared* upCast(IceSSL::TrustManager*);
856
857 }
858
859 namespace IceInternal
860 {
861
862-IceUtil::Shared* upCast(IceSSL::TrustManager*);
863
864 }
865
866diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp
867index fc7e19c..63f6b44 100644
868--- a/cpp/src/IceSSL/Util.cpp
869+++ b/cpp/src/IceSSL/Util.cpp
870@@ -175,7 +175,7 @@ convertDH(unsigned char* p, int plen, unsigned char* g, int glen)
871 return dh;
872 }
873
874-IceUtil::Shared* IceInternal::upCast(IceSSL::DHParams* p) { return p; }
875+IceUtil::Shared* IceSSL::upCast(IceSSL::DHParams* p) { return p; }
876
877 IceSSL::DHParams::DHParams() :
878 _dh512(0), _dh1024(0), _dh2048(0), _dh4096(0)
879diff --git a/cpp/src/IceSSL/UtilF.h b/cpp/src/IceSSL/UtilF.h
880index 4c06e1f..5bad4c8 100644
881--- a/cpp/src/IceSSL/UtilF.h
882+++ b/cpp/src/IceSSL/UtilF.h
883@@ -21,13 +21,13 @@ namespace IceSSL
884 {
885
886 class DHParams;
887+IceUtil::Shared* upCast(IceSSL::DHParams*);
888
889 }
890
891 namespace IceInternal
892 {
893
894-IceUtil::Shared* upCast(IceSSL::DHParams*);
895
896 }
897
898diff --git a/cpp/src/IceStorm/NodeI.cpp b/cpp/src/IceStorm/NodeI.cpp
899index 0c9511e..b9788f4 100644
900--- a/cpp/src/IceStorm/NodeI.cpp
901+++ b/cpp/src/IceStorm/NodeI.cpp
902@@ -18,11 +18,6 @@ using namespace std;
903 namespace
904 {
905
906-bool operator==(const GroupNodeInfo& info, int id)
907-{
908- return info.id == id;
909-}
910-
911 class CheckTask : public IceUtil::TimerTask
912 {
913 const NodeIPtr _node;
914diff --git a/cpp/src/IceUtil/Cond.cpp b/cpp/src/IceUtil/Cond.cpp
915index 6a8bd3d..a18fd61 100644
916--- a/cpp/src/IceUtil/Cond.cpp
917+++ b/cpp/src/IceUtil/Cond.cpp
918@@ -330,8 +330,11 @@ IceUtil::Cond::Cond()
919
920 IceUtil::Cond::~Cond()
921 {
922+#ifndef NDEBUG
923 int rc = 0;
924- rc = pthread_cond_destroy(&_cond);
925+ rc =
926+#endif
927+ pthread_cond_destroy(&_cond);
928 assert(rc == 0);
929 }
930
931diff --git a/cpp/src/IceUtil/CountDownLatch.cpp b/cpp/src/IceUtil/CountDownLatch.cpp
932index bd60766..86e8d2c 100644
933--- a/cpp/src/IceUtil/CountDownLatch.cpp
934+++ b/cpp/src/IceUtil/CountDownLatch.cpp
935@@ -44,10 +44,16 @@ IceUtilInternal::CountDownLatch::~CountDownLatch()
936 #ifdef _WIN32
937 CloseHandle(_event);
938 #else
939+#ifndef NDEBUG
940 int rc = 0;
941- rc = pthread_mutex_destroy(&_mutex);
942+ rc =
943+#endif
944+ pthread_mutex_destroy(&_mutex);
945 assert(rc == 0);
946- rc = pthread_cond_destroy(&_cond);
947+#ifndef NDEBUG
948+ rc =
949+#endif
950+ pthread_cond_destroy(&_cond);
951 assert(rc == 0);
952 #endif
953 }
954diff --git a/cpp/src/IceUtil/CtrlCHandler.cpp b/cpp/src/IceUtil/CtrlCHandler.cpp
955index f4d150c..575537a 100644
956--- a/cpp/src/IceUtil/CtrlCHandler.cpp
957+++ b/cpp/src/IceUtil/CtrlCHandler.cpp
958@@ -219,18 +219,27 @@ CtrlCHandler::CtrlCHandler(CtrlCHandlerCallback callback)
959 sigaddset(&ctrlCLikeSignals, SIGHUP);
960 sigaddset(&ctrlCLikeSignals, SIGINT);
961 sigaddset(&ctrlCLikeSignals, SIGTERM);
962- int rc = pthread_sigmask(SIG_BLOCK, &ctrlCLikeSignals, 0);
963+#ifndef NDEBUG
964+ int rc =
965+#endif
966+ pthread_sigmask(SIG_BLOCK, &ctrlCLikeSignals, 0);
967 assert(rc == 0);
968
969 // Joinable thread
970- rc = pthread_create(&_tid, 0, sigwaitThread, 0);
971+#ifndef NDEBUG
972+ rc =
973+#endif
974+ pthread_create(&_tid, 0, sigwaitThread, 0);
975 assert(rc == 0);
976 }
977 }
978
979 CtrlCHandler::~CtrlCHandler()
980 {
981- int rc = pthread_cancel(_tid);
982+#ifndef NDEBUG
983+ int rc =
984+#endif
985+ pthread_cancel(_tid);
986 assert(rc == 0);
987 #if defined(__APPLE__)
988 //
989@@ -241,7 +250,10 @@ CtrlCHandler::~CtrlCHandler()
990 //assert(rc == 0); For some reaosns, this assert is sometime triggered
991 #endif
992 void* status = 0;
993- rc = pthread_join(_tid, &status);
994+#ifndef NDEBUG
995+ rc =
996+#endif
997+ pthread_join(_tid, &status);
998 assert(rc == 0);
999 #if !defined(__APPLE__)
1000 assert(status == PTHREAD_CANCELED);
1001diff --git a/cpp/src/IceUtil/FileUtil.cpp b/cpp/src/IceUtil/FileUtil.cpp
1002index 1c1b974..b861e19 100644
1003--- a/cpp/src/IceUtil/FileUtil.cpp
1004+++ b/cpp/src/IceUtil/FileUtil.cpp
1005@@ -26,6 +26,10 @@
1006 # include <dir.h>
1007 #endif
1008
1009+#if defined(__FreeBSD__) || defined(__linux)
1010+# include <unistd.h>
1011+#endif
1012+
1013 using namespace std;
1014
1015 //
1016diff --git a/cpp/src/IceUtil/RecMutex.cpp b/cpp/src/IceUtil/RecMutex.cpp
1017index f3b1376..ce719ad 100644
1018--- a/cpp/src/IceUtil/RecMutex.cpp
1019+++ b/cpp/src/IceUtil/RecMutex.cpp
1020@@ -148,8 +148,11 @@ IceUtil::RecMutex::init(const MutexProtocol protocol)
1021 IceUtil::RecMutex::~RecMutex()
1022 {
1023 assert(_count == 0);
1024+#ifndef NDEBUG
1025 int rc = 0;
1026- rc = pthread_mutex_destroy(&_mutex);
1027+ rc =
1028+#endif
1029+ pthread_mutex_destroy(&_mutex);
1030 assert(rc == 0);
1031 }
1032
1033@@ -196,8 +199,11 @@ IceUtil::RecMutex::unlock() const
1034 {
1035 if(--_count == 0)
1036 {
1037+#ifndef NDEBUG
1038 int rc = 0; // Prevent warnings when NDEBUG is defined.
1039- rc = pthread_mutex_unlock(&_mutex);
1040+ rc =
1041+#endif
1042+ pthread_mutex_unlock(&_mutex);
1043 assert(rc == 0);
1044 }
1045 }
1046diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
1047index f0d6a51..0d5024d 100644
1048--- a/cpp/src/Slice/CPlusPlusUtil.cpp
1049+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
1050@@ -631,7 +631,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
1051 string scope = fixKwd(cl->scope());
1052 if(marshal)
1053 {
1054- out << nl << stream << deref << "write(::Ice::ObjectPtr(::IceInternal::upCast(" << fixedParam
1055+ out << nl << stream << deref << "write(::Ice::ObjectPtr(" << scope << "upCast(" << fixedParam
1056 << ".get())));";
1057 }
1058 else
1059@@ -649,7 +649,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
1060 string scope = fixKwd(px->_class()->scope());
1061 if(marshal)
1062 {
1063- out << nl << stream << deref << "write(::Ice::ObjectPrx(::IceInternal::upCast(" << fixedParam
1064+ out << nl << stream << deref << "write(::Ice::ObjectPrx(::IceProxy" << scope << "upCast(" << fixedParam
1065 << ".get())));";
1066 }
1067 else
1068diff --git a/cpp/src/Slice/FileTracker.cpp b/cpp/src/Slice/FileTracker.cpp
1069index af009fe..3966934 100644
1070--- a/cpp/src/Slice/FileTracker.cpp
1071+++ b/cpp/src/Slice/FileTracker.cpp
1072@@ -17,6 +17,10 @@
1073 # include <direct.h>
1074 #endif
1075
1076+#if defined(__FreeBSD__) || defined(__linux)
1077+# include <unistd.h>
1078+#endif
1079+
1080 using namespace std;
1081
1082 Slice::FileException::FileException(const char* file, int line, const string& r) :
1083diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
1084index 8ec5aa5..63d6c83 100644
1085--- a/cpp/src/slice2cpp/Gen.cpp
1086+++ b/cpp/src/slice2cpp/Gen.cpp
1087@@ -1952,8 +1952,10 @@ Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p)
1088 }
1089
1090 string name = fixKwd(p->name());
1091+ string scoped = fixKwd(p->scoped());
1092
1093 H << sp << nl << "class " << name << ';';
1094+ H << nl << _dllExport << "::IceProxy::Ice::Object* upCast(::IceProxy" << scoped << "*);";
1095 }
1096
1097 Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport) :
1098@@ -3699,10 +3701,22 @@ void
1099 Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDeclPtr& p)
1100 {
1101 string name = fixKwd(p->name());
1102+ string scoped = fixKwd(p->scoped());
1103
1104 H << sp << nl << "class " << name << ';';
1105 H << nl << "bool operator==(const " << name << "&, const " << name << "&);";
1106 H << nl << "bool operator<(const " << name << "&, const " << name << "&);";
1107+
1108+ H << sp;
1109+
1110+ if(!p->isLocal())
1111+ {
1112+ H << nl << _dllExport << "::Ice::Object* upCast(" << scoped << "*);";
1113+ }
1114+ else
1115+ {
1116+ H << nl << _dllExport << "::Ice::LocalObject* upCast(" << scoped << "*);";
1117+ }
1118 }
1119
1120 void
1121@@ -4930,13 +4944,13 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref
1122 {
1123 if((BuiltinPtr::dynamicCast(p) && BuiltinPtr::dynamicCast(p)->kind() == Builtin::KindObject)
1124 || ClassDeclPtr::dynamicCast(p))
1125- {
1126- C << nl << "if(" << prefix << name << ')';
1127+ { C << nl << "if(" << prefix << name << ')';
1128 C << sb;
1129 ClassDeclPtr decl = ClassDeclPtr::dynamicCast(p);
1130 if(decl)
1131 {
1132- C << nl << "::IceInternal::upCast(" << prefix << name << ".get())->__addObject(_c);";
1133+ string scope = fixKwd(decl->scope());
1134+ C << nl << scope << "upCast(" << prefix << name << ".get())->__addObject(_c);";
1135 }
1136 else
1137 {
1138@@ -4999,9 +5013,10 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi
1139 ClassDeclPtr decl = ClassDeclPtr::dynamicCast(p);
1140 if(decl)
1141 {
1142- C << nl << "if(" << "::IceInternal::upCast(" << prefix << name << ".get())->__usesClasses())";
1143+ string scope = fixKwd(decl->scope());
1144+ C << nl << "if(" << scope << "upCast(" << prefix << name << ".get())->__usesClasses())";
1145 C << sb;
1146- C << nl << "::IceInternal::upCast(" << prefix << name << ".get())->__decRefUnsafe();";
1147+ C << nl << scope << "upCast(" << prefix << name << ".get())->__decRefUnsafe();";
1148 C << nl << prefix << name << ".__clearHandleUnsafe();";
1149
1150 }
1151@@ -5637,40 +5652,30 @@ Slice::Gen::IceInternalVisitor::visitClassDecl(const ClassDeclPtr& p)
1152 {
1153 string scoped = fixKwd(p->scoped());
1154
1155- H << sp;
1156-
1157- if(!p->isLocal())
1158- {
1159- H << nl << _dllExport << "::Ice::Object* upCast(" << scoped << "*);";
1160- H << nl << _dllExport << "::IceProxy::Ice::Object* upCast(::IceProxy" << scoped << "*);";
1161- }
1162- else
1163- {
1164- H << nl << _dllExport << "::Ice::LocalObject* upCast(" << scoped << "*);";
1165- }
1166 }
1167
1168 bool
1169 Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p)
1170 {
1171 string scoped = fixKwd(p->scoped());
1172+ string scope = fixKwd(p->scope());
1173
1174 C << sp;
1175 if(!p->isLocal())
1176 {
1177 C << nl
1178 << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ")
1179- << "::Ice::Object* IceInternal::upCast(" << scoped << "* p) { return p; }";
1180+ << "::Ice::Object* " << scope << "upCast(" << scoped << "* p) { return p; }";
1181 C << nl
1182 << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ")
1183- << "::IceProxy::Ice::Object* IceInternal::upCast(::IceProxy" << scoped
1184+ << "::IceProxy::Ice::Object* IceProxy" << scope << "upCast(::IceProxy" << scoped
1185 << "* p) { return p; }";
1186 }
1187 else
1188 {
1189 C << nl
1190 << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ")
1191- << "::Ice::LocalObject* IceInternal::upCast(" << scoped << "* p) { return p; }";
1192+ << "::Ice::LocalObject* " << scope << "upCast(" << scoped << "* p) { return p; }";
1193 }
1194
1195 return true;
1196diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
1197index 90d3136..dd5cf4f 100644
1198--- a/cpp/src/slice2cs/Gen.cpp
1199+++ b/cpp/src/slice2cs/Gen.cpp
1200@@ -1281,7 +1281,7 @@ Slice::CsVisitor::writeConstantValue(const TypePtr& type, const SyntaxTreeBasePt
1201 {
1202 _out << value << "F";
1203 }
1204- else if(ep = EnumPtr::dynamicCast(type))
1205+ else if((ep = EnumPtr::dynamicCast(type)))
1206 {
1207 string enumName = fixId(ep->scoped());
1208 string::size_type colon = value.rfind(':');
1209@@ -3914,16 +3914,6 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
1210 ClassDefPtr cl = ClassDefPtr::dynamicCast(p->container());
1211 string name = fixId(p->name(), DotNet::ICloneable, true);
1212 vector<string> params = getParams(p);
1213- bool hasOutParams = false;
1214- ParamDeclList paramList = p->parameters();
1215- for(ParamDeclList::const_iterator pli = paramList.begin(); pli != paramList.end(); ++pli)
1216- {
1217- if((*pli)->isOutParam())
1218- {
1219- hasOutParams = true;
1220- break;
1221- }
1222- }
1223
1224 _out << sp;
1225
1226diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
1227index e0ac391..5dd7226 100644
1228--- a/cpp/src/slice2java/Gen.cpp
1229+++ b/cpp/src/slice2java/Gen.cpp
1230@@ -1246,7 +1246,7 @@ Slice::JavaVisitor::writeConstantValue(Output& out, const TypePtr& type, const S
1231 {
1232 BuiltinPtr bp;
1233 EnumPtr ep;
1234- if(bp = BuiltinPtr::dynamicCast(type))
1235+ if((bp = BuiltinPtr::dynamicCast(type)))
1236 {
1237 switch(bp->kind())
1238 {
1239@@ -1349,7 +1349,7 @@ Slice::JavaVisitor::writeConstantValue(Output& out, const TypePtr& type, const S
1240 }
1241
1242 }
1243- else if(ep = EnumPtr::dynamicCast(type))
1244+ else if((ep = EnumPtr::dynamicCast(type)))
1245 {
1246 string val = value;
1247 string::size_type pos = val.rfind(':');
1248diff --git a/cpp/test/Glacier2/ssl/Server.cpp b/cpp/test/Glacier2/ssl/Server.cpp
1249index 4fb14f5..1b0c6a5 100644
1250--- a/cpp/test/Glacier2/ssl/Server.cpp
1251+++ b/cpp/test/Glacier2/ssl/Server.cpp
1252@@ -31,9 +31,15 @@ void testContext(bool ssl, const Ice::Context& context)
1253 test(ctx["_con.type"] == "ssl");
1254 test(ctx["_con.localPort"] == "12348");
1255 }
1256- test(ctx["_con.localAddress"] == "127.0.0.1");
1257+ if (!inFreeBSDJail())
1258+ {
1259+ test(ctx["_con.localAddress"] == "127.0.0.1");
1260+ }
1261 test(ctx["_con.remotePort"] != "");
1262- test(ctx["_con.remoteAddress"] == "127.0.0.1");
1263+ if (!inFreeBSDJail())
1264+ {
1265+ test(ctx["_con.remoteAddress"] == "127.0.0.1");
1266+ }
1267 }
1268
1269 }
1270@@ -99,7 +105,7 @@ public:
1271 }
1272
1273 virtual void
1274- ice_ping(const Ice::Current& current)
1275+ ice_ping(const Ice::Current& current) const
1276 {
1277 testContext(_ssl, current.ctx);
1278 }
1279@@ -133,8 +139,11 @@ public:
1280 {
1281 testContext(true, current.ctx);
1282
1283- test(info.remoteHost == "127.0.0.1");
1284- test(info.localHost == "127.0.0.1");
1285+ if (!inFreeBSDJail())
1286+ {
1287+ test(info.remoteHost == "127.0.0.1");
1288+ test(info.localHost == "127.0.0.1");
1289+ }
1290 test(info.localPort == 12348);
1291
1292 try
1293diff --git a/cpp/test/Ice/background/EndpointI.h b/cpp/test/Ice/background/EndpointI.h
1294index f38a280..4d35f7d 100644
1295--- a/cpp/test/Ice/background/EndpointI.h
1296+++ b/cpp/test/Ice/background/EndpointI.h
1297@@ -48,7 +48,7 @@ protected:
1298
1299 virtual Ice::Int hashInit() const;
1300 #if !defined(_MSC_VER) || _MSC_VER > 1300
1301- using IceInternal::EndpointI::connectors;
1302+ using ::IceInternal::EndpointI::connectors;
1303 #endif
1304
1305 private:
1306diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp
1307index bf66fa9..9907e6b 100644
1308--- a/cpp/test/Ice/custom/AllTests.cpp
1309+++ b/cpp/test/Ice/custom/AllTests.cpp
1310@@ -1384,7 +1384,8 @@ public:
1311 const ::Test::ClassStructSeq& seq,
1312 const InParamPtr& cookie)
1313 {
1314- pair< ::Test::ClassStructPtr, ::Test::ClassStructSeq> in = getIn(in, cookie);
1315+ pair< ::Test::ClassStructPtr, ::Test::ClassStructSeq> in;
1316+ in = getIn(in, cookie);
1317 test(ret == in.first);
1318 test(cs1 == in.first);
1319 test(seq == in.second);
1320@@ -1432,7 +1433,8 @@ public:
1321
1322 void throwExcept1(const Ice::AsyncResultPtr& result)
1323 {
1324- wstring in = getIn(in, InParamPtr::dynamicCast(result->getCookie()));
1325+ wstring in;
1326+ in = getIn(in, InParamPtr::dynamicCast(result->getCookie()));
1327 try
1328 {
1329 Test1::WstringClassPrx t = Test1::WstringClassPrx::uncheckedCast(result->getProxy());
1330@@ -1451,7 +1453,8 @@ public:
1331
1332 void throwExcept2(const Ice::AsyncResultPtr& result)
1333 {
1334- wstring in = getIn(in, InParamPtr::dynamicCast(result->getCookie()));
1335+ wstring in;
1336+ in = getIn(in, InParamPtr::dynamicCast(result->getCookie()));
1337 try
1338 {
1339 Test2::WstringClassPrx t = Test2::WstringClassPrx::uncheckedCast(result->getProxy());
1340diff --git a/cpp/test/Ice/info/AllTests.cpp b/cpp/test/Ice/info/AllTests.cpp
1341index 3e9c229..7f92b7f 100644
1342--- a/cpp/test/Ice/info/AllTests.cpp
1343+++ b/cpp/test/Ice/info/AllTests.cpp
1344@@ -141,9 +141,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
1345 test(info->adapterName.empty());
1346 test(info->localPort > 0);
1347 test(info->remotePort == 12010);
1348- test(info->remoteAddress == defaultHost);
1349- test(info->localAddress == defaultHost);
1350-
1351+ if (!inFreeBSDJail())
1352+ {
1353+ test(info->remoteAddress == defaultHost);
1354+ test(info->localAddress == defaultHost);
1355+ }
1356 ostringstream os;
1357
1358 Ice::Context ctx = testIntf->getConnectionInfoAsContext();
1359@@ -163,8 +165,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
1360 test(info->adapterName.empty());
1361 test(info->localPort > 0);
1362 test(info->remotePort == 12010);
1363- test(info->remoteAddress ==defaultHost);
1364- test(info->localAddress == defaultHost);
1365+ if (!inFreeBSDJail())
1366+ {
1367+ test(info->remoteAddress == defaultHost);
1368+ test(info->localAddress == defaultHost);
1369+ }
1370 }
1371 cout << "ok" << endl;
1372
1373diff --git a/cpp/test/Ice/properties/run.py b/cpp/test/Ice/properties/run.py
1374index 18f78f0..955295e 100755
1375--- a/cpp/test/Ice/properties/run.py
1376+++ b/cpp/test/Ice/properties/run.py
1377@@ -26,7 +26,7 @@ client = os.path.join(os.getcwd(), "client")
1378 #
1379 # Write config
1380 #
1381-configPath = u"./config/中国_client.config"
1382+configPath = u"./config/中国_client.config".encode("utf-8")
1383
1384 TestUtil.createConfig(configPath,
1385 ["# Automatically generated by Ice test driver.",
1386diff --git a/cpp/test/IceUtil/unicode/Client.cpp b/cpp/test/IceUtil/unicode/Client.cpp
1387index 6370c9e..c5b73fb 100644
1388--- a/cpp/test/IceUtil/unicode/Client.cpp
1389+++ b/cpp/test/IceUtil/unicode/Client.cpp
1390@@ -15,6 +15,10 @@
1391 # include <io.h>
1392 #endif
1393
1394+#if defined(__FreeBSD__) || defined(__linux)
1395+# include <unistd.h>
1396+#endif
1397+
1398 using namespace IceUtil;
1399 using namespace std;
1400
1401diff --git a/cpp/test/Slice/keyword/Client.cpp b/cpp/test/Slice/keyword/Client.cpp
1402index 0714a17..edcfe00 100644
1403--- a/cpp/test/Slice/keyword/Client.cpp
1404+++ b/cpp/test/Slice/keyword/Client.cpp
1405@@ -73,6 +73,9 @@ public:
1406 virtual void ice_response(Ice::Int) {}
1407 virtual void ice_exception(const ::Ice::Exception&) {}
1408 };
1409+
1410+template<typename T>
1411+void unused(T const &) { }
1412
1413 //
1414 // This section of the test is present to ensure that the C++ types
1415@@ -86,6 +89,7 @@ testtypes()
1416
1417 _cpp_and::_cpp_auto b;
1418 b._cpp_default = 0;
1419+ unused(b);
1420
1421 _cpp_and::deletePtr c = new _cpp_and::_cpp_delete();
1422 c->_cpp_else = "";
1423diff --git a/cpp/test/include/TestCommon.h b/cpp/test/include/TestCommon.h
1424index 651a885..ca603d4 100644
1425--- a/cpp/test/include/TestCommon.h
1426+++ b/cpp/test/include/TestCommon.h
1427@@ -17,6 +17,22 @@
1428 #include <stdlib.h>
1429 #endif
1430
1431+#if defined(__FreeBSD__)
1432+# include <sys/types.h>
1433+# include <sys/sysctl.h>
1434+inline bool inFreeBSDJail()
1435+{
1436+ int jailed;
1437+ size_t size = sizeof(jailed);
1438+ return (sysctlbyname("security.jail.jailed", &jailed, &size, NULL, 0) != -1 || jailed);
1439+}
1440+#else
1441+inline bool inFreeBSDJail()
1442+{
1443+ return false;
1444+}
1445+#endif
1446+
1447 void
1448 inline testFailed(const char* expr, const char* file, unsigned int line)
1449 {
1450diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
1451index e02da06..9b5f497 100755
1452--- a/scripts/TestUtil.py
1453+++ b/scripts/TestUtil.py
1454@@ -74,6 +74,25 @@ def isDarwin():
1455 def isLinux():
1456 return sys.platform.startswith("linux")
1457
1458+def isFreeBSD():
1459+ return sys.platform.startswith("freebsd")
1460+
1461+def sysctl(key):
1462+ p = subprocess.Popen("sysctl "+key, shell=1, stdout=subprocess.PIPE)
1463+ try:
1464+ result = p.communicate()[0].strip().split()[1]
1465+ except IndexError:
1466+ return 0
1467+ if sys.version_info >= (3,):
1468+ result = str(result, sys.stdout.encoding)
1469+ try:
1470+ return int(result)
1471+ except ValueError:
1472+ return result
1473+
1474+def isFreeBSDJail():
1475+ return isFreeBSD() and sysctl("security.jail.jailed")
1476+
1477 def getCppCompiler():
1478 compiler = ""
1479 if os.environ.get("CPP_COMPILER", "") != "":
1480@@ -1590,7 +1609,15 @@ def runTests(start, expanded, num = 0, script = False):
1481 if isDarwin() and "nodarwin" in config:
1482 print "%s*** test not supported under Darwin%s" % (prefix, suffix)
1483 continue
1484+
1485+ if isFreeBSD() and "nofreebsd" in config:
1486+ print "%s*** test not supported under FreeBSD%s" % (prefix, suffix)
1487+ continue
1488
1489+ if isFreeBSDJail() and "nofreebsdjail" in config:
1490+ print "%s*** test not supported within a FreeBSD Jail%s" % (prefix, suffix)
1491+ continue
1492+
1493 if not isWin32() and "win32only" in config:
1494 print "%s*** test only supported under Win32%s" % (prefix, suffix)
1495 continue
1496--
14971.7.10.2
1498
This page took 0.270568 seconds and 4 git commands to generate.