@@ -51,7 +51,7 @@ static void get_next_component(struct strbuf *next, struct strbuf *remaining)
/* copies root part from remaining to resolved, canonicalizing it on the way */
static void get_root_part(struct strbuf *resolved, struct strbuf *remaining)
{
- int offset = offset_1st_component(remaining->buf);
+ size_t offset = offset_1st_component(remaining->buf);
strbuf_reset(resolved);
strbuf_add(resolved, remaining->buf, offset);
@@ -1,13 +1,13 @@
#include "../git-compat-util.h"
-int mingw_cygwin_skip_dos_drive_prefix(char **path)
+size_t mingw_cygwin_skip_dos_drive_prefix(char **path)
{
- int ret = has_dos_drive_prefix(*path);
+ size_t ret = has_dos_drive_prefix(*path);
*path += ret;
return ret;
}
-int mingw_cygwin_offset_1st_component(const char *path)
+size_t mingw_cygwin_offset_1st_component(const char *path)
{
char *pos = (char *)path;
@@ -1,6 +1,6 @@
#define has_dos_drive_prefix(path) \
(isalpha(*(path)) && (path)[1] == ':' ? 2 : 0)
-int mingw_cygwin_skip_dos_drive_prefix(char **path);
+size_t mingw_cygwin_skip_dos_drive_prefix(char **path);
#define skip_dos_drive_prefix mingw_cygwin_skip_dos_drive_prefix
static inline int mingw_cygwin_is_dir_sep(int c)
{
@@ -16,5 +16,5 @@ static inline char *mingw_cygwin_find_last_dir_sep(const char *path)
return ret;
}
#define find_last_dir_sep mingw_cygwin_find_last_dir_sep
-int mingw_cygwin_offset_1st_component(const char *path);
+size_t mingw_cygwin_offset_1st_component(const char *path);
#define offset_1st_component mingw_cygwin_offset_1st_component
@@ -355,16 +355,18 @@ static inline int noop_core_config(const char *var, const char *value, void *cb)
#endif
#ifndef has_dos_drive_prefix
-static inline int git_has_dos_drive_prefix(const char *path)
+static inline size_t git_has_dos_drive_prefix(const char *path)
{
+ (void)path;
return 0;
}
#define has_dos_drive_prefix git_has_dos_drive_prefix
#endif
#ifndef skip_dos_drive_prefix
-static inline int git_skip_dos_drive_prefix(char **path)
+static inline size_t git_skip_dos_drive_prefix(char **path)
{
+ (void)path;
return 0;
}
#define skip_dos_drive_prefix git_skip_dos_drive_prefix
@@ -379,7 +381,7 @@ static inline int git_is_dir_sep(int c)
#endif
#ifndef offset_1st_component
-static inline int git_offset_1st_component(const char *path)
+static inline size_t git_offset_1st_component(const char *path)
{
return is_dir_sep(path[0]);
}
@@ -29,7 +29,7 @@ static int abspath_part_inside_repo(char *path)
size_t len;
size_t wtlen;
char *path0;
- int off;
+ size_t off;
const char *work_tree = get_git_work_tree();
if (!work_tree)
@@ -800,7 +800,7 @@ static const char *setup_bare_git_dir(struct strbuf *cwd, int offset,
struct repository_format *repo_fmt,
int *nongit_ok)
{
- int root_len;
+ size_t root_len;
if (check_repository_format_gently(".", repo_fmt, nongit_ok))
return NULL;