Checker, which is pretty obsolete now.
23 files changed:
+Fri Dec 12 13:31:58 2003 Ben Pfaff <blp@gnu.org>
+
+ * All source files: Get rid of nasty special cases for Checker,
+ which is pretty obsolete now.
Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
static void
out_of_memory (void)
{
static void
out_of_memory (void)
{
-#if __CHECKER__
- fprintf (stderr, "Out of memory: inducing segfault\n");
- *((int *) 0) = 0;
-#else
fprintf (stderr, "virtual memory exhausted\n");
exit (EXIT_FAILURE);
fprintf (stderr, "virtual memory exhausted\n");
exit (EXIT_FAILURE);
if (NULL == *vpp)
{
vp = pool_alloc (hash_pool, sizeof (union value));
if (NULL == *vpp)
{
vp = pool_alloc (hash_pool, sizeof (union value));
-#if __CHECKER__
- memset (vp, 0, sizeof (union value));
-#endif
vp->c = pool_strdup (hash_pool, v.c);
*vpp = vp;
}
vp->c = pool_strdup (hash_pool, v.c);
*vpp = vp;
}
memset (i->v->s + len, ' ', i->format.w - len);
}
memset (i->v->s + len, ' ', i->format.w - len);
}
-#if __CHECKER__
- memset (i->v->s + i->format.w, '%',
- REM_RND_UP (i->format.w, MAX_SHORT_STRING));
-#endif
-
memset (i->v->s + (i->e - i->s) / 2, ' ', (i->format.w - (i->e - i->s)) / 2);
}
memset (i->v->s + (i->e - i->s) / 2, ' ', (i->format.w - (i->e - i->s)) / 2);
}
-#if __CHECKER__
- memset (i->v->s + i->format.w / 2, '%',
- REM_RND_UP (i->format.w / 2, MAX_SHORT_STRING));
-#endif
-
/* Default to SYSMIS or blanks. */
if (fmt->cat & FCAT_STRING)
/* Default to SYSMIS or blanks. */
if (fmt->cat & FCAT_STRING)
- {
-#if __CHECKER__
- memset (i->v->s, ' ', ROUND_UP (i->format.w, MAX_SHORT_STRING));
-#else
- memset (i->v->s, ' ', i->format.w);
-#endif
- }
+ memset (i->v->s, ' ', i->format.w);
else
i->v->f = set_blanks;
}
else
i->v->f = set_blanks;
}
else
next = next->next = xmalloc (sizeof *spec);
else
next = next->next = xmalloc (sizeof *spec);
-#if __CHECKER__
- spec->type = ROUND_UP (spec->type, 8);
-#endif
-
memcpy (next, spec, sizeof *spec);
next->next = NULL;
}
memcpy (next, spec, sizeof *spec);
next->next = NULL;
}
-#if __CHECKER__
- memset (&spec, 0, sizeof spec);
-#endif
lex_get ();
while (token != '.')
{
lex_get ();
while (token != '.')
{
break;
}
fh_close_handle (dlsp->handle);
break;
}
fh_close_handle (dlsp->handle);
-#if __CHECKER__
- code = 0; /* prevent error at `return code;' */
-#endif
}
dfm_pop (dlsp->handle);
}
dfm_pop (dlsp->handle);
-#if __CHECKER__
- case 42000:
- assert (0);
-#endif
{
/* We want to indicate that the file is open, that we are not at
eof, and that another line needs to be read in. */
{
/* We want to indicate that the file is open, that we are not at
eof, and that another line needs to be read in. */
-#if __CHECKER__
- memset (&ext->file, 0, sizeof ext->file);
-#endif
ext->file.file = NULL;
ext->line = xmalloc (128);
#if !PRODUCTION
ext->file.file = NULL;
ext->line = xmalloc (128);
#if !PRODUCTION
-#if __CHECKER__
-static void induce_segfault (void);
-#endif
-
/* Some machines are broken. Compensate. */
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
/* Some machines are broken. Compensate. */
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
-#if __CHECKER__
- if (!success)
- induce_segfault ();
-#endif
-
exit (success ? EXIT_SUCCESS : EXIT_FAILURE);
}
exit (success ? EXIT_SUCCESS : EXIT_FAILURE);
}
-
-#if __CHECKER__
-/* Causes a segfault in order to force Checker to print a stack
- backtrace. */
-static void
-induce_segfault (void)
-{
- fputs (_("\n"
- "\t*********************\n"
- "\t* INDUCING SEGFAULT *\n"
- "\t*********************\n"), stdout);
- fflush (stdout);
- fflush (stderr);
- abort ();
-}
-#endif
case OP_SENTINEL:
goto finished;
case OP_SENTINEL:
goto finished;
-#if __CHECKER__
- /* This case prevents Checker from choking. */
- case 42000:
- assert (0);
-#endif
-
default:
#if GLOBAL_DEBUGGING
printf (_("evaluate_expression(): not implemented: %s\n"),
default:
#if GLOBAL_DEBUGGING
printf (_("evaluate_expression(): not implemented: %s\n"),
-
-#if __CHECKER__
- /* This case prevents Checker from choking. */
- case 42000:
- assert (0);
-#endif
-#if __GNUC__ || __BORLANDC__
- return 0;
-#endif
return _("string");
default:
assert (0);
return _("string");
default:
assert (0);
-#if __GNUC__ || __BORLANDC__
- return 0;
-#endif
rct.ft = n_trns;
if (fty.case_sbc.name[0])
rct.case_sbc = fty.case_sbc;
rct.ft = n_trns;
if (fty.case_sbc.name[0])
rct.case_sbc = fty.case_sbc;
-#if __CHECKER__
- else
- memset (&rct.case_sbc, 0, sizeof rct.case_sbc);
- rct.lt = -1;
-#endif
/* Make sure we're inside a FILE TYPE structure. */
if (pgm_state != STATE_INPUT || vfm_source != &file_type_source)
/* Make sure we're inside a FILE TYPE structure. */
if (pgm_state != STATE_INPUT || vfm_source != &file_type_source)
-#if __CHECKER__
- memset (dest, 0, maxlen);
-#endif
while (getcwd (dest, maxlen - (dest - fn2)) == NULL && errno == ERANGE)
{
maxlen *= 2;
dest = fn2 = xrealloc (fn2, maxlen + 1);
while (getcwd (dest, maxlen - (dest - fn2)) == NULL && errno == ERANGE)
{
maxlen *= 2;
dest = fn2 = xrealloc (fn2, maxlen + 1);
-#if __CHECKER__
- memset (dest, 0, maxlen);
-#endif
assert (v->type == ALPHA);
memcpy (compaction_case->data[v->p.mtf.master->fv].s,
iter->input[v->fv].s, v->width);
assert (v->type == ALPHA);
memcpy (compaction_case->data[v->p.mtf.master->fv].s,
iter->input[v->fv].s, v->width);
-#if __CHECKER__
- memset (&compaction_case
- ->data[v->p.mtf.master->fv].s[v->width],
- 0, REM_RND_UP (v->width, MAX_SHORT_STRING));
-#endif
if (v->type == NUMERIC)
compaction_case->data[v->p.mtf.master->fv].f = SYSMIS;
else
if (v->type == NUMERIC)
compaction_case->data[v->p.mtf.master->fv].f = SYSMIS;
else
- {
- memset (compaction_case->data[v->p.mtf.master->fv].s, ' ',
- v->width);
-#if __CHECKER__
- memset (&compaction_case
- ->data[v->p.mtf.master->fv].s[v->width],
- 0, REM_RND_UP (v->width, MAX_SHORT_STRING));
-#endif
- }
+ memset (compaction_case->data[v->p.mtf.master->fv].s, ' ',
+ v->width);
}
if (iter->handle == NULL)
}
if (iter->handle == NULL)
static void get_date (void);
static void get_date (void);
-#if HAVE_LIBTERMCAP && !__CHECKER__
static char *term_buffer;
#endif
static char *term_buffer;
#endif
int success;
/* This code stolen from termcap.info, though modified. */
int success;
/* This code stolen from termcap.info, though modified. */
-#if !__CHECKER__
- term_buffer = xmalloc (2048);
-#endif
-
termtype = getenv ("TERM");
if (!termtype)
msg (FE, _("Specify a terminal type with `setenv TERM <yourtype>'."));
termtype = getenv ("TERM");
if (!termtype)
msg (FE, _("Specify a terminal type with `setenv TERM <yourtype>'."));
-#if __CHECKER__
- success = tgetent (NULL, termtype);
-#else
success = tgetent (term_buffer, termtype);
success = tgetent (term_buffer, termtype);
if (success <= 0)
{
if (success < 0)
if (success <= 0)
{
if (success < 0)
*dest = xstrdup (ds_value (val));
}
break;
*dest = xstrdup (ds_value (val));
}
break;
-#if __CHECKER__
- case 42000:
- assert (0);
-#endif
lex_match_id ("VALUES");
while (token != '.')
{
lex_match_id ("VALUES");
while (token != '.')
{
-#if __CHECKER__
- memset (missing, 0, sizeof missing);
-#endif
-
if (!parse_varnames ())
goto fail;
if (!parse_varnames ())
goto fail;
#define ALIGN_SIZE sizeof (union align)
#endif
#define ALIGN_SIZE sizeof (union align)
#endif
-/* DISCRETE_BLOCKS may be declared as nonzero to prevent suballocation
- of blocks. This is useful under memory debuggers like Checker
- because it allows the source location of bugs to be more accurately
- pinpointed.
+/* DISCRETE_BLOCKS may be declared as nonzero to prevent
+ suballocation of blocks. This is useful under memory
+ debuggers like Checker or valgrind because it allows the
+ source location of bugs to be more accurately pinpointed.
On the other hand, if we're testing the library, then we want to
test the library's real functionality, not its crippled, slow,
simplified functionality. */
On the other hand, if we're testing the library, then we want to
test the library's real functionality, not its crippled, slow,
simplified functionality. */
-#if __CHECKER__ && !SELF_TEST
-#define DISCRETE_BLOCKS 1
-#endif
+/*#define DISCRETE_BLOCKS 1*/
/* Enable debug code if appropriate. */
#undef DEBUGGING
/* Enable debug code if appropriate. */
#undef DEBUGGING
-#if __CHECKER__
- case 42000:
- assert (0);
-#endif
-#if __CHECKER__
- memset (buf_loc, 0, sizeof *buf_loc);
-#endif
buf_loc->font = ext->current;
buf_loc->size = ext->size;
buf_loc->x = x;
buf_loc->font = ext->current;
buf_loc->size = ext->size;
buf_loc->x = x;
vp = malloc (size);
if (!vp)
vp = malloc (size);
if (!vp)
- {
-#if DEBUGGING && __CHECKER__
- error ("xmalloc(%lu): Inducing segfault.", (unsigned long) size);
- *((int *) 0) = 0;
-#endif
- fail ("xmalloc(%lu): %s", (unsigned long) size, VME);
- }
+ fail ("xmalloc(%lu): %s", (unsigned long) size, VME);
free (default_dict.documents);
/* 2. Copy dictionary D into the active file dictionary. */
free (default_dict.documents);
/* 2. Copy dictionary D into the active file dictionary. */
-#if __CHECKER__
- {
- size_t offset;
-
- offset = offsetof (struct dictionary, filter_var) + sizeof d->filter_var;
- strncpy (d->weight_var, d->weight_var, 9);
- strncpy (d->filter_var, d->filter_var, 9);
- memset (&((char *) d)[offset], '*', sizeof *d - offset);
- }
-#endif
default_dict = *d;
if (!default_dict.var_by_name)
{
default_dict = *d;
if (!default_dict.var_by_name)
{
/* Allocate label. */
label = xmalloc (sizeof *label);
/* Allocate label. */
label = xmalloc (sizeof *label);
-#if __CHECKER__
- memset (&label->v, 0, sizeof label->v);
-#endif
label->ref_count = nv;
/* Set label->v. */
label->ref_count = nv;
/* Set label->v. */
if (compaction_necessary)
compaction_case = xmalloc (sizeof (struct ccase)
+ sizeof (union value) * (compaction_nval - 1));
if (compaction_necessary)
compaction_case = xmalloc (sizeof (struct ccase)
+ sizeof (union value) * (compaction_nval - 1));
-
-#if __CHECKER__
- /* Initialize the unused trailing parts of string variables to avoid
- spurious warnings from Checker. */
- {
- int i;
-
- for (i = 0; i < default_dict.nvar; i++)
- {
- struct variable *v = default_dict.var[i];
-
- if (v->type == ALPHA && v->width % 8 != 0)
- memcpy (&temp_case->data[v->fv + v->nv - 1]
- .s[v->width % 8], _("!ERROR!"), 8 - v->width % 8);
- }
- }
-#endif