From 0ecb0f815acfcf5849d5333c6e585584e93649f7 Mon Sep 17 00:00:00 2001 From: Philipp Reh Date: Fri, 20 Feb 2009 18:55:15 +0100 Subject: [PATCH] Added -Wconverison and fixed the warnings. --- Makefile | 2 +- kana2romaji.cpp | 2 +- xmlparser.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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()); } } -- 2.30.2