Suppress C4090 warning

dev
Sen Huang 2019-10-08 09:44:24 -04:00
parent f9b1da6f62
commit 332b5988d8
1 changed files with 12 additions and 2 deletions

View File

@ -658,7 +658,13 @@ int FIO_checkFilenameCollisions(const char** filenameTable, unsigned nbFiles) {
} }
} }
qsort((const char**)filenameTableSorted, nbFiles, sizeof(char*), UTIL_compareStr); /* Silence VS Compiler bug with warning C4090 */
#if defined(_MSC_VER) || defined(__MINGW32__) || defined (__MSVCRT__)
#pragma warning (push)
#pragma warning (disable : 4090)
#endif
qsort(filenameTableSorted, nbFiles, sizeof(char*), UTIL_compareStr);
prevElem = filenameTableSorted[0]; prevElem = filenameTableSorted[0];
for (u = 1; u < nbFiles; ++u) { for (u = 1; u < nbFiles; ++u) {
if (strcmp(prevElem, filenameTableSorted[u]) == 0) { if (strcmp(prevElem, filenameTableSorted[u]) == 0) {
@ -667,7 +673,11 @@ int FIO_checkFilenameCollisions(const char** filenameTable, unsigned nbFiles) {
prevElem = filenameTableSorted[u]; prevElem = filenameTableSorted[u];
} }
free((const char**)filenameTableSorted); free(filenameTableSorted);
#if defined(_MSC_VER) || defined(__MINGW32__) || defined (__MSVCRT__)
#pragma warning (pop)
#endif
return 0; return 0;
} }