Added -Wconverison and fixed the warnings.
authorPhilipp Reh <sefi@s-e-f-i.de>
Fri, 20 Feb 2009 17:55:15 +0000 (18:55 +0100)
committerPhilipp Reh <sefi@s-e-f-i.de>
Fri, 20 Feb 2009 17:55:15 +0000 (18:55 +0100)
Makefile
kana2romaji.cpp
xmlparser.h

index c810ef62bc9327007f697579e3cc9a28d95d28a3..af8924883e78abaffed2a54fa63fe807d3eec21a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 PREFIX ?= /usr
 
-OPTS=-Wall -Wextra -ansi -pedantic-errors $(CXXFLAGS)
+OPTS=-Wall -Wextra -ansi -pedantic-errors -Wconversion $(CXXFLAGS)
 DICTIONARY_PATH=$(PREFIX)/share/jmdict
 DICTIONARY_NAME="\"$(DICTIONARY_PATH)/database\""
 BINDIR=${DESTDIR}${PREFIX}/bin
index 43a2d402a106bbe20c4abd2ec65fe607eafda2c3..99591ebdbb1de530f2f72356710ddc668d6805ca 100644 (file)
@@ -27,7 +27,7 @@ using namespace std;
 
 namespace  {
 void utfchar(const string& from, string::size_type pos, string& to) {
-    string::value_type first = from[pos];
+    unsigned first = from[pos];
     if ((first & 0x80) == 0)
         to = from[pos];
     else {
index 29745eb36ec584d9a22b078605035df3a4bed10c..08b3c3885d90716ae7ed697414ec4ddac6b0e86b 100644 (file)
@@ -80,7 +80,7 @@ public:
         while (in) {
             char* buffer = static_cast<char*>(XML_GetBuffer(m_parser, BLOCK_SIZE));
             in.read(buffer, BLOCK_SIZE);
-            XML_ParseBuffer(m_parser, in.gcount(), in.eof());
+            XML_ParseBuffer(m_parser, static_cast<int>(in.gcount()), in.eof());
         }
     }