From 81e65e527ff1b43b7d8da5b2f13619569850eb9f Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Sun, 18 Jul 2004 05:01:24 +0000 Subject: [PATCH] ICU-3905 Fix some compiler warnings (non-optimal solution) X-SVN-Rev: 16038 --- icu4c/source/extra/uconv/uconv.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/icu4c/source/extra/uconv/uconv.cpp b/icu4c/source/extra/uconv/uconv.cpp index 2ce8e5d487..2115a02ab5 100644 --- a/icu4c/source/extra/uconv/uconv.cpp +++ b/icu4c/source/extra/uconv/uconv.cpp @@ -37,9 +37,10 @@ #include "unicode/uwmsg.h" -#if defined(WIN32) || defined(U_CYGWIN) +#if (defined(WIN32) || defined(U_CYGWIN)) && !defined(__STRICT_ANSI__) #include #include +#define USE_FILENO_BINARY_MODE 1 #endif #ifdef UCONVMSG_LINK @@ -638,7 +639,7 @@ ConvertFile::convertFile(const char *pname, } else { infilestr = "-"; infile = stdin; -#if defined(WIN32) || defined(U_CYGWIN) +#ifdef USE_FILENO_BINARY_MODE if (setmode(fileno(stdin), O_BINARY) == -1) { initMsg(pname); u_wmsg(stderr, "cantSetInBinMode"); @@ -989,7 +990,7 @@ ConvertFile::convertFile(const char *pname, errtag = "problemCvtFromUOut"; } - length = (int8_t)sprintf(pos, "%u", ferroffset); + length = (int8_t)sprintf(pos, "%u", (int)ferroffset); // output the code points that caused the error UnicodeString str; @@ -1339,7 +1340,7 @@ main(int argc, char **argv) } else { outfilestr = "-"; outfile = stdout; -#if defined(WIN32) || defined(U_CYGWIN) +#ifdef USE_FILENO_BINARY_MODE if (setmode(fileno(outfile), O_BINARY) == -1) { u_wmsg(stderr, "cantSetOutBinMode"); exit(-1);