diff options
Diffstat (limited to 'compat')
| -rw-r--r-- | compat/fsmonitor/fsm-listen-darwin.c | 3 | ||||
| -rw-r--r-- | compat/mingw.c | 3 | ||||
| -rw-r--r-- | compat/poll/poll.c | 2 | ||||
| -rw-r--r-- | compat/regex/regex.c | 2 | ||||
| -rw-r--r-- | compat/terminal.c | 3 | ||||
| -rw-r--r-- | compat/win32/headless.c | 17 | ||||
| -rw-r--r-- | compat/win32mmap.c | 2 | ||||
| -rw-r--r-- | compat/winansi.c | 2 |
8 files changed, 21 insertions, 13 deletions
diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c index dfa551459d..43c3a915a0 100644 --- a/compat/fsmonitor/fsm-listen-darwin.c +++ b/compat/fsmonitor/fsm-listen-darwin.c @@ -208,13 +208,12 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef UNUSED, const char *slash; char *resolved = NULL; struct strbuf tmp = STRBUF_INIT; - int k; /* * Build a list of all filesystem changes into a private/local * list and without holding any locks. */ - for (k = 0; k < num_of_events; k++) { + for (size_t k = 0; k < num_of_events; k++) { /* * On Mac, we receive an array of absolute paths. */ diff --git a/compat/mingw.c b/compat/mingw.c index 63f36c893b..1d5b211b54 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1,4 +1,5 @@ #define USE_THE_REPOSITORY_VARIABLE +#define DISABLE_SIGN_COMPARE_WARNINGS #include "../git-compat-util.h" #include "win32.h" @@ -2277,7 +2278,7 @@ repeat: old_handle = CreateFileW(wpold, DELETE, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); if (old_handle == INVALID_HANDLE_VALUE) { errno = err_win_to_posix(GetLastError()); return -1; diff --git a/compat/poll/poll.c b/compat/poll/poll.c index afa6d24584..a2becd16cd 100644 --- a/compat/poll/poll.c +++ b/compat/poll/poll.c @@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#define DISABLE_SIGN_COMPARE_WARNINGS + /* To bump the minimum Windows version to Windows Vista */ #include "git-compat-util.h" diff --git a/compat/regex/regex.c b/compat/regex/regex.c index e6f4a5d177..4b09cc4e14 100644 --- a/compat/regex/regex.c +++ b/compat/regex/regex.c @@ -17,6 +17,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#pragma GCC diagnostic ignored "-Wsign-compare" + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/compat/terminal.c b/compat/terminal.c index d54efa1c5d..584f27bf7e 100644 --- a/compat/terminal.c +++ b/compat/terminal.c @@ -259,14 +259,13 @@ static DWORD cmode_in, cmode_out; void restore_term(void) { if (use_stty) { - int i; struct child_process cp = CHILD_PROCESS_INIT; if (stty_restore.nr == 0) return; strvec_push(&cp.args, "stty"); - for (i = 0; i < stty_restore.nr; i++) + for (size_t i = 0; i < stty_restore.nr; i++) strvec_push(&cp.args, stty_restore.items[i].string); run_command(&cp); string_list_clear(&stty_restore, 0); diff --git a/compat/win32/headless.c b/compat/win32/headless.c index 11392a0b9a..a6eb116ddc 100644 --- a/compat/win32/headless.c +++ b/compat/win32/headless.c @@ -53,7 +53,8 @@ int WINAPI wWinMain(_In_ HINSTANCE instance, wchar_t git_command_line[32768]; size_t size = sizeof(git_command_line) / sizeof(wchar_t); const wchar_t *needs_quotes = L""; - int slash = 0, i; + size_t slash = 0; + int len; STARTUPINFO startup_info = { .cb = sizeof(STARTUPINFO), @@ -66,7 +67,7 @@ int WINAPI wWinMain(_In_ HINSTANCE instance, DWORD exit_code; /* First, determine the full path of argv[0] */ - for (i = 0; _wpgmptr[i]; i++) + for (size_t i = 0; _wpgmptr[i]; i++) if (_wpgmptr[i] == L' ') needs_quotes = L"\""; else if (_wpgmptr[i] == L'\\') @@ -79,16 +80,16 @@ int WINAPI wWinMain(_In_ HINSTANCE instance, extend_path(_wpgmptr, slash); /* Then, add the full path of `git.exe` as argv[0] */ - i = swprintf_s(git_command_line, size, L"%ls%.*ls\\git.exe%ls", - needs_quotes, slash, _wpgmptr, needs_quotes); - if (i < 0) + len = swprintf_s(git_command_line, size, L"%ls%.*ls\\git.exe%ls", + needs_quotes, (int) slash, _wpgmptr, needs_quotes); + if (len < 0) return 127; /* Too long path */ if (*command_line) { /* Now, append the command-line arguments */ - i = swprintf_s(git_command_line + i, size - i, - L" %ls", command_line); - if (i < 0) + len = swprintf_s(git_command_line + len, size - len, + L" %ls", command_line); + if (len < 0) return 127; } diff --git a/compat/win32mmap.c b/compat/win32mmap.c index a4ab4cb939..e951934316 100644 --- a/compat/win32mmap.c +++ b/compat/win32mmap.c @@ -1,3 +1,5 @@ +#define DISABLE_SIGN_COMPARE_WARNINGS + #include "../git-compat-util.h" void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) diff --git a/compat/winansi.c b/compat/winansi.c index 1b3f916b9f..ac2ffb7869 100644 --- a/compat/winansi.c +++ b/compat/winansi.c @@ -4,6 +4,8 @@ #undef NOGDI +#define DISABLE_SIGN_COMPARE_WARNINGS + #include "../git-compat-util.h" #include <wingdi.h> #include <winreg.h> |
