Fix mingw related warnings

This commit is contained in:
Even Rouault 2017-06-21 12:54:40 +02:00
parent cdd3e83bae
commit 93aca84731
4 changed files with 7 additions and 4 deletions

View File

@ -1694,7 +1694,7 @@ OPJ_FLOAT64 opj_clock(void)
/* cout << "freq = " << ((double) freq.QuadPart) << endl; */ /* cout << "freq = " << ((double) freq.QuadPart) << endl; */
/* t is the high resolution performance counter (see MSDN) */ /* t is the high resolution performance counter (see MSDN) */
QueryPerformanceCounter(& t) ; 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 #else
/* Unix or Linux: use resource usage */ /* Unix or Linux: use resource usage */
struct rusage t; struct rusage t;

View File

@ -935,7 +935,7 @@ OPJ_FLOAT64 opj_clock(void)
/* cout << "freq = " << ((double) freq.QuadPart) << endl; */ /* cout << "freq = " << ((double) freq.QuadPart) << endl; */
/* t is the high resolution performance counter (see MSDN) */ /* t is the high resolution performance counter (see MSDN) */
QueryPerformanceCounter(& t) ; 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) #elif defined(__linux)
struct timespec ts; struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts); clock_gettime(CLOCK_REALTIME, &ts);

View File

@ -285,7 +285,9 @@ extern "C" {
static DIR *opendir(const char *dirname); static DIR *opendir(const char *dirname);
static struct dirent *readdir(DIR *dirp); static struct dirent *readdir(DIR *dirp);
static int closedir(DIR *dirp); static int closedir(DIR *dirp);
#ifdef unused
static void rewinddir(DIR *dirp); static void rewinddir(DIR *dirp);
#endif
/* /*
* Implement dirent interface as static functions so that the user does not * Implement dirent interface as static functions so that the user does not
@ -544,6 +546,7 @@ closedir(DIR *dirp)
} }
#ifdef unused
/* /*
* <function name="rewinddir"> * <function name="rewinddir">
* <intro>rewind directory stream to the beginning * <intro>rewind directory stream to the beginning
@ -593,7 +596,7 @@ rewinddir(DIR *dirp)
/*EMPTY*/; /*EMPTY*/;
} }
} }
#endif
/* /*
* Open native directory stream object and retrieve first file. * Open native directory stream object and retrieve first file.

View File

@ -49,7 +49,7 @@ OPJ_FLOAT64 opj_clock(void)
/* cout << "freq = " << ((double) freq.QuadPart) << endl; */ /* cout << "freq = " << ((double) freq.QuadPart) << endl; */
/* t is the high resolution performance counter (see MSDN) */ /* t is the high resolution performance counter (see MSDN) */
QueryPerformanceCounter(& t) ; QueryPerformanceCounter(& t) ;
return (t.QuadPart / (OPJ_FLOAT64) freq.QuadPart) ; return ((OPJ_FLOAT64) t.QuadPart / (OPJ_FLOAT64) freq.QuadPart) ;
#else #else
/* Unix or Linux: use resource usage */ /* Unix or Linux: use resource usage */
struct rusage t; struct rusage t;