]> wimlib.net Git - wimlib/blobdiff - src/wim.c
Use explicit casting in ctype macros
[wimlib] / src / wim.c
index 600176e698841f56a3c1bbe4f0d81ec2fe3f3ee7..df8678904dd6d4573e10883af51bfcfda0a3031f 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -44,9 +44,7 @@
 #include "wimlib/security.h"
 #include "wimlib/wim.h"
 #include "wimlib/xml.h"
-#ifdef __WIN32__
-#  include "wimlib/win32.h" /* for realpath() replacement */
-#endif
+#include "wimlib/win32.h"
 
 /* Information about the available compression types for the WIM format.  */
 static const struct {
@@ -189,7 +187,7 @@ wimlib_create_new_wim(enum wimlib_compression_type ctype, WIMStruct **wim_ret)
        wim->hdr.wim_version = WIM_VERSION_DEFAULT;
        wim->hdr.flags = 0;
        wim->hdr.chunk_size = 0;
-       randomize_byte_array(wim->hdr.guid, WIMLIB_GUID_LEN);
+       generate_guid(wim->hdr.guid);
        wim->hdr.part_number = 1;
        wim->hdr.total_parts = 1;
        wim->hdr.image_count = 0;
@@ -450,7 +448,7 @@ WIMLIBAPI int
 wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info)
 {
        memset(info, 0, sizeof(struct wimlib_wim_info));
-       memcpy(info->guid, wim->hdr.guid, WIMLIB_GUID_LEN);
+       copy_guid(info->guid, wim->hdr.guid);
        info->image_count = wim->hdr.image_count;
        info->boot_index = wim->hdr.boot_idx;
        info->wim_version = wim->hdr.wim_version;
@@ -496,7 +494,7 @@ wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info, int whic
        }
 
        if (which & WIMLIB_CHANGE_GUID)
-               memcpy(wim->hdr.guid, info->guid, WIM_GUID_LEN);
+               copy_guid(wim->hdr.guid, info->guid);
 
        if (which & WIMLIB_CHANGE_BOOT_INDEX)
                wim->hdr.boot_idx = info->boot_index;