summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-06-21 12:54:40 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-06-21 12:54:40 +0200
commit93aca84731bfffb20e968af10055a8cd0401806e (patch)
treeaa57a7972e2ac47b581e5145aaa8ba0fef1f8b68 /src
parentcdd3e83bae71e1e023c4c2bdd5e52d082576e550 (diff)
Fix mingw related warnings
Diffstat (limited to 'src')
-rw-r--r--src/bin/jp2/opj_compress.c2
-rw-r--r--src/bin/jp2/opj_decompress.c2
-rw-r--r--src/bin/jp2/windirent.h5
-rw-r--r--src/lib/openjp2/opj_clock.c2
4 files changed, 7 insertions, 4 deletions
diff --git a/src/bin/jp2/opj_compress.c b/src/bin/jp2/opj_compress.c
index 2ef1c6be..dc228e27 100644
--- a/src/bin/jp2/opj_compress.c
+++ b/src/bin/jp2/opj_compress.c
@@ -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;
diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c
index 90dbbfcc..89fd2025 100644
--- a/src/bin/jp2/opj_decompress.c
+++ b/src/bin/jp2/opj_decompress.c
@@ -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);
diff --git a/src/bin/jp2/windirent.h b/src/bin/jp2/windirent.h
index b7ed9a3c..19509822 100644
--- a/src/bin/jp2/windirent.h
+++ b/src/bin/jp2/windirent.h
@@ -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.
diff --git a/src/lib/openjp2/opj_clock.c b/src/lib/openjp2/opj_clock.c
index ab026ea2..24f79a9a 100644
--- a/src/lib/openjp2/opj_clock.c
+++ b/src/lib/openjp2/opj_clock.c
@@ -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;