{
struct case_data *cd;
- assert (c != NULL);
- assert (c->this == c);
- assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 1);
cd = c->case_data;
case_nullify (struct ccase *c)
{
c->case_data = NULL;
- c->this = c;
}
#endif /* DEBUGGING */
void
case_clone (struct ccase *clone, const struct ccase *orig)
{
- assert (orig != NULL);
- assert (orig->this == orig);
- assert (orig->case_data != NULL);
assert (orig->case_data->ref_cnt > 0);
- assert (clone != NULL);
if (clone != orig)
- {
- *clone = *orig;
- clone->this = clone;
- }
+ *clone = *orig;
orig->case_data->ref_cnt++;
}
#endif /* DEBUGGING */
void
case_move (struct ccase *dst, struct ccase *src)
{
- assert (src != NULL);
- assert (src->this == src);
- assert (src->case_data != NULL);
assert (src->case_data->ref_cnt > 0);
- assert (dst != NULL);
if (dst != src)
{
*dst = *src;
- dst->this = dst;
case_nullify (src);
}
}
struct case_data *cd;
assert (c != NULL);
- assert (c->this == c);
cd = c->case_data;
if (cd != NULL && --cd->ref_cnt == 0)
int
case_try_create (struct ccase *c, size_t value_cnt)
{
-#ifdef DEBUGGING
- c->this = c;
-#endif
c->case_data = malloc (case_size (value_cnt));
if (c->case_data != NULL)
{
const struct ccase *src, size_t src_idx,
size_t value_cnt)
{
- assert (dst != NULL);
- assert (dst->this == dst);
- assert (dst->case_data != NULL);
assert (dst->case_data->ref_cnt > 0);
assert (dst_idx + value_cnt <= dst->case_data->value_cnt);
- assert (src != NULL);
- assert (src->this == src);
- assert (src->case_data != NULL);
assert (src->case_data->ref_cnt > 0);
- assert (src_idx + value_cnt <= dst->case_data->value_cnt);
+ assert (src_idx + value_cnt <= src->case_data->value_cnt);
if (dst->case_data != src->case_data || dst_idx != src_idx)
{
case_to_values (const struct ccase *c, union value *output,
size_t output_size UNUSED)
{
- assert (c != NULL);
- assert (c->this == c);
- assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 0);
assert (output_size == c->case_data->value_cnt);
assert (output != NULL || output_size == 0);
size_t input_size UNUSED)
{
assert (c != NULL);
- assert (c->this == c);
assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 0);
assert (input_size == c->case_data->value_cnt);
case_data (const struct ccase *c, size_t idx)
{
assert (c != NULL);
- assert (c->this == c);
assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 0);
assert (idx < c->case_data->value_cnt);
case_num (const struct ccase *c, size_t idx)
{
assert (c != NULL);
- assert (c->this == c);
assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 0);
assert (idx < c->case_data->value_cnt);
case_str (const struct ccase *c, size_t idx)
{
assert (c != NULL);
- assert (c->this == c);
assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 0);
assert (idx < c->case_data->value_cnt);
case_data_rw (struct ccase *c, size_t idx)
{
assert (c != NULL);
- assert (c->this == c);
assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 0);
assert (idx < c->case_data->value_cnt);
case_data_all (const struct ccase *c)
{
assert (c != NULL);
- assert (c->this == c);
assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 0);
case_data_all_rw (struct ccase *c)
{
assert (c != NULL);
- assert (c->this == c);
assert (c->case_data != NULL);
assert (c->case_data->ref_cnt > 0);
if (width == 0)
{
- width = d->prop_em_width * 8;
-#if DEBUGGING
- printf ("warning: table column %d contains no data.\n", c);
-#endif
+ /* FIXME: This is an ugly kluge to compensate for the fact
+ that we don't let joined cells contribute to column
+ widths. */
+ width = d->prop_em_width * 8;
}
{
assert (t != NULL);
#if DEBUGGING
- if (row < -1 || row >= t->nr)
+ if (row < -1 || row > t->nr)
{
printf ("tab_offset(): row=%d in %d-row table\n", row, t->nr);
NOT_REACHED ();
}
- if (col < -1 || col >= t->nc)
+ if (col < -1 || col > t->nc)
{
printf ("tab_offset(): col=%d in %d-column table\n", col, t->nc);
NOT_REACHED ();