]> git.ipfire.org Git - pakfire.git/commitdiff
build: Replace the bitfield with a state enum
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Oct 2024 13:07:26 +0000 (13:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Oct 2024 15:13:08 +0000 (15:13 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/build.c

index 9d6dfc26c17a3cba67a32bbc91baaca29aea6ca6..a2dac5a8194f331f569744b74c333f6199c5c1ef 100644 (file)
@@ -102,8 +102,11 @@ struct pakfire_build {
        // ccache path
        char ccache_path[PATH_MAX];
 
-       // States
-       int init:1;
+       // State
+       enum pakfire_build_states {
+               PAKFIRE_BUILD_INIT = 0,
+               PAKFIRE_BUILD_READY,
+       } state;
 };
 
 #define TEMPLATE \
@@ -1698,7 +1701,7 @@ static int pakfire_build_init(struct pakfire_build* build) {
        int r;
 
        // Don't do it again
-       if (build->init) {
+       if (build->state != PAKFIRE_BUILD_INIT) {
                CTX_DEBUG(build->ctx, "Build environment has already been initialized\n");
                return 0;
        }
@@ -1728,8 +1731,8 @@ static int pakfire_build_init(struct pakfire_build* build) {
                        return r;
        }
 
-       // Mark as initialized
-       build->init = 1;
+       // Mark as ready
+       build->state = PAKFIRE_BUILD_READY;
 
        return 0;
 }