From: Philipp Reh Date: Fri, 20 Feb 2009 17:55:15 +0000 (+0100) Subject: Added -Wconverison and fixed the warnings. X-Git-Url: https://git.enpas.org/?p=jmdict-cli.git;a=commitdiff_plain;h=0ecb0f815acfcf5849d5333c6e585584e93649f7 Added -Wconverison and fixed the warnings. --- diff --git a/Makefile b/Makefile index c810ef6..af89248 100644 --- 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 diff --git a/kana2romaji.cpp b/kana2romaji.cpp index 43a2d40..99591eb 100644 --- a/kana2romaji.cpp +++ b/kana2romaji.cpp @@ -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 { diff --git a/xmlparser.h b/xmlparser.h index 29745eb..08b3c38 100644 --- a/xmlparser.h +++ b/xmlparser.h @@ -80,7 +80,7 @@ public: while (in) { char* buffer = static_cast(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(in.gcount()), in.eof()); } }