152 |
} |
} |
153 |
#endif /* GLOBAL_DEBUGGING */ |
#endif /* GLOBAL_DEBUGGING */ |
154 |
|
|
155 |
|
/* Resizes case C from OLD_CNT to NEW_CNT values. */ |
156 |
|
void |
157 |
|
case_resize (struct ccase *c, size_t old_cnt, size_t new_cnt) |
158 |
|
{ |
159 |
|
struct ccase new; |
160 |
|
|
161 |
|
case_create (&new, new_cnt); |
162 |
|
case_copy (&new, 0, c, 0, old_cnt < new_cnt ? old_cnt : new_cnt); |
163 |
|
case_swap (&new, c); |
164 |
|
case_destroy (&new); |
165 |
|
} |
166 |
|
|
167 |
|
/* Swaps cases A and B. */ |
168 |
|
void |
169 |
|
case_swap (struct ccase *a, struct ccase *b) |
170 |
|
{ |
171 |
|
struct case_data *t = a->case_data; |
172 |
|
a->case_data = b->case_data; |
173 |
|
b->case_data = t; |
174 |
|
} |
175 |
|
|
176 |
/* Attempts to create C as a new case that holds VALUE_CNT |
/* Attempts to create C as a new case that holds VALUE_CNT |
177 |
values. Returns nonzero if successful, zero if memory |
values. Returns nonzero if successful, zero if memory |
178 |
allocation failed. */ |
allocation failed. */ |