Skip to content

Commit 9e9ab40

Browse files
committed
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()
2 parents 024c843 + e4ac953 commit 9e9ab40

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

convert.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ static int ident_to_worktree(const char *path, const char *src, size_t len,
641641
return 1;
642642
}
643643

644-
static int git_path_check_crlf(const char *path, struct git_attr_check *check)
644+
static enum crlf_action git_path_check_crlf(const char *path, struct git_attr_check *check)
645645
{
646646
const char *value = check->value;
647647

@@ -658,7 +658,7 @@ static int git_path_check_crlf(const char *path, struct git_attr_check *check)
658658
return CRLF_GUESS;
659659
}
660660

661-
static int git_path_check_eol(const char *path, struct git_attr_check *check)
661+
static enum crlf_action git_path_check_eol(const char *path, struct git_attr_check *check)
662662
{
663663
const char *value = check->value;
664664

@@ -811,7 +811,7 @@ int renormalize_buffer(const char *path, const char *src, size_t len, struct str
811811
src = dst->buf;
812812
len = dst->len;
813813
}
814-
return ret | convert_to_git(path, src, len, dst, 0);
814+
return ret | convert_to_git(path, src, len, dst, SAFE_CRLF_FALSE);
815815
}
816816

817817
/*****************************************************************

git-compat-util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ extern char *gitbasename(char *);
219219
#define find_last_dir_sep(path) strrchr(path, '/')
220220
#endif
221221

222-
#if __HP_cc >= 61000
222+
#if defined(__HP_cc) && (__HP_cc >= 61000)
223223
#define NORETURN __attribute__((noreturn))
224224
#define NORETURN_PTR
225225
#elif defined(__GNUC__) && !defined(NO_NORETURN)

http.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -747,14 +747,6 @@ static inline int needs_quote(int ch)
747747
return 1;
748748
}
749749

750-
static inline int hex(int v)
751-
{
752-
if (v < 10)
753-
return '0' + v;
754-
else
755-
return 'A' + v - 10;
756-
}
757-
758750
static char *quote_ref_url(const char *base, const char *ref)
759751
{
760752
struct strbuf buf = STRBUF_INIT;

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2616,7 +2616,7 @@ static int index_mem(unsigned char *sha1, void *buf, size_t size,
26162616
if ((type == OBJ_BLOB) && path) {
26172617
struct strbuf nbuf = STRBUF_INIT;
26182618
if (convert_to_git(path, buf, size, &nbuf,
2619-
write_object ? safe_crlf : 0)) {
2619+
write_object ? safe_crlf : SAFE_CRLF_FALSE)) {
26202620
buf = strbuf_detach(&nbuf, &size);
26212621
re_allocated = 1;
26222622
}

0 commit comments

Comments
 (0)