@@ -517,10 +517,9 @@ static void insert_mark(struct mark_set *s, uintmax_t idnum, struct object_entry
517
517
s -> data .marked [idnum ] = oe ;
518
518
}
519
519
520
- static struct object_entry * find_mark (uintmax_t idnum )
520
+ static void * find_mark (struct mark_set * s , uintmax_t idnum )
521
521
{
522
522
uintmax_t orig_idnum = idnum ;
523
- struct mark_set * s = marks ;
524
523
struct object_entry * oe = NULL ;
525
524
if ((idnum >> s -> shift ) < 1024 ) {
526
525
while (s && s -> shift ) {
@@ -2225,7 +2224,7 @@ static void file_change_m(const char *p, struct branch *b)
2225
2224
}
2226
2225
2227
2226
if (* p == ':' ) {
2228
- oe = find_mark (parse_mark_ref_space (& p ));
2227
+ oe = find_mark (marks , parse_mark_ref_space (& p ));
2229
2228
oidcpy (& oid , & oe -> idx .oid );
2230
2229
} else if (skip_prefix (p , "inline " , & p )) {
2231
2230
inline_data = 1 ;
@@ -2399,7 +2398,7 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
2399
2398
/* Now parse the notemodify command. */
2400
2399
/* <dataref> or 'inline' */
2401
2400
if (* p == ':' ) {
2402
- oe = find_mark (parse_mark_ref_space (& p ));
2401
+ oe = find_mark (marks , parse_mark_ref_space (& p ));
2403
2402
oidcpy (& oid , & oe -> idx .oid );
2404
2403
} else if (skip_prefix (p , "inline " , & p )) {
2405
2404
inline_data = 1 ;
@@ -2420,7 +2419,7 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
2420
2419
oidcpy (& commit_oid , & s -> oid );
2421
2420
} else if (* p == ':' ) {
2422
2421
uintmax_t commit_mark = parse_mark_ref_eol (p );
2423
- struct object_entry * commit_oe = find_mark (commit_mark );
2422
+ struct object_entry * commit_oe = find_mark (marks , commit_mark );
2424
2423
if (commit_oe -> type != OBJ_COMMIT )
2425
2424
die ("Mark :%" PRIuMAX " not a commit" , commit_mark );
2426
2425
oidcpy (& commit_oid , & commit_oe -> idx .oid );
@@ -2524,7 +2523,7 @@ static int parse_objectish(struct branch *b, const char *objectish)
2524
2523
oidcpy (& b -> branch_tree .versions [1 ].oid , t );
2525
2524
} else if (* objectish == ':' ) {
2526
2525
uintmax_t idnum = parse_mark_ref_eol (objectish );
2527
- struct object_entry * oe = find_mark (idnum );
2526
+ struct object_entry * oe = find_mark (marks , idnum );
2528
2527
if (oe -> type != OBJ_COMMIT )
2529
2528
die ("Mark :%" PRIuMAX " not a commit" , idnum );
2530
2529
if (!oideq (& b -> oid , & oe -> idx .oid )) {
@@ -2588,7 +2587,7 @@ static struct hash_list *parse_merge(unsigned int *count)
2588
2587
oidcpy (& n -> oid , & s -> oid );
2589
2588
else if (* from == ':' ) {
2590
2589
uintmax_t idnum = parse_mark_ref_eol (from );
2591
- struct object_entry * oe = find_mark (idnum );
2590
+ struct object_entry * oe = find_mark (marks , idnum );
2592
2591
if (oe -> type != OBJ_COMMIT )
2593
2592
die ("Mark :%" PRIuMAX " not a commit" , idnum );
2594
2593
oidcpy (& n -> oid , & oe -> idx .oid );
@@ -2762,7 +2761,7 @@ static void parse_new_tag(const char *arg)
2762
2761
} else if (* from == ':' ) {
2763
2762
struct object_entry * oe ;
2764
2763
from_mark = parse_mark_ref_eol (from );
2765
- oe = find_mark (from_mark );
2764
+ oe = find_mark (marks , from_mark );
2766
2765
type = oe -> type ;
2767
2766
oidcpy (& oid , & oe -> idx .oid );
2768
2767
} else if (!get_oid (from , & oid )) {
@@ -2920,7 +2919,7 @@ static void parse_get_mark(const char *p)
2920
2919
if (* p != ':' )
2921
2920
die ("Not a mark: %s" , p );
2922
2921
2923
- oe = find_mark (parse_mark_ref_eol (p ));
2922
+ oe = find_mark (marks , parse_mark_ref_eol (p ));
2924
2923
if (!oe )
2925
2924
die ("Unknown mark: %s" , command_buf .buf );
2926
2925
@@ -2935,7 +2934,7 @@ static void parse_cat_blob(const char *p)
2935
2934
2936
2935
/* cat-blob SP <object> LF */
2937
2936
if (* p == ':' ) {
2938
- oe = find_mark (parse_mark_ref_eol (p ));
2937
+ oe = find_mark (marks , parse_mark_ref_eol (p ));
2939
2938
if (!oe )
2940
2939
die ("Unknown mark: %s" , command_buf .buf );
2941
2940
oidcpy (& oid , & oe -> idx .oid );
@@ -3010,7 +3009,7 @@ static struct object_entry *parse_treeish_dataref(const char **p)
3010
3009
struct object_entry * e ;
3011
3010
3012
3011
if (* * p == ':' ) { /* <mark> */
3013
- e = find_mark (parse_mark_ref_space (p ));
3012
+ e = find_mark (marks , parse_mark_ref_space (p ));
3014
3013
if (!e )
3015
3014
die ("Unknown mark: %s" , command_buf .buf );
3016
3015
oidcpy (& oid , & e -> idx .oid );
0 commit comments