]> granicus.if.org Git - shadow/commitdiff
Add schematics with ranges to help reviews.
authorNicolas François <nicolas.francois@centraliens.net>
Tue, 13 Aug 2013 21:57:14 +0000 (23:57 +0200)
committerNicolas François <nicolas.francois@centraliens.net>
Tue, 13 Aug 2013 22:19:19 +0000 (00:19 +0200)
* lib/subordinateio.c: Add schematics with ranges to help reviews.

ChangeLog
lib/subordinateio.c

index ed54e1217b02c0f271fd56aafe9c48ceb917e657..0b87be1f7ba72cf8726fd37c09b00662a41e8e2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2013-08-13  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/subordinateio.c: Avoid dead branches.
+       * lib/subordinateio.c: Add schematics with ranges to help reviews.
 
 2013-08-13  Nicolas François  <nicolas.francois@centraliens.net>
 
index 25a2d3044480a4401acdad2867266e7ea3987e1c..7811eb8553434a54d4ccf5dd5ddfc93be0ffd27e 100644 (file)
@@ -311,10 +311,14 @@ static int remove_range(struct commonio_db *db,
 
                if (start <= first) {
                        if (end >= last) {
+                               /* to be removed: [start,      end]
+                                * range:           [first, last] */
                                /* entry completely contained in the
                                 * range to remove */
                                commonio_del_entry (db, ent);
                        } else {
+                               /* to be removed: [start,  end]
+                                * range:           [first, last] */
                                /* Remove only the start of the entry */
                                range->start = end + 1;
                                range->count = (last - range->start) + 1;
@@ -324,12 +328,16 @@ static int remove_range(struct commonio_db *db,
                        }
                } else {
                        if (end >= last) {
+                               /* to be removed:   [start,  end]
+                                * range:         [first, last] */
                                /* Remove only the end of the entry */
                                range->count = start - range->start;
 
                                ent->changed = true;
                                db->changed = true;
                        } else {
+                               /* to be removed:   [start, end]
+                                * range:         [first,    last] */
                                /* Remove the middle of the range
                                 * This requires to create a new range */
                                struct subordinate_range tail;