mdbx-tools: more fix MSVC warnings.

Change-Id: Ib5f78a89fea09dc78d4922519eab6eaed4b1a7e6
This commit is contained in:
Leo Yuriev 2017-07-21 16:36:18 +03:00
parent 63af619080
commit c5d1384c64
6 changed files with 43 additions and 10 deletions

View File

@ -18,7 +18,14 @@
#pragma warning(disable : 4464) /* relative include path contains '..' */
#endif
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER */
#if _MSC_VER == 1900
/* LY: MSVC 2015 has buggy/inconsistent PRIuPTR/PRIxPTR macros and format-arg
checker for size_t typedef. */
#pragma warning(disable : 4777) /* format string '%10u' requires an argument \
of type 'unsigned int', but variadic \
argument 1 has type 'std::size_t' */
#endif
#endif /* _MSC_VER (warnings) */
#include "../bits.h"
@ -203,7 +210,7 @@ static void problem_add(const char *object, uint64_t entry_number,
}
}
static struct problem *problems_push() {
static struct problem *problems_push(void) {
struct problem *p = problems_list;
problems_list = NULL;
return p;

View File

@ -18,7 +18,14 @@
#pragma warning(disable : 4464) /* relative include path contains '..' */
#endif
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER */
#if _MSC_VER == 1900
/* LY: MSVC 2015 has buggy/inconsistent PRIuPTR/PRIxPTR macros and format-arg
checker for size_t typedef. */
#pragma warning(disable : 4777) /* format string '%10u' requires an argument \
of type 'unsigned int', but variadic \
argument 1 has type 'std::size_t' */
#endif
#endif /* _MSC_VER (warnings) */
#include "../bits.h"

View File

@ -18,7 +18,14 @@
#pragma warning(disable : 4464) /* relative include path contains '..' */
#endif
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER */
#if _MSC_VER == 1900
/* LY: MSVC 2015 has buggy/inconsistent PRIuPTR/PRIxPTR macros and format-arg
checker for size_t typedef. */
#pragma warning(disable : 4777) /* format string '%10u' requires an argument \
of type 'unsigned int', but variadic \
argument 1 has type 'std::size_t' */
#endif
#endif /* _MSC_VER (warnings) */
#include "../bits.h"
#include <ctype.h>

View File

@ -18,7 +18,14 @@
#pragma warning(disable : 4464) /* relative include path contains '..' */
#endif
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER */
#if _MSC_VER == 1900
/* LY: MSVC 2015 has buggy/inconsistent PRIuPTR/PRIxPTR macros and format-arg
checker for size_t typedef. */
#pragma warning(disable : 4777) /* format string '%10u' requires an argument \
of type 'unsigned int', but variadic \
argument 1 has type 'std::size_t' */
#endif
#endif /* _MSC_VER (warnings) */
#include "../bits.h"
#include <ctype.h>

View File

@ -18,7 +18,14 @@
#pragma warning(disable : 4464) /* relative include path contains '..' */
#endif
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER */
#if _MSC_VER == 1900
/* LY: MSVC 2015 has buggy/inconsistent PRIuPTR/PRIxPTR macros and format-arg
checker for size_t typedef. */
#pragma warning(disable : 4777) /* format string '%10u' requires an argument \
of type 'unsigned int', but variadic \
argument 1 has type 'std::size_t' */
#endif
#endif /* _MSC_VER (warnings) */
#include "../bits.h"

View File

@ -20,9 +20,6 @@
#define ERR(s, c) \
if (opterr) { \
char errbuf[2]; \
errbuf[0] = (char)c; \
errbuf[1] = '\n'; \
fputs(argv[0], stderr); \
fputs(s, stderr); \
fputc(c, stderr); \
@ -38,13 +35,14 @@ int getopt(int argc, char *const argv[], const char *opts) {
int c;
char *cp;
if (sp == 1)
if (sp == 1) {
if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
return EOF;
else if (strcmp(argv[optind], "--") == 0) {
optind++;
return EOF;
}
}
optopt = c = argv[optind][sp];
if (c == ':' || (cp = strchr(opts, c)) == NULL) {
ERR(": illegal option -- ", c);