{
PHMAP_ENTRY BlockList;
PHBIN Bin;
- SIZE_T BinSize;
+ ULONG BinSize;
ULONG i;
ULONG BitmapSize;
ULONG BlockCount;
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)
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;
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)
0);
if (RequiredSize != NULL)
- *RequiredSize = Size + 1;
+ *RequiredSize = (ULONG)Size + 1;
if (ReturnBuffer != NULL)
{
#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)
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)
add_subdirectory(log2lines)
add_subdirectory(rsym)
endif()
-
-add_subdirectory(fatten)
/* 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 */
{
#if defined(_WIN32)
FILETIME FileTime;
- HANDLE FileNo = (HANDLE)_fileno(FileHandle);
+ HANDLE FileNo = UlongToHandle(_fileno(FileHandle));
if (GetFileTime(FileNo, NULL, NULL, &FileTime))
FileTimeToDosDateTime(&FileTime,
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()
#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>
--- /dev/null
+
+#pragma once
+
+#if defined(_WIN32)
+#include <io.h>
+#define HAVE_PROCESS_H 1
+#endif
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()
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()
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 */
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]);
#ifdef _WIN32
#include <malloc.h>
#include <windows.h>
+#include <process.h>
+#include <io.h>
#else
#include <alloca.h>
#include <unistd.h>
typedef struct tagSCVK
{
USHORT ScanCode;
- USHORT VirtualKey;
+ UCHAR VirtualKey;
PCHAR Name;
BOOLEAN Processed;
} SCVK, *PSCVK;
main(INT argc,
PCHAR* argv)
{
- ULONG i, ErrorCode, FailureCode;
+ int i;
+ ULONG ErrorCode, FailureCode;
CHAR Option;
PCHAR OpenFlags;
CHAR BuildOptions[16] = {0};
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)
0,
Type,
(PVOID)Str,
- Size * sizeof(WCHAR));
+ (ULONG)(Size * sizeof(WCHAR)));
}
else
{
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);
}
0,
Type,
(PVOID)Data,
- Size);
+ (ULONG)Size);
free(Data);
}
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.
#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 */
int main(int argc, const char *argv[])
{
- unsigned i;
+ int i;
const char *pszOutputPath = "shortcut.lnk";
const char *pszTarget = NULL;
const char *pszDescription = "Description";
{
/* Skip leading underscore and remove trailing decoration */
pcName++;
- nNameLength = pcAt - pcName;
+ nNameLength = (int)(pcAt - pcName);
}
/* Print the undecorated function name */
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 */
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()
/* 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;
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:
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) &&
}
return utf8; // no valid bom so use utf8 as default
}
- int getByte(unsigned char &c)
+ std::streamsize getByte(unsigned char &c)
{
if (fill)
{
return inputfile.gcount();
}
}
- int getWord(unsigned short &w)
+ std::streamsize getWord(unsigned short &w)
{
unsigned char c[2];
if (!getByte(c[0]))
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++)
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()
--- /dev/null
+
+#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);
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)
${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()
va_list ArgList;
const char* LevelStr;
- if (Level > g_ShimDebugLevel)
+ if ((ULONG)Level > g_ShimDebugLevel)
return FALSE;
switch (Level)