]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reflog: rename unreachable
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 17 Nov 2024 01:31:49 +0000 (01:31 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Nov 2024 00:42:08 +0000 (09:42 +0900)
In C23, "unreachable" is a macro that invokes undefined behavior if it
is invoked.  To make sure that our code compiles on a variety of C
versions, rename unreachable to "is_unreachable".

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reflog.c

index 875ac1aa6620d21ec3794132a4030969a946428b..aeab78c9b71573c0e043f2de833a7e97580d20f6 100644 (file)
--- a/reflog.c
+++ b/reflog.c
@@ -210,7 +210,7 @@ static void mark_reachable(struct expire_reflog_policy_cb *cb)
        cb->mark_list = leftover;
 }
 
-static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid)
+static int is_unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid)
 {
        /*
         * We may or may not have the commit yet - if not, look it
@@ -265,7 +265,7 @@ int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
                        return 1;
                case UE_NORMAL:
                case UE_HEAD:
-                       if (unreachable(cb, old_commit, ooid) || unreachable(cb, new_commit, noid))
+                       if (is_unreachable(cb, old_commit, ooid) || is_unreachable(cb, new_commit, noid))
                                return 1;
                        break;
                }