diff options
author | John Fultz <jfultz@wolfram.com> | 2019-07-21 02:06:00 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2019-07-21 02:06:00 -0500 |
commit | b67605814738d17484e508d037b8b1f09c27cab6 (patch) | |
tree | 9584efaa02ac17a1e0dd91b9b36797441c3cf593 /quackleio | |
parent | 592be355923ea0fae3630af6fe3ba8f11523d9e4 (diff) |
Visual C++ compiler warning fixes.
Mostly signed/unsigned/size_t mismatches, except for one
case treating a bool as an integer.
Diffstat (limited to 'quackleio')
-rw-r--r-- | quackleio/dawgfactory.cpp | 4 | ||||
-rw-r--r-- | quackleio/dawgfactory.h | 2 | ||||
-rw-r--r-- | quackleio/gaddagfactory.cpp | 8 | ||||
-rw-r--r-- | quackleio/gaddagfactory.h | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/quackleio/dawgfactory.cpp b/quackleio/dawgfactory.cpp index 54d753b..60c797d 100644 --- a/quackleio/dawgfactory.cpp +++ b/quackleio/dawgfactory.cpp @@ -218,7 +218,7 @@ void DawgFactory::Node::print(vector< Node* > &nodelist) if (!deleted) { //cout << " Setting pointer to " << nodelist.size() << " before I push_back the children." << endl; - pointer = nodelist.size(); + pointer = (int)nodelist.size(); } else { @@ -276,7 +276,7 @@ bool DawgFactory::Node::pushWord(const Quackle::LetterString &word, bool inSmall n.pointer = 0; n.lastchild = false; children.push_back(n); - index = children.size() - 1; + index = (int)children.size() - 1; } added = children[index].pushWord(rest, inSmaller, pb); diff --git a/quackleio/dawgfactory.h b/quackleio/dawgfactory.h index b5751c2..04e7cb3 100644 --- a/quackleio/dawgfactory.h +++ b/quackleio/dawgfactory.h @@ -33,7 +33,7 @@ public: int wordCount() const { return m_encodableWords; }; string letterCountString() const; - int nodeCount() const { return m_nodelist.size(); }; + int nodeCount() const { return (int)m_nodelist.size(); }; int encodableWords() const { return m_encodableWords; }; int unencodableWords() const { return m_unencodableWords; }; int duplicateWords() const { return m_duplicateWords; }; diff --git a/quackleio/gaddagfactory.cpp b/quackleio/gaddagfactory.cpp index bd5d67a..5d20d38 100644 --- a/quackleio/gaddagfactory.cpp +++ b/quackleio/gaddagfactory.cpp @@ -120,7 +120,7 @@ void GaddagFactory::writeIndex(const string &fname) out.put(1); // GADDAG format version 1 out.write(m_hash.charptr, sizeof(m_hash.charptr)); - for (size_t i = 0; i < m_nodelist.size(); i++) + for (unsigned int i = 0; i < m_nodelist.size(); i++) { unsigned int p = (unsigned int)(m_nodelist[i]->pointer); if (p != 0) @@ -152,7 +152,7 @@ void GaddagFactory::Node::print(vector< Node* >& nodelist) { if (children.size() > 0) { - pointer = nodelist.size(); + pointer = (int)nodelist.size(); children[children.size() - 1].lastchild = true; } @@ -180,7 +180,7 @@ void GaddagFactory::Node::pushWord(const Quackle::LetterString& word) { if (children[i].c == first) { - index = i; + index = (int)i; i = children.size(); } } @@ -193,7 +193,7 @@ void GaddagFactory::Node::pushWord(const Quackle::LetterString& word) n.pointer = 0; n.lastchild = false; children.push_back(n); - index = children.size() - 1; + index = (int)children.size() - 1; } children[index].pushWord(rest); diff --git a/quackleio/gaddagfactory.h b/quackleio/gaddagfactory.h index 966c561..364e492 100644 --- a/quackleio/gaddagfactory.h +++ b/quackleio/gaddagfactory.h @@ -35,8 +35,8 @@ public: GaddagFactory(const UVString &alphabetFile); ~GaddagFactory(); - int wordCount() const { return m_gaddagizedWords.size(); }; - int nodeCount() const { return m_nodelist.size(); }; + int wordCount() const { return (int)m_gaddagizedWords.size(); }; + int nodeCount() const { return (int)m_nodelist.size(); }; int encodableWords() const { return m_encodableWords; }; int unencodableWords() const { return m_unencodableWords; }; |