Skip to content

Commit

Permalink
Fix compiler warning [-Wunreachable-code-break]
Browse files Browse the repository at this point in the history
clang warning:

src/lstm/network.cpp:249:7:
 warning: 'break' will never be executed [-Wunreachable-code-break]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Jul 4, 2018
1 parent a24d7cf commit 6cc3564
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/lstm/network.cpp
Expand Up @@ -244,7 +244,6 @@ Network* Network::CreateFromFile(TFile* fp) {
network = new TFNetwork(stub.name_);
#else
tprintf("TensorFlow not compiled in! -DINCLUDE_TENSORFLOW\n");
return nullptr;
#endif
break;
// All variants of FullyConnected.
Expand All @@ -259,15 +258,16 @@ Network* Network::CreateFromFile(TFile* fp) {
network = new FullyConnected(stub.name_, stub.ni_, stub.no_, stub.type_);
break;
default:
return nullptr;
}
network->training_ = stub.training_;
network->needs_to_backprop_ = stub.needs_to_backprop_;
network->network_flags_ = stub.network_flags_;
network->num_weights_ = stub.num_weights_;
if (!network->DeSerialize(fp)) {
delete network;
return nullptr;
if (network) {
network->training_ = stub.training_;
network->needs_to_backprop_ = stub.needs_to_backprop_;
network->network_flags_ = stub.network_flags_;
network->num_weights_ = stub.num_weights_;
if (!network->DeSerialize(fp)) {
delete network;
network =‌ nullptr;
}
}
return network;
}
Expand Down

0 comments on commit 6cc3564

Please sign in to comment.