Unverified Commit c7a195a1 by Edward Thomson Committed by GitHub

Merge pull request #6006 from boretrk/c11-warnings

GCC C11 warnings
parents efc4e7e5 4bbe5e6e
...@@ -235,6 +235,7 @@ ELSE () ...@@ -235,6 +235,7 @@ ELSE ()
enable_warnings(unused-function) enable_warnings(unused-function)
enable_warnings(int-conversion) enable_warnings(int-conversion)
enable_warnings(c11-extensions) enable_warnings(c11-extensions)
enable_warnings(c99-c11-compat)
# MinGW uses gcc, which expects POSIX formatting for printf, but # MinGW uses gcc, which expects POSIX formatting for printf, but
# uses the Windows C library, which uses its own format specifiers. # uses the Windows C library, which uses its own format specifiers.
......
...@@ -381,14 +381,14 @@ int git_win32_path_readlink_w(git_win32_path dest, const git_win32_path path) ...@@ -381,14 +381,14 @@ int git_win32_path_readlink_w(git_win32_path dest, const git_win32_path path)
switch (reparse_buf->ReparseTag) { switch (reparse_buf->ReparseTag) {
case IO_REPARSE_TAG_SYMLINK: case IO_REPARSE_TAG_SYMLINK:
target = reparse_buf->SymbolicLinkReparseBuffer.PathBuffer + target = reparse_buf->ReparseBuffer.SymbolicLink.PathBuffer +
(reparse_buf->SymbolicLinkReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)); (reparse_buf->ReparseBuffer.SymbolicLink.SubstituteNameOffset / sizeof(WCHAR));
target_len = reparse_buf->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof(WCHAR); target_len = reparse_buf->ReparseBuffer.SymbolicLink.SubstituteNameLength / sizeof(WCHAR);
break; break;
case IO_REPARSE_TAG_MOUNT_POINT: case IO_REPARSE_TAG_MOUNT_POINT:
target = reparse_buf->MountPointReparseBuffer.PathBuffer + target = reparse_buf->ReparseBuffer.MountPoint.PathBuffer +
(reparse_buf->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)); (reparse_buf->ReparseBuffer.MountPoint.SubstituteNameOffset / sizeof(WCHAR));
target_len = reparse_buf->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); target_len = reparse_buf->ReparseBuffer.MountPoint.SubstituteNameLength / sizeof(WCHAR);
break; break;
default: default:
errno = EINVAL; errno = EINVAL;
......
...@@ -26,18 +26,18 @@ typedef struct _GIT_REPARSE_DATA_BUFFER { ...@@ -26,18 +26,18 @@ typedef struct _GIT_REPARSE_DATA_BUFFER {
USHORT PrintNameLength; USHORT PrintNameLength;
ULONG Flags; ULONG Flags;
WCHAR PathBuffer[1]; WCHAR PathBuffer[1];
} SymbolicLinkReparseBuffer; } SymbolicLink;
struct { struct {
USHORT SubstituteNameOffset; USHORT SubstituteNameOffset;
USHORT SubstituteNameLength; USHORT SubstituteNameLength;
USHORT PrintNameOffset; USHORT PrintNameOffset;
USHORT PrintNameLength; USHORT PrintNameLength;
WCHAR PathBuffer[1]; WCHAR PathBuffer[1];
} MountPointReparseBuffer; } MountPoint;
struct { struct {
UCHAR DataBuffer[1]; UCHAR DataBuffer[1];
} GenericReparseBuffer; } Generic;
}; } ReparseBuffer;
} GIT_REPARSE_DATA_BUFFER; } GIT_REPARSE_DATA_BUFFER;
#define REPARSE_DATA_HEADER_SIZE 8 #define REPARSE_DATA_HEADER_SIZE 8
......
...@@ -123,7 +123,7 @@ static void do_junction(const char *old, const char *new) ...@@ -123,7 +123,7 @@ static void do_junction(const char *old, const char *new)
reparse_buf = LocalAlloc(LMEM_FIXED|LMEM_ZEROINIT, reparse_buflen); reparse_buf = LocalAlloc(LMEM_FIXED|LMEM_ZEROINIT, reparse_buflen);
cl_assert(reparse_buf); cl_assert(reparse_buf);
subst_utf16 = reparse_buf->MountPointReparseBuffer.PathBuffer; subst_utf16 = reparse_buf->ReparseBuffer.MountPoint.PathBuffer;
print_utf16 = subst_utf16 + subst_utf16_len + 1; print_utf16 = subst_utf16 + subst_utf16_len + 1;
ret = git__utf8_to_16(subst_utf16, subst_utf16_len + 1, ret = git__utf8_to_16(subst_utf16, subst_utf16_len + 1,
...@@ -135,10 +135,10 @@ static void do_junction(const char *old, const char *new) ...@@ -135,10 +135,10 @@ static void do_junction(const char *old, const char *new)
cl_assert_equal_i(print_utf16_len, ret); cl_assert_equal_i(print_utf16_len, ret);
reparse_buf->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT; reparse_buf->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
reparse_buf->MountPointReparseBuffer.SubstituteNameOffset = 0; reparse_buf->ReparseBuffer.MountPoint.SubstituteNameOffset = 0;
reparse_buf->MountPointReparseBuffer.SubstituteNameLength = subst_byte_len; reparse_buf->ReparseBuffer.MountPoint.SubstituteNameLength = subst_byte_len;
reparse_buf->MountPointReparseBuffer.PrintNameOffset = (USHORT)(subst_byte_len + sizeof(WCHAR)); reparse_buf->ReparseBuffer.MountPoint.PrintNameOffset = (USHORT)(subst_byte_len + sizeof(WCHAR));
reparse_buf->MountPointReparseBuffer.PrintNameLength = print_byte_len; reparse_buf->ReparseBuffer.MountPoint.PrintNameLength = print_byte_len;
reparse_buf->ReparseDataLength = reparse_buflen - REPARSE_DATA_HEADER_SIZE; reparse_buf->ReparseDataLength = reparse_buflen - REPARSE_DATA_HEADER_SIZE;
cl_win32_pass(DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, cl_win32_pass(DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment