summaryrefslogtreecommitdiffstats
path: root/index.c
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2022-01-30 23:50:44 +0100
committerpgen <p.gen.progs@gmail.com>2022-01-30 23:50:44 +0100
commita67de73f4557335f783b238c1924e9d4deb36176 (patch)
tree7c07426ce62b01e28aac9642071c21307624eb5a /index.c
parent88a764f34890b4a462feb0f3983b4f260d317ea1 (diff)
Continue to add and fix comments
Diffstat (limited to 'index.c')
-rw-r--r--index.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/index.c b/index.c
index 26b12a8..a8b684f 100644
--- a/index.c
+++ b/index.c
@@ -290,11 +290,16 @@ insert_sorted_index(long ** array, long * size, long * nb, long value)
*array = xrealloc(*array, *size * sizeof(long));
}
+ /* Shift remaining array elements at position pos to position pos+1 */
+ /* (shift right one position). */
+ /* """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" */
if (*nb > pos)
memmove((*array) + pos + 1, (*array) + pos, sizeof(value) * (*nb - pos));
(*nb)++;
+ /* Set the value of the element at position pos in the passed array. */
+ /* """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" */
(*array)[pos] = value;
}