diff options
author | kitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-01 23:58:32 +0000 |
---|---|---|
committer | kitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-01 23:58:32 +0000 |
commit | 3added0842c7a9ee02390804f376735581bd6d25 (patch) | |
tree | 7de2fe1865c186171fb534807168008c5cc16cb9 /TAO/examples/Simple | |
parent | 6db09dc2d2a3939ea3b92ea8c9c678077c34d3e2 (diff) | |
download | ATCD-3added0842c7a9ee02390804f376735581bd6d25.tar.gz |
ChangeLogTag: Sun Apr 1 18:47:32 2001 Krishnakumar B <kitty@cs.wustl.edu>
Diffstat (limited to 'TAO/examples/Simple')
-rw-r--r-- | TAO/examples/Simple/bank/Bank_Client_i.cpp | 23 | ||||
-rw-r--r-- | TAO/examples/Simple/chat/Server_i.cpp | 4 | ||||
-rw-r--r-- | TAO/examples/Simple/chat/server.cpp | 31 | ||||
-rw-r--r-- | TAO/examples/Simple/grid/Grid_Client_i.cpp | 4 | ||||
-rw-r--r-- | TAO/examples/Simple/grid/Grid_i.cpp | 4 |
5 files changed, 35 insertions, 31 deletions
diff --git a/TAO/examples/Simple/bank/Bank_Client_i.cpp b/TAO/examples/Simple/bank/Bank_Client_i.cpp index 75ebde8c975..a26d169690c 100644 --- a/TAO/examples/Simple/bank/Bank_Client_i.cpp +++ b/TAO/examples/Simple/bank/Bank_Client_i.cpp @@ -135,17 +135,18 @@ Bank_Client_i::test_for_overdraft (CORBA::Environment &ACE_TRY_ENV) CORBA::Float initial_bal = 100.0; const char *name = "Name"; - - Bank::Account_var acct_id = client->open (name, - initial_bal, - ACE_TRY_ENV); - acct_id->deposit (100.00, - ACE_TRY_ENV); - - acct_id->withdraw (acct_id->balance (ACE_TRY_ENV) + 20); - - client->close (acct_id.in (), - ACE_TRY_ENV); + Bank::Account_var acct_id = client->open (name, initial_bal, ACE_TRY_ENV); + ACE_CHECK; + acct_id->deposit (100.00, ACE_TRY_ENV); + ACE_CHECK; + + CORBA::Float bal = acct_id->balance (ACE_TRY_ENV); + ACE_CHECK; + + acct_id->withdraw (bal + 20); + + client->close (acct_id.in (), ACE_TRY_ENV); + ACE_CHECK; } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/examples/Simple/chat/Server_i.cpp b/TAO/examples/Simple/chat/Server_i.cpp index 5194253d1d5..4b263b9257d 100644 --- a/TAO/examples/Simple/chat/Server_i.cpp +++ b/TAO/examples/Simple/chat/Server_i.cpp @@ -95,7 +95,9 @@ Server_i::run (CORBA::Environment &ACE_TRY_ENV) "Running chat server...\n")); // Run the main event loop for the ORB. - if (this->orb_manager_.run (ACE_TRY_ENV) == -1) + int ret = this->orb_manager_.run (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + if (ret == -1) ACE_ERROR_RETURN ((LM_ERROR, "Server_i::run"), -1); diff --git a/TAO/examples/Simple/chat/server.cpp b/TAO/examples/Simple/chat/server.cpp index fe8731c6af8..fa51ab64883 100644 --- a/TAO/examples/Simple/chat/server.cpp +++ b/TAO/examples/Simple/chat/server.cpp @@ -22,26 +22,23 @@ int main (int argc, char *argv[]) { + ACE_TRY_NEW_ENV { Server_i server_i; - if (server_i.init (argc, argv, ACE_TRY_ENV) != 0) - { - ACE_TRY_CHECK; - - ACE_ERROR_RETURN ((LM_ERROR, - "\n error in init.\n"), - 1); - } - if (server_i.run (ACE_TRY_ENV) != 0) - { - ACE_TRY_CHECK; - - ACE_ERROR_RETURN ((LM_ERROR, - "\n error in run.\n"), - 1); - } + int ret = server_i.init (argc, argv, ACE_TRY_ENV); + ACE_TRY_CHECK; + if (ret != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "\n error in init.\n"), + 1); + ret = server_i.run (ACE_TRY_ENV); + ACE_TRY_CHECK; + if (ret != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "\n error in run.\n"), + 1); } ACE_CATCHANY { @@ -50,6 +47,6 @@ main (int argc, char *argv[]) return 1; } ACE_ENDTRY; - + ACE_CHECK_RETURN (0); return 0; } diff --git a/TAO/examples/Simple/grid/Grid_Client_i.cpp b/TAO/examples/Simple/grid/Grid_Client_i.cpp index a7ff9586c46..a49bde05e8c 100644 --- a/TAO/examples/Simple/grid/Grid_Client_i.cpp +++ b/TAO/examples/Simple/grid/Grid_Client_i.cpp @@ -106,8 +106,10 @@ Grid_Client_i::run (const char *name, ACE_ASSERT (ret_val == value_); - if (client.shutdown () == 1) + if (client.shutdown () == 1) { client->shutdown (ACE_TRY_ENV); + ACE_TRY_CHECK; + } ACE_UNUSED_ARG (ret_val); } ACE_CATCH (CORBA::UserException, range_ex) diff --git a/TAO/examples/Simple/grid/Grid_i.cpp b/TAO/examples/Simple/grid/Grid_i.cpp index 1a4e4cc157d..69c41677c49 100644 --- a/TAO/examples/Simple/grid/Grid_i.cpp +++ b/TAO/examples/Simple/grid/Grid_i.cpp @@ -205,5 +205,7 @@ Grid_Factory_i::make_grid (CORBA::Short width, ACE_CHECK_RETURN (Grid::_nil ()); // Register the Grid pointer. - return grid_ptr->_this (ACE_TRY_ENV); + Grid_ptr gptr = grid_ptr->_this (ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + return gptr; } |