drop casts from users EMPTY_TREE_SHA1_BIN
This macro already evaluates to the correct type, as it casts the string literal to "unsigned char *" itself (and callers who want the literal can use the _LITERAL form). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Mar 22, 2012 at 14:53 UTC
cba595bd21fd0731e37898dbd6c5b55f65fd8aea
3 files changed
+3
-3
builtin/diff.c
+1
-1
@@ -327,7 +327,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
327
add_head_to_pending(&rev);
328
if (!rev.pending.nr) {
329
struct tree *tree;
330
- tree = lookup_tree((const unsigned char*)EMPTY_TREE_SHA1_BIN);
330
+ tree = lookup_tree(EMPTY_TREE_SHA1_BIN);
331
add_pending_object(&rev, &tree->object, "HEAD");
332
}
333
break;
merge-recursive.c
+1
-1
@@ -1914,7 +1914,7 @@ int merge_recursive(struct merge_options *o,
1914
/* if there is no common ancestor, use an empty tree */
1915
struct tree *tree;
1916
1917
- tree = lookup_tree((const unsigned char *)EMPTY_TREE_SHA1_BIN);
1917
+ tree = lookup_tree(EMPTY_TREE_SHA1_BIN);
1918
merged_common_ancestors = make_virtual_commit(tree, "ancestor");
1919
}
1920
sequencer.c
+1
-1
@@ -164,7 +164,7 @@ static void write_message(struct strbuf *msgbuf, const char *filename)
164
165
static struct tree *empty_tree(void)
166
{
167
- return lookup_tree((const unsigned char *)EMPTY_TREE_SHA1_BIN);
167
+ return lookup_tree(EMPTY_TREE_SHA1_BIN);
168
}
169
170
static int error_dirty_index(struct replay_opts *opts)