Removed some unnecessary casts. Changed some others to use the
macros from src/libpspp/cast.h instead of literal casts.
case VARCHAROID:
case BPCHAROID:
case BYTEAOID:
case VARCHAROID:
case BPCHAROID:
case BYTEAOID:
- memcpy (value_str_rw (val, var_width), (char *) vptr,
+ memcpy (value_str_rw (val, var_width), vptr,
MIN (length, var_width));
break;
MIN (length, var_width));
break;
/* Returns the address of the first non-whitespace character in S, or
the address of the null terminator if none. */
static char *
/* Returns the address of the first non-whitespace character in S, or
the address of the null terminator if none. */
static char *
{
while (isspace ((unsigned char) *s))
s++;
{
while (isspace ((unsigned char) *s))
s++;
}
/* Read one line from the input file into buf. Lines having special
}
/* Read one line from the input file into buf. Lines having special
the source value from whence the new value comes. */
if (src_width > 0)
{
the source value from whence the new value comes. */
if (src_width > 0)
{
- const char *str = (const char *) value_str (from, src_width);
+ const char *str = CHAR_CAST_BUG (const char*, value_str (from, src_width));
recoded_value = recode_string (UTF8, dict_get_encoding (dict), str, src_width);
}
recoded_value = recode_string (UTF8, dict_get_encoding (dict), str, src_width);
}
if ( width_b == 0 && width_a != 0)
return +1;
if ( width_b == 0 && width_a != 0)
return +1;
- return buf_compare_rpad ((const char *) value_str (&(*a)->from, width_a), width_a,
- (const char *) value_str (&(*b)->from, width_b), width_b);
+ return buf_compare_rpad (CHAR_CAST_BUG (const char *, value_str (&(*a)->from, width_a)), width_a,
+ CHAR_CAST_BUG (const char *, value_str (&(*b)->from, width_b)), width_b);
msg (SE, _("Hexadecimal floating constant too long."));
return false;
}
msg (SE, _("Hexadecimal floating constant too long."));
return false;
}
- strncpy ((char *) fp->data, ds_cstr (lex_tokstr (lexer)), sizeof fp->data);
+ strncpy (CHAR_CAST_BUG (char *,fp->data), ds_cstr (lex_tokstr (lexer)), sizeof fp->data);
{
ds_clear (st);
ds_put_cstr (st, rel);
{
ds_clear (st);
ds_put_cstr (st, rel);
+ /* The documentation for relocate says that casting away const
+ and then freeing is appropriate ... */
+ free (CONST_CAST (char *, rel));
"bold", EMPH_BOLD,
"underline", EMPH_UNDERLINE,
"none", EMPH_NONE,
"bold", EMPH_BOLD,
"underline", EMPH_UNDERLINE,
"none", EMPH_NONE,
a->chart_file_name = parse_chart_file_name (opt (d, o, "charts", file_name));
a->chart_file_name = parse_chart_file_name (opt (d, o, "charts", file_name));
O has no user-specified value, then O's default value is treated the same
way. If the default value still does not match, parse_enum() returns 0.
O has no user-specified value, then O's default value is treated the same
way. If the default value still does not match, parse_enum() returns 0.
- Example: parse_enum (o, "a", 1, "b", 2, (char *) NULL) returns 1 if O's
+ Example: parse_enum (o, "a", 1, "b", 2, NULL) returns 1 if O's
value if "a", 2 if O's value is "b".
Destroys O. */
value if "a", 2 if O's value is "b".
Destroys O. */
case OPT_VERSION:
version_etc (stdout, "psppire", PACKAGE_NAME, PACKAGE_VERSION,
"Ben Pfaff", "John Darrington", "Jason Stover",
case OPT_VERSION:
version_etc (stdout, "psppire", PACKAGE_NAME, PACKAGE_VERSION,
"Ben Pfaff", "John Darrington", "Jason Stover",
exit (EXIT_SUCCESS);
case OPT_NO_SPLASH:
exit (EXIT_SUCCESS);
case OPT_NO_SPLASH:
case OPT_VERSION:
version_etc (stdout, "pspp", PACKAGE_NAME, PACKAGE_VERSION,
"Ben Pfaff", "John Darrington", "Jason Stover",
case OPT_VERSION:
version_etc (stdout, "pspp", PACKAGE_NAME, PACKAGE_VERSION,
"Ben Pfaff", "John Darrington", "Jason Stover",
exit (EXIT_SUCCESS);
default:
exit (EXIT_SUCCESS);
default: