Skip to content

Commit

Permalink
Silence some clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
poire-z committed Jan 5, 2023
1 parent 55eb66c commit 146bd15
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crengine/src/hyphman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ class HyphPatternReader : public LVXMLParserCallback
public:
HyphPatternReader(lString32Collection & result) : insidePatternTag(false), data(result)
{
result.clear();
result.clear(); // NOLINT: 1 uninitialized field at the end of the constructor call (?!)
}
/// called on parsing end
virtual void OnStop() { }
Expand Down Expand Up @@ -1339,6 +1339,11 @@ lUInt8 UserHyphDict::init(lString32 filename, bool reload)
++words_in_file;
}

if (words_in_file == 0) {
free(buf);
return USER_HYPH_DICT_MALFORMED;
}

// do fast thourogh check if requested dictionary matches the loaded one
if ( _filename.compare(filename)==0 && _filesize == filesize && _hash_value == hash_value ) {
free(buf);
Expand Down Expand Up @@ -1424,7 +1429,7 @@ bool UserHyphDict::getMask(lChar32 *word, char *mask)

size_t left = 0;
size_t right = words_in_memory-1;
size_t mid = right;
size_t mid;
while ( left <= right )
{
mid = left + (right-left)/2;
Expand Down

0 comments on commit 146bd15

Please sign in to comment.