Merge pull request #1963 from stweil/fix

Fix some warnings from static code analyzer LGTM
This commit is contained in:
zdenop 2018-10-08 15:09:59 +02:00 committed by GitHub
commit 59ebd58fcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 13 deletions

View File

@ -69,13 +69,6 @@ extern double_VAR_H (editor_smd_scale_factor, 1.0, "Scaling for smd image");
ScrollView* bln_word_window_handle(); //return handle
void build_image_window(int width, int height);
void display_bln_lines(ScrollView window,
ScrollView::Color colour,
float scale_factor,
float y_offset,
float minx,
float maxx);
//function to call
void pgeditor_msg( //message display
const char *msg);
void pgeditor_show_point( //display coords

View File

@ -83,7 +83,7 @@ bool UNICHARMAP::contains(const char* const unichar_repr,
if (unichar_repr == nullptr || *unichar_repr == '\0') return false;
if (length <= 0 || length > UNICHAR_LEN) return false;
int index = 0;
if (index >= length || unichar_repr[index] == '\0') return false;
if (unichar_repr[index] == '\0') return false;
UNICHARMAP_NODE* current_nodes = nodes;
while (current_nodes != nullptr && index + 1 < length &&

View File

@ -1115,8 +1115,8 @@ void Classify::MasterMatcher(INT_TEMPLATES templates,
num_features, features,
&int_result, classify_adapt_feature_threshold, debug,
matcher_debug_separate_windows);
bool debug = matcher_debug_level >= 2 || classify_debug_level > 1;
ExpandShapesAndApplyCorrections(classes, debug, class_id, bottom, top,
bool is_debug = matcher_debug_level >= 2 || classify_debug_level > 1;
ExpandShapesAndApplyCorrections(classes, is_debug, class_id, bottom, top,
results[c].Rating,
final_results->BlobLength,
matcher_multiplier, norm_factors,

View File

@ -174,7 +174,7 @@ float* Plumbing::LayerLearningRatePtr(const char* id) const {
ASSERT_HOST(*next_id == ':');
return plumbing->LayerLearningRatePtr(next_id + 1);
}
if (index < 0 || index >= learning_rates_.size()) return nullptr;
if (index >= learning_rates_.size()) return nullptr;
return &learning_rates_[index];
}

View File

@ -32,7 +32,7 @@
#include <iostream>
// The current color values we use, initially white (== ScrollView::WHITE).
int rgb[3] = { 255, 255, 255 };
static int rgb[3] = { 255, 255, 255 };
class SVPaint : public SVEventHandler {
public:
@ -171,7 +171,7 @@ void SVPaint::Notify(const SVEvent* sv_event) {
else if (sv_event->type == SVET_SELECTION) { SelectionHandler(sv_event); }
else if (sv_event->type == SVET_MENU) { MenuBarHandler(sv_event); }
else if (sv_event->type == SVET_POPUP) { PopupHandler(sv_event); }
else {} //throw other events away
//throw other events away
}
// Builds a new window, initializes the variables and event handler and builds