Commit 30156279 authored by Eric Cano's avatar Eric Cano
Browse files

Comments improvement.

Added explaination for more bare dynamic casts to reference. Also added
cast to void for the result (to prevent compilation errors).
parent 4e73b4b1
...@@ -239,7 +239,9 @@ throw (castor::tape::Exception) { ...@@ -239,7 +239,9 @@ throw (castor::tape::Exception) {
} catch (std::bad_cast) {} } catch (std::bad_cast) {}
// 3b) Try again with NoMoreFiles (and this time failure is fatal) // 3b) Try again with NoMoreFiles (and this time failure is fatal)
try { try {
dynamic_cast<tapegateway::NoMoreFiles &>(*resp); // As in reportEndOfSession, we are only interested in receiving a
// NoMoreFiles message. (void) for picky compilers
(void)dynamic_cast<tapegateway::NoMoreFiles &>(*resp);
return NULL; return NULL;
} catch (std::bad_cast) { } catch (std::bad_cast) {
throw UnexpectedResponse(resp.get(), throw UnexpectedResponse(resp.get(),
...@@ -268,7 +270,9 @@ tapegateway::FileMigrationReportList & migrationReport, ...@@ -268,7 +270,9 @@ tapegateway::FileMigrationReportList & migrationReport,
// EndNotificationErrorReport. // EndNotificationErrorReport.
// 3a) Handle the NotificationAcknowledge // 3a) Handle the NotificationAcknowledge
try { try {
dynamic_cast<tapegateway::NotificationAcknowledge &>(*resp); // As in reportEndOfSession, we are only interested in receiving a
// NotificationAcknowledge message. (void) for picky compilers
(void)dynamic_cast<tapegateway::NotificationAcknowledge &>(*resp);
return; return;
} catch (std::bad_cast) {} } catch (std::bad_cast) {}
// 3b) Handle the end notification error report and turn it into a bare // 3b) Handle the end notification error report and turn it into a bare
...@@ -313,7 +317,9 @@ throw (castor::tape::Exception) { ...@@ -313,7 +317,9 @@ throw (castor::tape::Exception) {
} catch (std::bad_cast) {} } catch (std::bad_cast) {}
// 3b) Try again with NoMoreFiles (and this time failure is fatal) // 3b) Try again with NoMoreFiles (and this time failure is fatal)
try { try {
dynamic_cast<tapegateway::NoMoreFiles &>(*resp); // As in reportEndOfSession, we are only interested in receiving a
// NoMoreFiles message. (void) for picky compilers
(void)dynamic_cast<tapegateway::NoMoreFiles &>(*resp);
return NULL; return NULL;
} catch (std::bad_cast) { } catch (std::bad_cast) {
throw UnexpectedResponse(resp.get(), throw UnexpectedResponse(resp.get(),
...@@ -336,7 +342,9 @@ RequestReport& report) throw (castor::tape::Exception) { ...@@ -336,7 +342,9 @@ RequestReport& report) throw (castor::tape::Exception) {
// EndNotificationErrorReport. // EndNotificationErrorReport.
// 3a) Handle the NotificationAcknowledge // 3a) Handle the NotificationAcknowledge
try { try {
dynamic_cast<tapegateway::NotificationAcknowledge &>(*resp); // As in reportEndOfSession, we are only interested in receiving a
// NotificationAcknowledge message. (void) for picky compilers
(void)dynamic_cast<tapegateway::NotificationAcknowledge &>(*resp);
return; return;
} catch (std::bad_cast) {} } catch (std::bad_cast) {}
// 3b) Handle the end notification error report and turn it into a bare // 3b) Handle the end notification error report and turn it into a bare
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment