]> granicus.if.org Git - shadow/commitdiff
Align coding style.
authorNicolas François <nicolas.francois@centraliens.net>
Tue, 13 Aug 2013 22:03:59 +0000 (00:03 +0200)
committerNicolas François <nicolas.francois@centraliens.net>
Tue, 13 Aug 2013 22:19:19 +0000 (00:19 +0200)
* lib/subordinateio.c: Avoid implicit conversion of pointers and
integers to booleans.
* lib/subordinateio.c: Added brackets.

ChangeLog
lib/subordinateio.c

index 0b87be1f7ba72cf8726fd37c09b00662a41e8e2e..73f74824da4e3f1fb420352a0588ad8cdf9dd973 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 
        * lib/subordinateio.c: Avoid dead branches.
        * lib/subordinateio.c: Add schematics with ranges to help reviews.
+       * lib/subordinateio.c: Avoid implicit conversion of pointers and
+       integers to booleans.
+       * lib/subordinateio.c: Added brackets.
 
 2013-08-13  Nicolas François  <nicolas.francois@centraliens.net>
 
index 7811eb8553434a54d4ccf5dd5ddfc93be0ffd27e..5a9f4743170810c6407e8808828c1850196cfce9 100644 (file)
@@ -279,35 +279,40 @@ static int add_range(struct commonio_db *db,
        return commonio_append(db, &range);
 }
 
-static int remove_range(struct commonio_db *db,
-       const char *owner, unsigned long start, unsigned long count)
+static int remove_range (struct commonio_db *db,
+                         const char *owner,
+                         unsigned long start, unsigned long count)
 {
        struct commonio_entry *ent;
        unsigned long end;
 
-       if (count == 0)
+       if (count == 0) {
                return 1;
+       }
 
        end = start + count - 1;
-       for (ent = db->head; ent; ent = ent->next) {
+       for (ent = db->head; NULL != ent; ent = ent->next) {
                struct subordinate_range *range = ent->eptr;
                unsigned long first;
                unsigned long last;
 
                /* Skip unparsed entries */
-               if (!range)
+               if (NULL == range) {
                        continue;
+               }
 
                first = range->start;
                last = first + range->count - 1;
 
                /* Skip entries with a different owner */
-               if (0 != strcmp(range->owner, owner))
+               if (0 != strcmp (range->owner, owner)) {
                        continue;
+               }
 
                /* Skip entries outside of the range to remove */
-               if ((end < first) || (start > last))
+               if ((end < first) || (start > last)) {
                        continue;
+               }
 
                if (start <= first) {
                        if (end >= last) {
@@ -345,7 +350,7 @@ static int remove_range(struct commonio_db *db,
                                tail.start = end + 1;
                                tail.count = (last - tail.start) + 1;
 
-                               if (commonio_append(db, &tail) == 0) {
+                               if (commonio_append (db, &tail) == 0) {
                                        return 0;
                                }