From bd019d8c75ca663b47d047b8b92e0926acfa0ac5 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Fr=C3=A9d=C3=A9ric-Emmanuel=20PICCA?= Date: Tue, 25 Mar 2008 13:08:08 +0100 Subject: [PATCH] * trivial warning fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.5.4.4" This is a multi-part message in MIME format. --------------1.5.4.4 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Signed-off-by: Frédéric-Emmanuel PICCA --- api/cpp/client/devapi_data.cpp | 3 +++ api/cpp/log4tango/src/AppenderAttachable.cpp | 1 - api/cpp/server/attribute.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) --------------1.5.4.4 Content-Type: text/x-patch; name="bd019d8c75ca663b47d047b8b92e0926acfa0ac5.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="bd019d8c75ca663b47d047b8b92e0926acfa0ac5.diff" diff --git a/api/cpp/client/devapi_data.cpp b/api/cpp/client/devapi_data.cpp index f1ed0d0..54d838b 100644 --- a/api/cpp/client/devapi_data.cpp +++ b/api/cpp/client/devapi_data.cpp @@ -408,6 +408,9 @@ int DeviceData::get_type() case CORBA::tk_double: data_type = Tango::DEVVAR_DOUBLESTRINGARRAY; break; + + default: + break; } break; diff --git a/api/cpp/log4tango/src/AppenderAttachable.cpp b/api/cpp/log4tango/src/AppenderAttachable.cpp index af6376b..d9b0a97 100644 --- a/api/cpp/log4tango/src/AppenderAttachable.cpp +++ b/api/cpp/log4tango/src/AppenderAttachable.cpp @@ -45,7 +45,6 @@ AppenderList AppenderAttachable::get_all_appenders (void) Appender* AppenderAttachable::get_appender (const std::string& name) { threading::ScopedLock guard(_appendersMutex); - Appender* appender = 0; AppenderMapIterator it = _appenders.find(name); if (it != _appenders.end()) { return it->second; diff --git a/api/cpp/server/attribute.cpp b/api/cpp/server/attribute.cpp index e5efcfa..96537e2 100644 --- a/api/cpp/server/attribute.cpp +++ b/api/cpp/server/attribute.cpp @@ -2744,7 +2744,7 @@ void Attribute::upd_database(const Tango::AttributeConfig_3 &conf,string &dev_na if (!(str >> lg)) throw_err_format("delta_t",dev_name); const char *tmp = conf.att_alarm.delta_t.in(); - for (int loop = 0;loop < strlen(tmp);loop++) + for (unsigned int loop = 0;loop < strlen(tmp);loop++) { if (isdigit(tmp[loop]) == 0) throw_err_format("delta_t",dev_name); --------------1.5.4.4-- From db50ab99a1c812317af6342f4835013665909cd0 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Fr=C3=A9d=C3=A9ric-Emmanuel=20PICCA?= Date: Tue, 25 Mar 2008 13:30:22 +0100 Subject: [PATCH] * modification to remove a warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.5.4.4" This is a multi-part message in MIME format. --------------1.5.4.4 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Signed-off-by: Frédéric-Emmanuel PICCA --- api/cpp/client/proxy_asyn.cpp | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) --------------1.5.4.4 Content-Type: text/x-patch; name="db50ab99a1c812317af6342f4835013665909cd0.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="db50ab99a1c812317af6342f4835013665909cd0.diff" diff --git a/api/cpp/client/proxy_asyn.cpp b/api/cpp/client/proxy_asyn.cpp index 9058e08..9449747 100644 --- a/api/cpp/client/proxy_asyn.cpp +++ b/api/cpp/client/proxy_asyn.cpp @@ -262,6 +262,7 @@ long Connection::command_inout_asynch(string &command,bool faf) DeviceData Connection::command_inout_reply(long id) { + DeviceData data_out; // // Retrieve request object // @@ -293,10 +294,7 @@ DeviceData Connection::command_inout_reply(long id) desc.str(), (const char *)"Connection::command_inout_reply"); } - else - { - - DeviceData data_out; + // // Check if the reply is an exception // @@ -472,7 +470,6 @@ DeviceData Connection::command_inout_reply(long id) pasyn_ctr--; return data_out; - } } //----------------------------------------------------------------------------- --------------1.5.4.4-- From b469cd8d5e634316958ff282e5e0ebeb48b8c124 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Fr=C3=A9d=C3=A9ric-Emmanuel=20PICCA?= Date: Tue, 25 Mar 2008 13:32:02 +0100 Subject: [PATCH] * re-indentation of the code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.5.4.4" This is a multi-part message in MIME format. --------------1.5.4.4 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Signed-off-by: Frédéric-Emmanuel PICCA --- api/cpp/client/proxy_asyn.cpp | 232 ++++++++++++++++++++-------------------- 1 files changed, 116 insertions(+), 116 deletions(-) --------------1.5.4.4 Content-Type: text/x-patch; name="b469cd8d5e634316958ff282e5e0ebeb48b8c124.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="b469cd8d5e634316958ff282e5e0ebeb48b8c124.diff" diff --git a/api/cpp/client/proxy_asyn.cpp b/api/cpp/client/proxy_asyn.cpp index 9449747..a2376c0 100644 --- a/api/cpp/client/proxy_asyn.cpp +++ b/api/cpp/client/proxy_asyn.cpp @@ -299,177 +299,177 @@ DeviceData Connection::command_inout_reply(long id) // Check if the reply is an exception // - CORBA::Environment_ptr env = req.request->env(); - if (!CORBA::is_nil(env) && (env->exception() == NULL)) - { - + CORBA::Environment_ptr env = req.request->env(); + if (!CORBA::is_nil(env) && (env->exception() == NULL)) + { + // // Get received value // - const CORBA::Any *received; - CORBA::Any &dii_any = req.request->return_value(); - dii_any >>= received; - CORBA::Any *server_any = new CORBA::Any(*received); - - data_out.any = server_any; - } - else - { + const CORBA::Any *received; + CORBA::Any &dii_any = req.request->return_value(); + dii_any >>= received; + CORBA::Any *server_any = new CORBA::Any(*received); + data_out.any = server_any; + } + else + { + // // Retrieve exception and re-throw it. // - - CORBA::Exception *ex_ptr = env->exception(); + + CORBA::Exception *ex_ptr = env->exception(); // // Special treatement for timeout exception (TRANSIENT with specific minor code) // - - CORBA::TRANSIENT *tra; - if ((tra = CORBA::TRANSIENT::_downcast(ex_ptr)) != NULL) - { - if (tra->minor() == omni::TRANSIENT_CallTimedout) - { - CORBA::NVList_ptr req_arg = req.request->arguments(); - const char *cmd; - CORBA::NamedValue_ptr nv = req_arg->item(0); - *(nv->value()) >>= cmd; - char *tmp = CORBA::string_dup(cmd); - - char *cb_excep_mess = Tango::Except::print_CORBA_SystemException(tra); - - TangoSys_OMemStream desc; - desc << "Timeout (" << timeout << " mS) exceeded on device " << dev_name(); - desc << ", command " << tmp << ends; - CORBA::string_free(tmp); - - ApiUtil::instance()->get_pasyn_table()->remove_request(id); - pasyn_ctr--; - - ApiCommExcept::re_throw_exception(cb_excep_mess, - (const char *)"API_DeviceTimedOut", - desc.str(), - (const char *)"Connection::command_inout_reply()"); - } - } - - - CORBA::UnknownUserException *unk_ex; - if ((unk_ex = CORBA::UnknownUserException::_downcast(ex_ptr)) != NULL) - { - -// -// It is a UserUnknownException exception. This means that the -// server has sent a DevFailed exception -// - - const Tango::DevFailed *serv_ex; - unk_ex->exception() >>= serv_ex; - Tango::DevFailed ex(*serv_ex); - + + CORBA::TRANSIENT *tra; + if ((tra = CORBA::TRANSIENT::_downcast(ex_ptr)) != NULL) + { + if (tra->minor() == omni::TRANSIENT_CallTimedout) + { CORBA::NVList_ptr req_arg = req.request->arguments(); const char *cmd; CORBA::NamedValue_ptr nv = req_arg->item(0); *(nv->value()) >>= cmd; char *tmp = CORBA::string_dup(cmd); + char *cb_excep_mess = Tango::Except::print_CORBA_SystemException(tra); + TangoSys_OMemStream desc; - desc << "Failed to execute command_inout_asynch on device " << dev_name(); - desc << ", command " << cmd << ends; + desc << "Timeout (" << timeout << " mS) exceeded on device " << dev_name(); + desc << ", command " << tmp << ends; CORBA::string_free(tmp); - + ApiUtil::instance()->get_pasyn_table()->remove_request(id); - pasyn_ctr--; - - Except::re_throw_exception(ex, - (const char*)"API_CommandFailed", - desc.str(), - (const char*)"Connection::command_inout_reply()"); - - + pasyn_ctr--; + + ApiCommExcept::re_throw_exception(cb_excep_mess, + (const char *)"API_DeviceTimedOut", + desc.str(), + (const char *)"Connection::command_inout_reply()"); } + } + + + CORBA::UnknownUserException *unk_ex; + if ((unk_ex = CORBA::UnknownUserException::_downcast(ex_ptr)) != NULL) + { + +// +// It is a UserUnknownException exception. This means that the +// server has sent a DevFailed exception +// - CORBA::SystemException *sys_ex; - if ((sys_ex = CORBA::SystemException::_downcast(ex_ptr)) != NULL) - { + const Tango::DevFailed *serv_ex; + unk_ex->exception() >>= serv_ex; + Tango::DevFailed ex(*serv_ex); - connection_state = CONNECTION_NOTOK; - + CORBA::NVList_ptr req_arg = req.request->arguments(); + const char *cmd; + CORBA::NamedValue_ptr nv = req_arg->item(0); + *(nv->value()) >>= cmd; + char *tmp = CORBA::string_dup(cmd); + + TangoSys_OMemStream desc; + desc << "Failed to execute command_inout_asynch on device " << dev_name(); + desc << ", command " << cmd << ends; + CORBA::string_free(tmp); + + ApiUtil::instance()->get_pasyn_table()->remove_request(id); + pasyn_ctr--; + + Except::re_throw_exception(ex, + (const char*)"API_CommandFailed", + desc.str(), + (const char*)"Connection::command_inout_reply()"); + + + } + + CORBA::SystemException *sys_ex; + if ((sys_ex = CORBA::SystemException::_downcast(ex_ptr)) != NULL) + { + + connection_state = CONNECTION_NOTOK; + // // Re-throw nearly all CORBA system exceptions // - CORBA::NVList_ptr req_arg = req.request->arguments(); - const char *cmd; - CORBA::NamedValue_ptr nv = req_arg->item(0); - *(nv->value()) >>= cmd; - char *tmp = CORBA::string_dup(cmd); + CORBA::NVList_ptr req_arg = req.request->arguments(); + const char *cmd; + CORBA::NamedValue_ptr nv = req_arg->item(0); + *(nv->value()) >>= cmd; + char *tmp = CORBA::string_dup(cmd); - char *cb_excep_mess = Tango::Except::print_CORBA_SystemException(sys_ex); - + char *cb_excep_mess = Tango::Except::print_CORBA_SystemException(sys_ex); + // // Check if the exception was a connection exception // In this case, try to ping the device. // If successfull, just returns otherwise, throw the first exception // - string ex(cb_excep_mess); - string::size_type pos = ex.find("TRANSIENT_ConnectFailed"); - if (pos != string::npos) + string ex(cb_excep_mess); + string::size_type pos = ex.find("TRANSIENT_ConnectFailed"); + if (pos != string::npos) + { + try { - try - { - DeviceProxy *dev_ptr = static_cast(this); - dev_ptr->ping(); - CORBA::string_free(tmp); + DeviceProxy *dev_ptr = static_cast(this); + dev_ptr->ping(); + CORBA::string_free(tmp); // // If we arrive here, this means we have to do a re-try with a synchronous // request // - DeviceData dd_out = redo_synch_cmd(req); + DeviceData dd_out = redo_synch_cmd(req); // // Remove request from request global table. // - ApiUtil::instance()->get_pasyn_table()->remove_request(id); - pasyn_ctr--; + ApiUtil::instance()->get_pasyn_table()->remove_request(id); + pasyn_ctr--; + + return dd_out; - return dd_out; - - } - catch (Tango::DevFailed &e) {} } + catch (Tango::DevFailed &e) {} + } - TangoSys_OMemStream desc; - desc << "Failed to execute command_inout_asynch on device " << dev_name(); - desc << ", command " << cmd << ends; - CORBA::string_free(tmp); - - ApiUtil::instance()->get_pasyn_table()->remove_request(id); - pasyn_ctr--; - - ApiCommExcept::re_throw_exception(cb_excep_mess, - (const char*)"API_CommunicationFailed", - desc.str(), - (const char*)"Connection::command_inout_reply()"); - - - } - } + TangoSys_OMemStream desc; + desc << "Failed to execute command_inout_asynch on device " << dev_name(); + desc << ", command " << cmd << ends; + CORBA::string_free(tmp); + + ApiUtil::instance()->get_pasyn_table()->remove_request(id); + pasyn_ctr--; + + ApiCommExcept::re_throw_exception(cb_excep_mess, + (const char*)"API_CommunicationFailed", + desc.str(), + (const char*)"Connection::command_inout_reply()"); + + } + } + // // Remove request from request global table. // - ApiUtil::instance()->get_pasyn_table()->remove_request(id); - pasyn_ctr--; - - return data_out; + ApiUtil::instance()->get_pasyn_table()->remove_request(id); + pasyn_ctr--; + + return data_out; } //----------------------------------------------------------------------------- --------------1.5.4.4--