Fix mingw related warnings
authorEven Rouault <even.rouault@spatialys.com>
Wed, 21 Jun 2017 10:54:40 +0000 (12:54 +0200)
committerEven Rouault <even.rouault@spatialys.com>
Wed, 21 Jun 2017 10:54:40 +0000 (12:54 +0200)
src/bin/jp2/opj_compress.c
src/bin/jp2/opj_decompress.c
src/bin/jp2/windirent.h
src/lib/openjp2/opj_clock.c

index 2ef1c6be608a36a3479173cd8388466c95ffd42e..dc228e2711cad5566e6265ba25b8d205805aa6ff 100644 (file)
@@ -1694,7 +1694,7 @@ OPJ_FLOAT64 opj_clock(void)
     /* cout << "freq = " << ((double) freq.QuadPart) << endl; */
     /* t is the high resolution performance counter (see MSDN) */
     QueryPerformanceCounter(& t) ;
-    return freq.QuadPart ? (t.QuadPart / (OPJ_FLOAT64) freq.QuadPart) : 0 ;
+    return freq.QuadPart ? ((OPJ_FLOAT64) t.QuadPart / (OPJ_FLOAT64) freq.QuadPart) : 0 ;
 #else
     /* Unix or Linux: use resource usage */
     struct rusage t;
index 90dbbfcc6037743b2af6d9b8a370237970f6316b..89fd2025ec251c2a3b06046d75fda649564984ee 100644 (file)
@@ -935,7 +935,7 @@ OPJ_FLOAT64 opj_clock(void)
     /* cout << "freq = " << ((double) freq.QuadPart) << endl; */
     /* t is the high resolution performance counter (see MSDN) */
     QueryPerformanceCounter(& t) ;
-    return freq.QuadPart ? (t.QuadPart / (OPJ_FLOAT64)freq.QuadPart) : 0;
+    return freq.QuadPart ? ((OPJ_FLOAT64)t.QuadPart / (OPJ_FLOAT64)freq.QuadPart) : 0;
 #elif defined(__linux)
     struct timespec ts;
     clock_gettime(CLOCK_REALTIME, &ts);
index b7ed9a3c14ba29faa7f06a935df9965b4913f74a..19509822a8f62d9ad0032b66284ce863b562c20f 100644 (file)
@@ -285,7 +285,9 @@ extern "C" {
 static DIR *opendir(const char *dirname);
 static struct dirent *readdir(DIR *dirp);
 static int closedir(DIR *dirp);
+#ifdef unused
 static void rewinddir(DIR *dirp);
+#endif
 
 /*
  * Implement dirent interface as static functions so that the user does not
@@ -544,6 +546,7 @@ closedir(DIR *dirp)
 }
 
 
+#ifdef unused
 /*
  * <function name="rewinddir">
  * <intro>rewind directory stream to the beginning
@@ -593,7 +596,7 @@ rewinddir(DIR *dirp)
         /*EMPTY*/;
     }
 }
-
+#endif
 
 /*
  * Open native directory stream object and retrieve first file.
index ab026ea291c4a6cbb94616f3291969bcc189028c..24f79a9ae7568e573eef2dae4bb2c738258a30a3 100644 (file)
@@ -49,7 +49,7 @@ OPJ_FLOAT64 opj_clock(void)
     /* cout << "freq = " << ((double) freq.QuadPart) << endl; */
     /* t is the high resolution performance counter (see MSDN) */
     QueryPerformanceCounter(& t) ;
-    return (t.QuadPart / (OPJ_FLOAT64) freq.QuadPart) ;
+    return ((OPJ_FLOAT64) t.QuadPart / (OPJ_FLOAT64) freq.QuadPart) ;
 #else
     /* Unix or Linux: use resource usage */
     struct rusage t;