Skip to content

Commit

Permalink
Fix VS build warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
BYVoid committed Jul 26, 2024
1 parent 2303080 commit ae80013
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/BinaryDict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void BinaryDict::SerializeToFile(FILE* fp) const {
}

BinaryDictPtr BinaryDict::NewFromFile(FILE* fp) {
size_t offsetBound, savedOffset;
long offsetBound, savedOffset;
savedOffset = ftell(fp);
fseek(fp, 0L, SEEK_END);
offsetBound = ftell(fp) - savedOffset;
Expand Down
4 changes: 2 additions & 2 deletions src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class ConfigInternal {
}

std::string FindConfigFile(std::string fileName,
const std::vector<std::string>& paths) {
const std::vector<std::string>& configPaths) {
std::ifstream ifs;

// Working directory
Expand All @@ -194,7 +194,7 @@ class ConfigInternal {
}
}

for (const std::string& dirPath : paths) {
for (const std::string& dirPath : configPaths) {
std::string path = dirPath + '/' + fileName;
ifs.open(UTF8Util::GetPlatformString(path).c_str());
if (ifs.is_open()) {
Expand Down
2 changes: 1 addition & 1 deletion src/PhraseExtract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class PhraseExtract::DictType {
void BuildTrie() {
std::unordered_map<std::string, int> key_item_id_map;
marisa::Keyset keyset;
for (size_t i = 0; i < items.size(); i++) {
for (int i = 0; i < items.size(); i++) {
const auto& key = items[i].first;
key_item_id_map[key.ToString()] = i;
keyset.push_back(key.CString(), key.ByteLength());
Expand Down
4 changes: 2 additions & 2 deletions src/PhraseExtractTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ TEST_F(PhraseExtractTest, SelectWords) {
phraseExtract.SetWordMaxLength(3);
phraseExtract.SetFullText(siShi);
phraseExtract.SetPostCalculationFilter(
[](const PhraseExtract& phraseExtract, const UTF8StringSlice8Bit& word) {
return phraseExtract.Frequency(word) == 1;
[](const PhraseExtract& p, const UTF8StringSlice8Bit& word) {
return p.Frequency(word) == 1;
});
phraseExtract.SelectWords();
EXPECT_EQ(std::vector<UTF8StringSlice8Bit>({"", "", "", "四十", "十四",
Expand Down

0 comments on commit ae80013

Please sign in to comment.