https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c02257ef57858bfe91f10…
commit c02257ef57858bfe91f106e8c91c669e4a141293
Author: Colin Finck <colin(a)reactos.org>
AuthorDate: Sat Apr 27 11:35:04 2019 +0200
Commit: Colin Finck <colin(a)reactos.org>
CommitDate: Sun Apr 28 23:22:53 2019 +0200
[ISOHYBRID] Fix the remaining warnings properly.
I will send these changes upstream (minus the REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
ifdefs).
---
sdk/tools/isohybrid/CMakeLists.txt | 8 --------
sdk/tools/isohybrid/isohybrid.c | 17 +++++++++++------
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/sdk/tools/isohybrid/CMakeLists.txt b/sdk/tools/isohybrid/CMakeLists.txt
index d24f3b95cb..13b57e1aff 100644
--- a/sdk/tools/isohybrid/CMakeLists.txt
+++ b/sdk/tools/isohybrid/CMakeLists.txt
@@ -5,11 +5,3 @@ 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 b8d2da6f36..7ca2abc456 100644
--- a/sdk/tools/isohybrid/isohybrid.c
+++ b/sdk/tools/isohybrid/isohybrid.c
@@ -603,7 +603,7 @@ void
read_mbr_template(char *path, uint8_t *mbr)
{
FILE *fp;
- int ret;
+ size_t ret;
fp = fopen(path, "rb");
if (fp == NULL)
@@ -616,7 +616,7 @@ read_mbr_template(char *path, uint8_t *mbr)
}
-int
+size_t
initialise_mbr(uint8_t *mbr)
{
int i = 0;
@@ -975,7 +975,10 @@ main(int argc, char *argv[])
FILE *fp = NULL;
uint8_t *buf = NULL, *bufz = NULL;
int cylsize = 0, frac = 0;
+ size_t mbr_size;
+#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
size_t orig_gpt_size, free_space, gpt_size;
+#endif
struct iso_primary_descriptor descriptor;
prog = strcpy(alloca(strlen(argv[0]) + 1), argv[0]);
@@ -1089,7 +1092,9 @@ main(int argc, char *argv[])
err(1, "%s", argv[0]);
isosize = lendian_int(descriptor.size) * lendian_short(descriptor.block_size);
+#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
free_space = isostat.st_size - isosize;
+#endif
cylsize = head * sector * 512;
frac = isostat.st_size % cylsize;
@@ -1127,15 +1132,15 @@ main(int argc, char *argv[])
buf = bufz;
memset(buf, 0, BUFSIZE);
- i = initialise_mbr(buf);
+ mbr_size = initialise_mbr(buf);
if (mode & VERBOSE)
- display_mbr(buf, i);
+ display_mbr(buf, mbr_size);
if (fseeko(fp, (off_t) 0, SEEK_SET))
err(1, "%s: seek error - 5", argv[0]);
- if (fwrite(buf, sizeof(char), i, fp) != (size_t)i)
+ if (fwrite(buf, sizeof(char), mbr_size, fp) != mbr_size)
err(1, "%s: write error - 1", argv[0]);
#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
@@ -1177,7 +1182,7 @@ main(int argc, char *argv[])
if (fseeko(fp, (off_t) 512, SEEK_SET))
err(1, "%s: seek error - 6", argv[0]);
- if (fwrite(buf, sizeof(char), gpt_size, fp) != (size_t)gpt_size)
+ if (fwrite(buf, sizeof(char), gpt_size, fp) != gpt_size)
err(1, "%s: write error - 2", argv[0]);
}