- Fixed some warnings on Windows build

- Open the dictionary in binary mode. This fixes a bug in the Windows version of compdic
This commit is contained in:
Olivier Teulière 2009-02-28 09:23:07 +00:00
parent 141442766b
commit b4140b3fea
2 changed files with 3 additions and 2 deletions

View file

@ -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;
}
}

View file

@ -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);