From: Junio C Hamano Date: Thu, 24 Jan 2013 05:19:00 +0000 (-0800) Subject: Merge branch 'jk/suppress-clang-warning' X-Git-Tag: v1.8.2-rc0~91 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/fa2f83c654f36d666ef7c07e40e0d62a02fbfa06?ds=inline;hp=-c Merge branch 'jk/suppress-clang-warning' * jk/suppress-clang-warning: fix clang -Wunused-value warnings for error functions --- fa2f83c654f36d666ef7c07e40e0d62a02fbfa06 diff --combined cache.h index 4022b5ba0a,98b62bcb5a..1f96f659e4 --- a/cache.h +++ b/cache.h @@@ -362,7 -362,6 +362,7 @@@ static inline enum object_type object_t #define GIT_NOTES_DISPLAY_REF_ENVIRONMENT "GIT_NOTES_DISPLAY_REF" #define GIT_NOTES_REWRITE_REF_ENVIRONMENT "GIT_NOTES_REWRITE_REF" #define GIT_NOTES_REWRITE_MODE_ENVIRONMENT "GIT_NOTES_REWRITE_MODE" +#define GIT_LITERAL_PATHSPECS_ENVIRONMENT "GIT_LITERAL_PATHSPECS" /* * Repository-local GIT_* environment variables @@@ -474,8 -473,6 +474,8 @@@ extern int index_name_is_other(const st extern int ie_match_stat(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); extern int ie_modified(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); +#define PATHSPEC_ONESTAR 1 /* the pathspec pattern sastisfies GFNM_ONESTAR */ + struct pathspec { const char **raw; /* get_pathspec() result, not freed by free_pathspec() */ int nr; @@@ -485,8 -482,7 +485,8 @@@ struct pathspec_item { const char *match; int len; - unsigned int use_wildcard:1; + int nowildcard_len; + int flags; } *items; }; @@@ -494,8 -490,6 +494,8 @@@ extern int init_pathspec(struct pathspe extern void free_pathspec(struct pathspec *); extern int ce_path_match(const struct cache_entry *ce, const struct pathspec *pathspec); +extern int limit_pathspec_to_literal(void); + #define HASH_WRITE_OBJECT 1 #define HASH_FORMAT_CHECK 2 extern int index_fd(unsigned char *sha1, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags); @@@ -720,11 -714,10 +720,11 @@@ static inline int is_absolute_path(cons } int is_directory(const char *); const char *real_path(const char *path); +const char *real_path_if_valid(const char *path); const char *absolute_path(const char *path); const char *relative_path(const char *abs, const char *base); int normalize_path_copy(char *dst, const char *src); -int longest_ancestor_length(const char *path, const char *prefix_list); +int longest_ancestor_length(const char *path, struct string_list *prefixes); char *strip_path_suffix(const char *path, const char *suffix); int daemon_avoid_alias(const char *path); int offset_1st_component(const char *path); @@@ -1006,18 -999,14 +1006,18 @@@ struct ref unsigned char old_sha1[20]; unsigned char new_sha1[20]; char *symref; - unsigned int force:1, + unsigned int + force:1, + requires_force:1, merge:1, nonfastforward:1, + update:1, deletion:1; enum { REF_STATUS_NONE = 0, REF_STATUS_OK, REF_STATUS_REJECT_NONFASTFORWARD, + REF_STATUS_REJECT_ALREADY_EXISTS, REF_STATUS_REJECT_NODELETE, REF_STATUS_UPTODATE, REF_STATUS_REMOTE_REJECT, @@@ -1147,7 -1136,7 +1147,7 @@@ extern int check_repository_format_vers extern int git_env_bool(const char *, int); extern int git_config_system(void); extern int config_error_nonbool(const char *); - #ifdef __GNUC__ + #if defined(__GNUC__) && ! defined(__clang__) #define config_error_nonbool(s) (config_error_nonbool(s), -1) #endif extern const char *get_log_output_encoding(void); @@@ -1169,7 -1158,6 +1169,7 @@@ extern int author_ident_sufficiently_gi extern const char *git_commit_encoding; extern const char *git_log_output_encoding; extern const char *git_mailmap_file; +extern const char *git_mailmap_blob; /* IO helper functions */ extern void maybe_flush_or_die(FILE *, const char *); diff --combined git-compat-util.h index e5a4b7450b,77fd848511..dab545e02e --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -75,7 -75,7 +75,7 @@@ # endif #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \ !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \ - !defined(__TANDEM) + !defined(__TANDEM) && !defined(__QNX__) #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ #endif @@@ -99,14 -99,12 +99,14 @@@ #include #include #include -#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */ +#ifdef HAVE_STRINGS_H #include /* for strcasecmp() */ #endif #include #include +#ifdef NEEDS_SYS_PARAM_H #include +#endif #include #include #include @@@ -297,7 -295,7 +297,7 @@@ extern void warning(const char *err, .. * behavior. But since we're only trying to help gcc, anyway, it's OK; other * compilers will fall back to using the function as usual. */ - #ifdef __GNUC__ + #if defined(__GNUC__) && ! defined(__clang__) #define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1) #endif @@@ -424,10 -422,6 +424,10 @@@ void *gitmemmem(const void *haystack, s const void *needle, size_t needlelen); #endif +#ifdef NO_GETPAGESIZE +#define getpagesize() sysconf(_SC_PAGESIZE) +#endif + #ifdef FREAD_READS_DIRECTORIES #ifdef fopen #undef fopen @@@ -528,19 -522,13 +528,19 @@@ extern const char tolower_trans_tbl[256 #undef isupper #undef tolower #undef toupper -extern unsigned char sane_ctype[256]; +#undef iscntrl +#undef ispunct +#undef isxdigit + +extern const unsigned char sane_ctype[256]; #define GIT_SPACE 0x01 #define GIT_DIGIT 0x02 #define GIT_ALPHA 0x04 #define GIT_GLOB_SPECIAL 0x08 #define GIT_REGEX_SPECIAL 0x10 #define GIT_PATHSPEC_MAGIC 0x20 +#define GIT_CNTRL 0x40 +#define GIT_PUNCT 0x80 #define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0) #define isascii(x) (((x) & ~0x7f) == 0) #define isspace(x) sane_istest(x,GIT_SPACE) @@@ -552,10 -540,6 +552,10 @@@ #define isupper(x) sane_iscase(x, 0) #define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL) #define is_regex_special(x) sane_istest(x,GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL) +#define iscntrl(x) (sane_istest(x,GIT_CNTRL)) +#define ispunct(x) sane_istest(x, GIT_PUNCT | GIT_REGEX_SPECIAL | \ + GIT_GLOB_SPECIAL | GIT_PATHSPEC_MAGIC) +#define isxdigit(x) (hexval_table[x] != -1) #define tolower(x) sane_case((unsigned char)(x), 0x20) #define toupper(x) sane_case((unsigned char)(x), 0) #define is_pathspec_magic(x) sane_istest(x,GIT_PATHSPEC_MAGIC) @@@ -664,12 -648,8 +664,12 @@@ int rmdir_or_warn(const char *path) */ int remove_or_warn(unsigned int mode, const char *path); -/* Call access(2), but warn for any error besides ENOENT. */ +/* + * Call access(2), but warn for any error except "missing file" + * (ENOENT or ENOTDIR). + */ int access_or_warn(const char *path, int mode); +int access_or_die(const char *path, int mode); /* Warn on an inaccessible file that ought to be accessible */ void warn_on_inaccessible(const char *path);