]> granicus.if.org Git - icu/commitdiff
ICU-9457 Fix some compiler warnings.
authorGeorge Rhoten <grhoten@users.noreply.github.com>
Sun, 5 Aug 2012 16:33:16 +0000 (16:33 +0000)
committerGeorge Rhoten <grhoten@users.noreply.github.com>
Sun, 5 Aug 2012 16:33:16 +0000 (16:33 +0000)
X-SVN-Rev: 32111

icu4c/source/io/uprintf.c
icu4c/source/samples/cal/cal.c
icu4c/source/samples/date/date.c
icu4c/source/test/cintltst/cmsccoll.c
icu4c/source/test/cintltst/putiltst.c
icu4c/source/test/intltest/regextst.cpp

index 0a5da1964324a8ad5a669ecd2c530b5449b0db4a..4f9ec18148d643204f73fa9643551d3c2417c72f 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1998-2011, International Business Machines
+*   Copyright (C) 1998-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -37,7 +37,7 @@
 
 static UFILE *gStdOut = NULL;
 
-static UBool U_CALLCONV uprintf_cleanup()
+static UBool U_CALLCONV uprintf_cleanup(void)
 {
     if (gStdOut != NULL) {
         u_fclose(gStdOut);
index 99fd1ac1d1ad606e1c7eb97daa9834421ba87609..ba47450e6918211641c531e44cd0b449c3009028 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (C) 1998-2009, International Business Machines Corporation
+* Copyright (C) 1998-2012, International Business Machines Corporation
 * and others.  All Rights Reserved.
 **********************************************************************
 *
@@ -110,15 +110,15 @@ main(int argc,
     int printUsage = 0;
     int printVersion = 0;
     UBool useLongNames = 0;
-    int optind = 1;
+    int optInd = 1;
     char *arg;
     int32_t month = -1, year = -1;
     UErrorCode status = U_ZERO_ERROR;
     
     
     /* parse the options */
-    for(optind = 1; optind < argc; ++optind) {
-        arg = argv[optind];
+    for(optInd = 1; optInd < argc; ++optInd) {
+        arg = argv[optInd];
         
         /* version info */
         if(strcmp(arg, "-v") == 0 || strcmp(arg, "--version") == 0) {
@@ -135,7 +135,7 @@ main(int argc,
         /* POSIX.1 says all arguments after -- are not options */
         else if(strcmp(arg, "--") == 0) {
             /* skip the -- */
-            ++optind;
+            ++optInd;
             break;
         }
         /* unrecognized option */
@@ -150,12 +150,12 @@ main(int argc,
     }
     
     /* Get the month and year to display, if specified */
-    if(optind != argc) {
+    if(optInd != argc) {
         
         /* Month and year specified */
-        if(argc - optind == 2) {
-            sscanf(argv[optind], "%d", (int*)&month);
-            sscanf(argv[optind + 1], "%d", (int*)&year);
+        if(argc - optInd == 2) {
+            sscanf(argv[optInd], "%d", (int*)&month);
+            sscanf(argv[optInd + 1], "%d", (int*)&year);
             
             /* Make sure the month value is legal */
             if(month < 0 || month > 12) {
@@ -170,7 +170,7 @@ main(int argc,
         }
         /* Only year specified */
         else {
-            sscanf(argv[optind], "%d", (int*)&year);
+            sscanf(argv[optInd], "%d", (int*)&year);
         }
     }
     
index af897c37919fb0121dbeb32e241a71742fc76d45..ce84f2c60731c11803f814ec698d4070ed5e10e9 100644 (file)
@@ -64,7 +64,7 @@ main(int argc,
 {
   int printUsage = 0;
   int printVersion = 0;
-  int optind = 1;
+  int optInd = 1;
   char *arg;
   const UChar *tz = 0;
   UDateFormatStyle style = UDAT_DEFAULT;
@@ -76,8 +76,8 @@ main(int argc,
   UDate when;
 
   /* parse the options */
-  for(optind = 1; optind < argc; ++optind) {
-    arg = argv[optind];
+  for(optInd = 1; optInd < argc; ++optInd) {
+    arg = argv[optInd];
     
     /* version info */
     if(strcmp(arg, "-v") == 0 || strcmp(arg, "--version") == 0) {
@@ -108,30 +108,30 @@ main(int argc,
       style = UDAT_SHORT;
     }
     else if(strcmp(arg, "-F") == 0 || strcmp(arg, "--format") == 0) {
-      if ( optind + 1 < argc ) { 
-         optind++;
-         format = argv[optind];
+      if ( optInd + 1 < argc ) { 
+         optInd++;
+         format = argv[optInd];
       }
     } else if(strcmp(arg, "-r") == 0) {
-      if ( optind + 1 < argc ) { 
-         optind++;
-         seconds = argv[optind];
+      if ( optInd + 1 < argc ) { 
+         optInd++;
+         seconds = argv[optInd];
       }
     } else if(strcmp(arg, "-R") == 0) {
-      if ( optind + 1 < argc ) { 
-         optind++;
-         millis = argv[optind];
+      if ( optInd + 1 < argc ) { 
+         optInd++;
+         millis = argv[optInd];
       }
     } else if(strcmp(arg, "-P") == 0) {
-      if ( optind + 1 < argc ) { 
-         optind++;
-         parse = argv[optind];
+      if ( optInd + 1 < argc ) { 
+         optInd++;
+         parse = argv[optInd];
       }
     }
     /* POSIX.1 says all arguments after -- are not options */
     else if(strcmp(arg, "--") == 0) {
       /* skip the -- */
-      ++optind;
+      ++optInd;
       break;
     }
     /* unrecognized option */
@@ -325,7 +325,7 @@ static UDate getWhen(const char *millis, const char *seconds, const char *format
     when = udat_parse(fmt, uParse, -1, &parsepos, status);
     if(U_FAILURE(*status)) {
       fprintf(stderr, "Error in Parse: %s\n", u_errorName(*status));
-      if(parsepos>0&&parsepos<=strlen(parse)) {
+      if(parsepos > 0 && parsepos <= (int32_t)strlen(parse)) {
         fprintf(stderr, "ERR>\"%s\" @%d\n"
                         "ERR> %*s^\n",
                 parse,parsepos,parsepos,"");
index b5e3fc90df9faf5f11e02b944e54171f20e60bea..3ec30d377f36c0bdea5c0a61de941cff2eb2c31a 100644 (file)
@@ -6539,7 +6539,7 @@ static void TestMultipleReorder(void)
 /*
  * Test that covers issue reported in ticket 8814
  */
-static void TestReorderWithNumericCollation()
+static void TestReorderWithNumericCollation(void)
 {
     UErrorCode status = U_ZERO_ERROR;
     UCollator  *myCollation;
index 8d18f6cf56209cda9b5f494f70966de26f1cdf71..d6abc9352dc695e48180f9b9594e9c3e822fd022 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1998-2011, International Business Machines Corporation and
+ * Copyright (c) 1998-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /*
@@ -26,7 +26,7 @@
 #include <stdio.h>
 
 /* See the comments on U_SIGNED_RIGHT_SHIFT_IS_ARITHMETIC. */
-static void TestSignedRightShiftIsArithmetic() {
+static void TestSignedRightShiftIsArithmetic(void) {
     int32_t x=0xfff5fff3;
     int32_t m=-1;
     int32_t x4=x>>4;
index 1e197a90e45b89608bf8ed8f045b9c3929be2e3a..66a26fbef37d1854f7403f6755a5949e19dbd493 100644 (file)
@@ -309,7 +309,7 @@ void RegexTest::assertUTextInvariant(const char *expected, UText *actual, const
 
 #define INV_BUFSIZ 2048 /* increase this if too small */
 
-static int32_t inv_next=0;
+static int64_t inv_next=0;
 
 #if U_CHARSET_FAMILY!=U_ASCII_FAMILY
 static char inv_buf[INV_BUFSIZ];