diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-08 03:07:20 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-08 03:07:20 +0000 |
commit | 54773ca69f32d85bca38a595533e727491d964ac (patch) | |
tree | 3e301bd0ffc4ba39e4bbe2992802e4a50ec19d8d | |
parent | 40ff81d94755884d615a43e3a5e046386117f415 (diff) | |
download | ATCD-54773ca69f32d85bca38a595533e727491d964ac.tar.gz |
ChangeLogTag:Wed Oct 7 21:44:52 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLog-98c | 11 | ||||
-rw-r--r-- | TAO/tao/Object_Table.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/try_macros.h | 21 |
3 files changed, 32 insertions, 4 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 5822ebd26e8..bd2e211a228 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,14 @@ +Wed Oct 7 21:44:52 1998 Carlos O'Ryan <coryan@cs.wustl.edu> + + * tao/try_macros.h: + Some compilers (MSVC++ 5.0) will complain about throwing an + exception and not returning a value. + + * tao/Object_Table.cpp: + The find() method on the object table was asserting that the + entry ought to be in use, in fact if the entry was free the + object was not found and we just have to return -1. + Wed Oct 07 14:49:32 1998 Nanbor Wang <nanbor@cs.wustl.edu> * orbsvcs/orbsvcs/orbsvcs[_static].dsp: Added property service diff --git a/TAO/tao/Object_Table.cpp b/TAO/tao/Object_Table.cpp index f82caa2b4be..cf43eb19523 100644 --- a/TAO/tao/Object_Table.cpp +++ b/TAO/tao/Object_Table.cpp @@ -268,10 +268,10 @@ TAO_Active_Demux_ObjTable::find (const PortableServer::ObjectId &id, if (result != 0 || index > this->tablesize_ || - this->table_[index].generation_ != generation) + this->table_[index].generation_ != generation || + this->table_[index].is_free_ != 0) return -1; - ACE_ASSERT (this->table_[index].is_free_ == 0); servant = this->table_[index].servant_; return 0; diff --git a/TAO/tao/try_macros.h b/TAO/tao/try_macros.h index 4e79b1ed7f3..8e236114ac7 100644 --- a/TAO/tao/try_macros.h +++ b/TAO/tao/try_macros.h @@ -44,13 +44,30 @@ ACE_UNUSED_ARG (VAR); #define TAO_THROW(EXCEPTION) throw EXCEPTION #define TAO_THROW_ENV(EXCEPTION, ENV) throw EXCEPTION -#define TAO_THROW_RETURN(EXCEPTION, RETURN) throw EXCEPTION +#define TAO_RETHROW throw + +#if defined (ACE_WIN32) + +// MSVC++ gives a warning if there is no return after the throw +// expression, it is possible that other compilers have the same +// problem. +#define TAO_THROW_RETURN(EXCEPTION, RETURN) do {\ + throw EXCEPTION; \ + return RETURN; } while (0) #define TAO_THROW_ENV_RETURN(EXCEPTION, ENV, RETURN) do { \ throw EXCEPTION; \ return RETURN; } while (0) -#define TAO_RETHROW throw +#define TAO_RETHROW_RETURN(RETURN) throw; \ + return RETURN + +#else + +#define TAO_THROW_RETURN(EXCEPTION, RETURN) throw EXCEPTION +#define TAO_THROW_ENV_RETURN(EXCEPTION, ENV, RETURN) throw EXCEPTION #define TAO_RETHROW_RETURN(RETURN) throw +#endif /* ACE_WIN32 */ + // #define TAO_THROW_SPEC(X) ACE_THROW_SPEC(X) #define TAO_THROW_SPEC(X) // The IDL compiler is not generating throw specs, so putting them in |