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>
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;
}
} 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;