https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f47f45dbdd68e21ec7ab2…
commit f47f45dbdd68e21ec7ab283877cbd139f418c804
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Apr 15 13:29:33 2019 +0200
Commit: Colin Finck <colin(a)reactos.org>
CommitDate: Sun Apr 28 23:21:48 2019 +0200
[TOOLS] Fix/suppress all MSVC/x64 warnings (#1525)
---
sdk/lib/cmlib/hivebin.c | 6 +++---
sdk/lib/inflib/CMakeLists.txt | 2 +-
sdk/lib/inflib/infget.c | 2 +-
sdk/tools/CMakeLists.txt | 9 +++++----
sdk/tools/bin2c.c | 4 ++--
sdk/tools/cabman/cabinet.cxx | 2 +-
sdk/tools/hhpcomp/CMakeLists.txt | 8 ++++++++
sdk/tools/hhpcomp/chmc/chmc.c | 4 ++++
sdk/tools/hhpcomp/port/config.h | 7 +++++++
sdk/tools/hpp/CMakeLists.txt | 5 +++++
sdk/tools/isohybrid/CMakeLists.txt | 8 ++++++++
sdk/tools/isohybrid/isohybrid.c | 12 ++++++------
sdk/tools/isohybrid/reactos_support_code.h | 2 ++
sdk/tools/kbdtool/kbdtool.h | 2 +-
sdk/tools/kbdtool/main.c | 3 ++-
sdk/tools/kbdtool/output.c | 2 +-
sdk/tools/mkhive/reginf.c | 6 +++---
sdk/tools/mkisofs/CMakeLists.txt | 13 +++++++++++++
sdk/tools/mkisofs/reactos/xconfig.h | 9 ++++++++-
sdk/tools/mkshelllink/mkshelllink.c | 2 +-
sdk/tools/spec2def/spec2def.c | 4 ++--
sdk/tools/unicode/CMakeLists.txt | 11 +++++++++++
sdk/tools/unicode/string.c | 3 +--
sdk/tools/utf16le/utf16le.cpp | 11 ++++++-----
sdk/tools/widl/CMakeLists.txt | 11 +++++++++++
sdk/tools/widl/port/config.h | 15 +++++++++++++++
sdk/tools/wpp/CMakeLists.txt | 7 +++++++
sdk/tools/xml2sdb/CMakeLists.txt | 5 ++++-
sdk/tools/xml2sdb/main.cpp | 2 +-
29 files changed, 140 insertions(+), 37 deletions(-)
diff --git a/sdk/lib/cmlib/hivebin.c b/sdk/lib/cmlib/hivebin.c
index 23ca9cb18b..1b6cdf1641 100644
--- a/sdk/lib/cmlib/hivebin.c
+++ b/sdk/lib/cmlib/hivebin.c
@@ -16,7 +16,7 @@ HvpAddBin(
{
PHMAP_ENTRY BlockList;
PHBIN Bin;
- SIZE_T BinSize;
+ ULONG BinSize;
ULONG i;
ULONG BitmapSize;
ULONG BlockCount;
@@ -24,7 +24,7 @@ HvpAddBin(
PHCELL Block;
BinSize = ROUND_UP(Size + sizeof(HBIN), HBLOCK_SIZE);
- BlockCount = (ULONG)(BinSize / HBLOCK_SIZE);
+ BlockCount = BinSize / HBLOCK_SIZE;
Bin = RegistryHive->Allocate(BinSize, TRUE, TAG_CM);
if (Bin == NULL)
@@ -34,7 +34,7 @@ HvpAddBin(
Bin->Signature = HV_HBIN_SIGNATURE;
Bin->FileOffset = RegistryHive->Storage[Storage].Length *
HBLOCK_SIZE;
- Bin->Size = (ULONG)BinSize;
+ Bin->Size = BinSize;
/* Allocate new block list */
OldBlockListSize = RegistryHive->Storage[Storage].Length;
diff --git a/sdk/lib/inflib/CMakeLists.txt b/sdk/lib/inflib/CMakeLists.txt
index e6ed96f8c1..bf8086acf0 100644
--- a/sdk/lib/inflib/CMakeLists.txt
+++ b/sdk/lib/inflib/CMakeLists.txt
@@ -21,7 +21,7 @@ else()
infhostput.c
infhostrtl.c)
- add_definitions(-D__NO_CTYPE_INLINES -DINFLIB_HOST)
+ add_definitions(-D__NO_CTYPE_INLINES -DINFLIB_HOST -D_CRT_SECURE_NO_WARNINGS)
add_library(inflibhost ${SOURCE})
if(NOT MSVC)
diff --git a/sdk/lib/inflib/infget.c b/sdk/lib/inflib/infget.c
index 5e1ccdbf3b..70b3473ff8 100644
--- a/sdk/lib/inflib/infget.c
+++ b/sdk/lib/inflib/infget.c
@@ -582,7 +582,7 @@ InfpGetStringField(PINFCONTEXT Context,
0);
if (RequiredSize != NULL)
- *RequiredSize = Size + 1;
+ *RequiredSize = (ULONG)Size + 1;
if (ReturnBuffer != NULL)
{
diff --git a/sdk/tools/CMakeLists.txt b/sdk/tools/CMakeLists.txt
index bbcf9e78ce..f721728015 100644
--- a/sdk/tools/CMakeLists.txt
+++ b/sdk/tools/CMakeLists.txt
@@ -9,8 +9,11 @@ endfunction()
#add_executable(pefixup pefixup.c)
if(MSVC)
- add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_IO_H=1)
add_compile_flags_language("/EHsc" "CXX")
+
+ # Disable warning "conversion from 'size_t' to 'int', possible
loss of data"
+ add_compile_flags("/wd4267")
endif()
add_host_tool(bin2c bin2c.c)
@@ -19,10 +22,10 @@ add_host_tool(geninc geninc/geninc.c)
add_host_tool(mkshelllink mkshelllink/mkshelllink.c)
add_host_tool(obj2bin obj2bin/obj2bin.c)
add_host_tool(spec2def spec2def/spec2def.c)
-
add_host_tool(utf16le utf16le/utf16le.cpp)
add_subdirectory(cabman)
+add_subdirectory(fatten)
add_subdirectory(hhpcomp)
add_subdirectory(hpp)
add_subdirectory(isohybrid)
@@ -38,5 +41,3 @@ if(NOT MSVC)
add_subdirectory(log2lines)
add_subdirectory(rsym)
endif()
-
-add_subdirectory(fatten)
diff --git a/sdk/tools/bin2c.c b/sdk/tools/bin2c.c
index f7ee025a4d..12b2a3fab6 100644
--- a/sdk/tools/bin2c.c
+++ b/sdk/tools/bin2c.c
@@ -167,8 +167,8 @@ int main(int argc, char* argv[])
/* Generate the header file and close it */
fprintf(outHFile, "/* This file is autogenerated, do not edit. */\n\n");
- fprintf(outHFile, "#define %s_SIZE %lu\n" , argv[5], bufLen);
- fprintf(outHFile, "extern unsigned char %s[%lu];\n", argv[5], bufLen);
+ fprintf(outHFile, "#define %s_SIZE %lu\n" , argv[5], (unsigned
long)bufLen);
+ fprintf(outHFile, "extern unsigned char %s[%lu];\n", argv[5], (unsigned
long)bufLen);
fclose(outHFile);
/* Close the input file */
diff --git a/sdk/tools/cabman/cabinet.cxx b/sdk/tools/cabman/cabinet.cxx
index 5202404bd8..39400498c1 100644
--- a/sdk/tools/cabman/cabinet.cxx
+++ b/sdk/tools/cabman/cabinet.cxx
@@ -3106,7 +3106,7 @@ ULONG CCabinet::GetFileTimes(FILE* FileHandle, PCFFILE_NODE File)
{
#if defined(_WIN32)
FILETIME FileTime;
- HANDLE FileNo = (HANDLE)_fileno(FileHandle);
+ HANDLE FileNo = UlongToHandle(_fileno(FileHandle));
if (GetFileTime(FileNo, NULL, NULL, &FileTime))
FileTimeToDosDateTime(&FileTime,
diff --git a/sdk/tools/hhpcomp/CMakeLists.txt b/sdk/tools/hhpcomp/CMakeLists.txt
index bbe004a631..8e073ff12e 100644
--- a/sdk/tools/hhpcomp/CMakeLists.txt
+++ b/sdk/tools/hhpcomp/CMakeLists.txt
@@ -14,3 +14,11 @@ add_definitions(-DNONSLIDE)
add_executable(hhpcomp ${SOURCE})
target_link_libraries(hhpcomp)
+
+if(MSVC)
+ # Disable warning "'x': unreferenced local variable"
+ add_target_compile_flags(hhpcomp "/wd4101")
+
+ # Disable warning "'=': conversion from 'a' to 'b',
possible loss of data"
+ add_target_compile_flags(hhpcomp "/wd4244")
+endif()
diff --git a/sdk/tools/hhpcomp/chmc/chmc.c b/sdk/tools/hhpcomp/chmc/chmc.c
index 50c4b467ee..934bfba417 100644
--- a/sdk/tools/hhpcomp/chmc/chmc.c
+++ b/sdk/tools/hhpcomp/chmc/chmc.c
@@ -30,6 +30,10 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef __REACTOS__
+#include <io.h>
+int mkstemps(char* template, int suffix_len);
+#endif /* __REACTOS__ */
#else
#ifdef __REACTOS__
#include <sys/types.h>
diff --git a/sdk/tools/hhpcomp/port/config.h b/sdk/tools/hhpcomp/port/config.h
new file mode 100644
index 0000000000..74ef33dafe
--- /dev/null
+++ b/sdk/tools/hhpcomp/port/config.h
@@ -0,0 +1,7 @@
+
+#pragma once
+
+#if defined(_WIN32)
+#include <io.h>
+#define HAVE_PROCESS_H 1
+#endif
diff --git a/sdk/tools/hpp/CMakeLists.txt b/sdk/tools/hpp/CMakeLists.txt
index 684214fbe1..3ca527e44f 100644
--- a/sdk/tools/hpp/CMakeLists.txt
+++ b/sdk/tools/hpp/CMakeLists.txt
@@ -1,2 +1,7 @@
add_host_tool(hpp hpp.c)
+
+if(MSVC)
+ # Disable warning "'=': conversion from 'a' to 'b',
possible loss of data"
+ add_target_compile_flags(hpp "/wd4244")
+endif()
diff --git a/sdk/tools/isohybrid/CMakeLists.txt b/sdk/tools/isohybrid/CMakeLists.txt
index 13b57e1aff..d24f3b95cb 100644
--- a/sdk/tools/isohybrid/CMakeLists.txt
+++ b/sdk/tools/isohybrid/CMakeLists.txt
@@ -5,3 +5,11 @@ add_definitions(
add_host_tool(isohybrid
isohybrid.c
reactos_support_code.c)
+
+if(MSVC)
+ # Disable warning "'x': unreferenced local variable"
+ add_target_compile_flags(isohybrid "/wd4101")
+
+ # Disable warning "'return': conversion from '__int64' to
'int', possible loss of data"
+ add_target_compile_flags(isohybrid "/wd4244")
+endif()
diff --git a/sdk/tools/isohybrid/isohybrid.c b/sdk/tools/isohybrid/isohybrid.c
index dd78c79a4f..b8d2da6f36 100644
--- a/sdk/tools/isohybrid/isohybrid.c
+++ b/sdk/tools/isohybrid/isohybrid.c
@@ -57,12 +57,12 @@ uint8_t mode = 0;
enum { VERBOSE = 1 , EFI = 2 , MAC = 4};
/* user options */
-uint16_t head = 64; /* 1 <= head <= 256 */
-uint8_t sector = 32; /* 1 <= sector <= 63 */
+uint32_t head = 64; /* 1 <= head <= 256 */
+uint32_t sector = 32; /* 1 <= sector <= 63 */
-uint8_t entry = 0; /* partition number: 1 <= entry <= 4 */
-uint8_t offset = 0; /* partition offset: 0 <= offset <= 64 */
-uint16_t type = 0x17; /* partition type: 0 <= type <= 255 */
+uint32_t entry = 0; /* partition number: 1 <= entry <= 4 */
+uint32_t offset = 0; /* partition offset: 0 <= offset <= 64 */
+uint32_t type = 0x17; /* partition type: 0 <= type <= 255 */
uint32_t id = 0; /* MBR: 0 <= id <= 0xFFFFFFFF(4294967296) */
uint8_t hd0 = 0; /* 0 <= hd0 <= 2 */
@@ -994,7 +994,7 @@ main(int argc, char *argv[])
errx(1, "%s: --offset is invalid with UEFI images\n", argv[0]);
#endif
- srand(time(NULL) << (getppid() << getpid()));
+ srand((unsigned int)time(NULL) << (getppid() << getpid()));
if (!(fp = fopen(argv[0], "rb+")))
err(1, "could not open file `%s'", argv[0]);
diff --git a/sdk/tools/isohybrid/reactos_support_code.h
b/sdk/tools/isohybrid/reactos_support_code.h
index 3f3344c4e0..591ace9e4b 100644
--- a/sdk/tools/isohybrid/reactos_support_code.h
+++ b/sdk/tools/isohybrid/reactos_support_code.h
@@ -9,6 +9,8 @@
#ifdef _WIN32
#include <malloc.h>
#include <windows.h>
+#include <process.h>
+#include <io.h>
#else
#include <alloca.h>
#include <unistd.h>
diff --git a/sdk/tools/kbdtool/kbdtool.h b/sdk/tools/kbdtool/kbdtool.h
index bf14307d40..b2b9612484 100644
--- a/sdk/tools/kbdtool/kbdtool.h
+++ b/sdk/tools/kbdtool/kbdtool.h
@@ -34,7 +34,7 @@ typedef struct tagKEYNAME
typedef struct tagSCVK
{
USHORT ScanCode;
- USHORT VirtualKey;
+ UCHAR VirtualKey;
PCHAR Name;
BOOLEAN Processed;
} SCVK, *PSCVK;
diff --git a/sdk/tools/kbdtool/main.c b/sdk/tools/kbdtool/main.c
index 9a5517ac7f..16cb86fa47 100644
--- a/sdk/tools/kbdtool/main.c
+++ b/sdk/tools/kbdtool/main.c
@@ -61,7 +61,8 @@ INT
main(INT argc,
PCHAR* argv)
{
- ULONG i, ErrorCode, FailureCode;
+ int i;
+ ULONG ErrorCode, FailureCode;
CHAR Option;
PCHAR OpenFlags;
CHAR BuildOptions[16] = {0};
diff --git a/sdk/tools/kbdtool/output.c b/sdk/tools/kbdtool/output.c
index 8b3e3766e6..6d1846af6a 100644
--- a/sdk/tools/kbdtool/output.c
+++ b/sdk/tools/kbdtool/output.c
@@ -855,7 +855,7 @@ kbd_c(IN ULONG StateCount,
if (i >= 1)
{
/* J is the loop variable, K is the double */
- for (NeedPlus = 0, j = 0, k = 1; (1 << j) <= i; j++, k = (1
<< j))
+ for (NeedPlus = 0, j = 0, k = 1; (1u << j) <= i; j++, k = (1
<< j))
{
/* Do we need to add a plus? */
if (NeedPlus)
diff --git a/sdk/tools/mkhive/reginf.c b/sdk/tools/mkhive/reginf.c
index b630d7535d..53db8802d0 100644
--- a/sdk/tools/mkhive/reginf.c
+++ b/sdk/tools/mkhive/reginf.c
@@ -345,7 +345,7 @@ do_reg_operation(
0,
Type,
(PVOID)Str,
- Size * sizeof(WCHAR));
+ (ULONG)(Size * sizeof(WCHAR)));
}
else
{
@@ -372,7 +372,7 @@ do_reg_operation(
if (Data == NULL)
return FALSE;
- DPRINT("setting binary data '%S' len %d\n", ValueName,
Size);
+ DPRINT("setting binary data '%S' len %d\n", ValueName,
(ULONG)Size);
InfHostGetBinaryField(Context, 5, Data, Size, NULL);
}
@@ -381,7 +381,7 @@ do_reg_operation(
0,
Type,
(PVOID)Data,
- Size);
+ (ULONG)Size);
free(Data);
}
diff --git a/sdk/tools/mkisofs/CMakeLists.txt b/sdk/tools/mkisofs/CMakeLists.txt
index a045c03dd5..82704df306 100644
--- a/sdk/tools/mkisofs/CMakeLists.txt
+++ b/sdk/tools/mkisofs/CMakeLists.txt
@@ -88,7 +88,20 @@ if(MSVC)
if (ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int',
possible loss of data"
add_target_compile_flags(mkisofs "/wd4267")
+
+ # Disable warning "'type cast': pointer truncation from 'const
char *' to 'long'"
+ add_target_compile_flags(libschily "/wd4311")
endif()
+
+ # Disable warning "'<': signed/unsigned mismatch"
+ add_target_compile_flags(mkisofs "/wd4018")
+
+ # Disable warning "'nchar': unreferenced local variable"
+ add_target_compile_flags(mkisofs "/wd4101")
+
+ # Disable warning "'+=': conversion from 'x' to 'y',
possible loss of data"
+ add_target_compile_flags(libschily "/wd4244")
+ add_target_compile_flags(mkisofs "/wd4244")
else()
# libschily implements an own printf function with support for the %r formatter.
# Silence compilers checking for invalid formatting sequences.
diff --git a/sdk/tools/mkisofs/reactos/xconfig.h b/sdk/tools/mkisofs/reactos/xconfig.h
index 3fdd3a8bbb..484acc3db4 100644
--- a/sdk/tools/mkisofs/reactos/xconfig.h
+++ b/sdk/tools/mkisofs/reactos/xconfig.h
@@ -195,12 +195,19 @@
#define HAVE_TYPE_INTMAX_T 1
#define HAVE_TYPE_UINTMAX_T 1
+#define HAVE_ENVIRON_DEF 1
+#define HAVE_RENAME 1
+#define HAVE_STRNLEN 1
+#ifdef _WIN32
+ #define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
/*
* ReactOS additions
*/
#ifdef _MSC_VER
- #define ssize_t int
+ #define ssize_t intptr_t
+ #include <io.h>
#endif
/* Would need additional fprformat.c, less portable */
diff --git a/sdk/tools/mkshelllink/mkshelllink.c b/sdk/tools/mkshelllink/mkshelllink.c
index cf88f450c0..2cb921e567 100644
--- a/sdk/tools/mkshelllink/mkshelllink.c
+++ b/sdk/tools/mkshelllink/mkshelllink.c
@@ -129,7 +129,7 @@ typedef struct _ID_LIST_DRIVE
int main(int argc, const char *argv[])
{
- unsigned i;
+ int i;
const char *pszOutputPath = "shortcut.lnk";
const char *pszTarget = NULL;
const char *pszDescription = "Description";
diff --git a/sdk/tools/spec2def/spec2def.c b/sdk/tools/spec2def/spec2def.c
index 1246ce3ad3..fe89a12815 100644
--- a/sdk/tools/spec2def/spec2def.c
+++ b/sdk/tools/spec2def/spec2def.c
@@ -500,7 +500,7 @@ PrintName(FILE *fileDest, EXPORT *pexp, PSTRING pstr, int fDeco)
{
/* Skip leading underscore and remove trailing decoration */
pcName++;
- nNameLength = pcAt - pcName;
+ nNameLength = (int)(pcAt - pcName);
}
/* Print the undecorated function name */
@@ -515,7 +515,7 @@ PrintName(FILE *fileDest, EXPORT *pexp, PSTRING pstr, int fDeco)
if (pcDot)
{
/* First print the dll name, followed by a dot */
- nNameLength = pcDot - pcName;
+ nNameLength = (int)(pcDot - pcName);
fprintf(fileDest, "%.*s.", nNameLength, pcName);
/* Now the actual function name */
diff --git a/sdk/tools/unicode/CMakeLists.txt b/sdk/tools/unicode/CMakeLists.txt
index a715719c8b..8e6c09f5b8 100644
--- a/sdk/tools/unicode/CMakeLists.txt
+++ b/sdk/tools/unicode/CMakeLists.txt
@@ -84,3 +84,14 @@ list(APPEND SOURCE
wctype.c)
add_library(unicode ${SOURCE})
+
+if(MSVC)
+ # Disable warning "'<': signed/unsigned mismatch"
+ add_target_compile_flags(unicode "/wd4018")
+
+ # Disable warning "unary minus operator applied to unsigned type, result still
unsigned"
+ add_target_compile_flags(unicode "/wd4146")
+
+ # Disable warning "conversion from 'const WCHAR' to 'char',
possible loss of data"
+ add_target_compile_flags(unicode "/wd4244")
+endif()
diff --git a/sdk/tools/unicode/string.c b/sdk/tools/unicode/string.c
index 09499ea988..4eab49cd3b 100644
--- a/sdk/tools/unicode/string.c
+++ b/sdk/tools/unicode/string.c
@@ -469,8 +469,7 @@ int vsnprintfW(WCHAR *str, size_t len, const WCHAR *format, va_list
valist)
/* FIXME: for unrecognised types, should ignore % when printing */
char *bufaiter = bufa;
if (*iter == 'p')
- sprintf(bufaiter, "%0*lX", 2 * (int)sizeof(void*),
- (unsigned long)va_arg(valist, void *));
+ sprintf(bufaiter, "%p", va_arg(valist, void*));
else
{
*fmta++ = *iter;
diff --git a/sdk/tools/utf16le/utf16le.cpp b/sdk/tools/utf16le/utf16le.cpp
index 7ba25b1c57..391205cbba 100644
--- a/sdk/tools/utf16le/utf16le.cpp
+++ b/sdk/tools/utf16le/utf16le.cpp
@@ -35,7 +35,8 @@ protected:
err_types error;
enc_types encoding;
bom_types bom_type;
- unsigned char buffer[4], fill, index; // need 4 char buffer for optional BOM
handling
+ unsigned char buffer[4], index; // need 4 char buffer for optional BOM handling
+ std::streamsize fill;
fstream inputfile,outputfile;
static const unsigned char utf8table[64];
public:
@@ -75,7 +76,7 @@ public:
valid values are 0xef, 0xff, 0xfe, 0x00
*/
inputfile.read(reinterpret_cast<char*>(&buffer),4);
- fill =inputfile.gcount();
+ fill = inputfile.gcount();
// stupid utf8 bom
if ((fill > 2) &&
(buffer[0] == 0xef) &&
@@ -135,7 +136,7 @@ public:
}
return utf8; // no valid bom so use utf8 as default
}
- int getByte(unsigned char &c)
+ std::streamsize getByte(unsigned char &c)
{
if (fill)
{
@@ -149,7 +150,7 @@ public:
return inputfile.gcount();
}
}
- int getWord(unsigned short &w)
+ std::streamsize getWord(unsigned short &w)
{
unsigned char c[2];
if (!getByte(c[0]))
@@ -162,7 +163,7 @@ public:
w = c[1] | (c[0] << 8);
return 2;
}
- int getDWord(wchar_t &d)
+ std::streamsize getDWord(wchar_t &d)
{
unsigned char c[4];
for (int i=0;i<4;i++)
diff --git a/sdk/tools/widl/CMakeLists.txt b/sdk/tools/widl/CMakeLists.txt
index 40bf91671b..17239f0136 100644
--- a/sdk/tools/widl/CMakeLists.txt
+++ b/sdk/tools/widl/CMakeLists.txt
@@ -35,3 +35,14 @@ list(APPEND SOURCE
add_definitions(-DINT16=SHORT)
add_host_tool(widl ${SOURCE})
target_link_libraries(widl wpphost)
+
+if(MSVC)
+ # Disable warning "'>': signed/unsigned mismatch"
+ add_target_compile_flags(widl "/wd4018")
+
+ # Disable warning "unary minus operator applied to unsigned type, result still
unsigned"
+ add_target_compile_flags(widl "/wd4146")
+
+ # Disable warning "'=': conversion from 'a' to 'b',
possible loss of data"
+ add_target_compile_flags(widl "/wd4244")
+endif()
diff --git a/sdk/tools/widl/port/config.h b/sdk/tools/widl/port/config.h
new file mode 100644
index 0000000000..568b15d51d
--- /dev/null
+++ b/sdk/tools/widl/port/config.h
@@ -0,0 +1,15 @@
+
+#pragma once
+
+#include <io.h>
+
+#define HAVE_PROCESS_H 1
+
+int
+_getopt_internal(
+ int argc,
+ char *const *argv,
+ const char *optstring,
+ const struct option *longopts,
+ int *longind,
+ int long_only);
diff --git a/sdk/tools/wpp/CMakeLists.txt b/sdk/tools/wpp/CMakeLists.txt
index 2539e6b733..39f3b2d9f9 100644
--- a/sdk/tools/wpp/CMakeLists.txt
+++ b/sdk/tools/wpp/CMakeLists.txt
@@ -11,6 +11,13 @@ if(MSVC)
add_definitions(-Dvsnprintf=_vsnprintf)
endif()
endif()
+
+ # Disable warning " unary minus operator applied to unsigned type, result still
unsigned"
+ add_compile_flags("/wd4146")
+
+ # Disable warning "'=': conversion from 'a' to 'b',
possible loss of data"
+ add_compile_flags("/wd4244")
+
endif()
if(CMAKE_CROSSCOMPILING)
diff --git a/sdk/tools/xml2sdb/CMakeLists.txt b/sdk/tools/xml2sdb/CMakeLists.txt
index 1a59e62fc4..15e2fc73e0 100644
--- a/sdk/tools/xml2sdb/CMakeLists.txt
+++ b/sdk/tools/xml2sdb/CMakeLists.txt
@@ -14,6 +14,9 @@ include_directories(
${REACTOS_SOURCE_DIR}/sdk/include/reactos/appcompat)
add_host_tool(xml2sdb ${SOURCE})
-if(NOT MSVC)
+if(MSVC)
+ # Disable warning "'=': conversion from 'a' to 'b',
possible loss of data"
+ add_target_compile_flags(xml2sdb "/wd4244")
+else()
add_target_compile_flags(xml2sdb "-fshort-wchar")
endif()
diff --git a/sdk/tools/xml2sdb/main.cpp b/sdk/tools/xml2sdb/main.cpp
index c39a08308b..14a7d685cb 100644
--- a/sdk/tools/xml2sdb/main.cpp
+++ b/sdk/tools/xml2sdb/main.cpp
@@ -132,7 +132,7 @@ BOOL WINAPIV ShimDbgPrint(SHIM_LOG_LEVEL Level, PCSTR FunctionName,
PCSTR Format
va_list ArgList;
const char* LevelStr;
- if (Level > g_ShimDebugLevel)
+ if ((ULONG)Level > g_ShimDebugLevel)
return FALSE;
switch (Level)