Merge branch 'rr/misc-fixes'

* rr/misc-fixes:
  git-compat-util: don't assume value for undefined variable
  sha1_file: don't mix enum with int
  convert: don't mix enum with int
  http: remove unused function hex()
This commit is contained in:
Junio C Hamano 2011-11-18 14:13:48 -08:00
commit 9e9ab40711
4 changed files with 5 additions and 13 deletions

View File

@ -641,7 +641,7 @@ static int ident_to_worktree(const char *path, const char *src, size_t len,
return 1; return 1;
} }
static int git_path_check_crlf(const char *path, struct git_attr_check *check) static enum crlf_action git_path_check_crlf(const char *path, struct git_attr_check *check)
{ {
const char *value = check->value; const char *value = check->value;
@ -658,7 +658,7 @@ static int git_path_check_crlf(const char *path, struct git_attr_check *check)
return CRLF_GUESS; return CRLF_GUESS;
} }
static int git_path_check_eol(const char *path, struct git_attr_check *check) static enum crlf_action git_path_check_eol(const char *path, struct git_attr_check *check)
{ {
const char *value = check->value; const char *value = check->value;
@ -811,7 +811,7 @@ int renormalize_buffer(const char *path, const char *src, size_t len, struct str
src = dst->buf; src = dst->buf;
len = dst->len; len = dst->len;
} }
return ret | convert_to_git(path, src, len, dst, 0); return ret | convert_to_git(path, src, len, dst, SAFE_CRLF_FALSE);
} }
/***************************************************************** /*****************************************************************

View File

@ -219,7 +219,7 @@ extern char *gitbasename(char *);
#define find_last_dir_sep(path) strrchr(path, '/') #define find_last_dir_sep(path) strrchr(path, '/')
#endif #endif
#if __HP_cc >= 61000 #if defined(__HP_cc) && (__HP_cc >= 61000)
#define NORETURN __attribute__((noreturn)) #define NORETURN __attribute__((noreturn))
#define NORETURN_PTR #define NORETURN_PTR
#elif defined(__GNUC__) && !defined(NO_NORETURN) #elif defined(__GNUC__) && !defined(NO_NORETURN)

8
http.c
View File

@ -747,14 +747,6 @@ static inline int needs_quote(int ch)
return 1; return 1;
} }
static inline int hex(int v)
{
if (v < 10)
return '0' + v;
else
return 'A' + v - 10;
}
static char *quote_ref_url(const char *base, const char *ref) static char *quote_ref_url(const char *base, const char *ref)
{ {
struct strbuf buf = STRBUF_INIT; struct strbuf buf = STRBUF_INIT;

View File

@ -2616,7 +2616,7 @@ static int index_mem(unsigned char *sha1, void *buf, size_t size,
if ((type == OBJ_BLOB) && path) { if ((type == OBJ_BLOB) && path) {
struct strbuf nbuf = STRBUF_INIT; struct strbuf nbuf = STRBUF_INIT;
if (convert_to_git(path, buf, size, &nbuf, if (convert_to_git(path, buf, size, &nbuf,
write_object ? safe_crlf : 0)) { write_object ? safe_crlf : SAFE_CRLF_FALSE)) {
buf = strbuf_detach(&nbuf, &size); buf = strbuf_detach(&nbuf, &size);
re_allocated = 1; re_allocated = 1;
} }