diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-01-08 22:37:23 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-01-08 22:37:23 +0000 |
commit | c0bfd8814f6cd8e45a230deca0f28954ed38480e (patch) | |
tree | 3fe2e7692806402346cae9509b22d790e5a6b39d /src/libs6rc/s6rc_db_check_revdeps.c | |
parent | da010cd4a3a4da1b03940b76b138e75cc36106cf (diff) | |
download | s6-rc-c0bfd8814f6cd8e45a230deca0f28954ed38480e.tar.xz |
Types fix: first pass
Diffstat (limited to 'src/libs6rc/s6rc_db_check_revdeps.c')
-rw-r--r-- | src/libs6rc/s6rc_db_check_revdeps.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libs6rc/s6rc_db_check_revdeps.c b/src/libs6rc/s6rc_db_check_revdeps.c index a4342b1..3b64c36 100644 --- a/src/libs6rc/s6rc_db_check_revdeps.c +++ b/src/libs6rc/s6rc_db_check_revdeps.c @@ -1,13 +1,14 @@ /* ISC license. */ +#include <sys/types.h> #include <skalibs/bytestr.h> #include <skalibs/bitarray.h> #include <s6-rc/s6rc-db.h> int s6rc_db_check_revdeps (s6rc_db_t const *db) { - unsigned int n = db->nshort + db->nlong ; - unsigned int m = bitarray_div8(n) ; + size_t n = db->nshort + db->nlong ; + size_t m = bitarray_div8(n) ; unsigned char matrix[n * m] ; register unsigned int i = n ; register unsigned char const *p = matrix ; @@ -23,7 +24,7 @@ int s6rc_db_check_revdeps (s6rc_db_t const *db) register unsigned int j = db->services[i].ndeps[0] ; while (j--) bitarray_not(matrix + m * db->deps[db->services[i].deps[0] + j], i, 1) ; } - i = n * m ; - while (i--) if (*p++) return 1 ; + n *= m ; + while (n--) if (*p++) return 1 ; return 0 ; } |