X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fcaseproto.c;h=4182004e4ac4a0f5ecd20653a8a7c8d6b10efb6d;hb=b525a9596e60d5ae4c6c464b4a426b77ade3dd72;hp=f990c127aa5e25cfeb3490035be5012bcee3a667;hpb=89c05dfe33f9542e60e66dd383f7a514849b5947;p=pspp diff --git a/src/data/caseproto.c b/src/data/caseproto.c index f990c127aa..4182004e4a 100644 --- a/src/data/caseproto.c +++ b/src/data/caseproto.c @@ -142,35 +142,35 @@ caseproto_insert_width (struct caseproto *proto, size_t before, int width) return proto; } -/* Returns a replacement for PROTO with CNT widths removed +/* Returns a replacement for PROTO with N widths removed starting at index IDX. */ struct caseproto * -caseproto_remove_widths (struct caseproto *proto, size_t idx, size_t cnt) +caseproto_remove_widths (struct caseproto *proto, size_t idx, size_t n) { - assert (caseproto_range_is_valid (proto, idx, cnt)); + assert (caseproto_range_is_valid (proto, idx, n)); proto = caseproto_unshare (proto); - proto->n_strings -= count_strings (proto, idx, cnt); + proto->n_strings -= count_strings (proto, idx, n); remove_range (proto->widths, proto->n_widths, sizeof *proto->widths, - idx, cnt); - proto->n_widths -= cnt; + idx, n); + proto->n_widths -= n; return proto; } -/* Returns a replacement for PROTO in which the CNT widths +/* Returns a replacement for PROTO in which the N widths starting at index OLD_WIDTH now start at index NEW_WIDTH, with other widths shifting out of the way to make room. */ struct caseproto * caseproto_move_widths (struct caseproto *proto, size_t old_start, size_t new_start, - size_t cnt) + size_t n) { - assert (caseproto_range_is_valid (proto, old_start, cnt)); - assert (caseproto_range_is_valid (proto, new_start, cnt)); + assert (caseproto_range_is_valid (proto, old_start, n)); + assert (caseproto_range_is_valid (proto, new_start, n)); proto = caseproto_unshare (proto); move_range (proto->widths, proto->n_widths, sizeof *proto->widths, - old_start, new_start, cnt); + old_start, new_start, n); return proto; }