From b4140b3fea9fa28cebe80351061db1c279202137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Sat, 28 Feb 2009 09:23:07 +0000 Subject: [PATCH] - Fixed some warnings on Windows build - Open the dictionary in binary mode. This fixes a bug in the Windows version of compdic --- dic/compdic.cpp | 3 +-- dic/encoding.cpp | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dic/compdic.cpp b/dic/compdic.cpp index 83c3b83..c352f12 100644 --- a/dic/compdic.cpp +++ b/dic/compdic.cpp @@ -76,7 +76,7 @@ using namespace std; const wchar_t* load_uncompressed(const string &iFileName, unsigned int &ioDicSize) { - ifstream file(iFileName.c_str()); + ifstream file(iFileName.c_str(), ios::in | ios::binary); if (!file.is_open()) throw DicException("Could not open file " + iFileName); @@ -578,6 +578,5 @@ int main(int argc, char* argv[]) cerr << e.what() << endl; return 1; } - } diff --git a/dic/encoding.cpp b/dic/encoding.cpp index a0c2f35..c6bb688 100644 --- a/dic/encoding.cpp +++ b/dic/encoding.cpp @@ -85,6 +85,7 @@ int _swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...) va_start(argp, format); #ifdef WIN32 // Mingw32 does not take the maxlen argument + (void)maxlen; res = vswprintf(wcs, format, argp); #else res = vswprintf(wcs, maxlen, format, argp); @@ -98,6 +99,7 @@ wchar_t *_wcstok(wchar_t *wcs, const wchar_t *delim, wchar_t **ptr) { #ifdef WIN32 // Mingw32 does not take the third argument + (void)ptr; return wcstok(wcs, delim); #else return wcstok(wcs, delim, ptr);