static void *
value_to_data (const union value *value_, int width)
{
- union value *value = (union value *) value_;
+ union value *value = CONST_CAST (union value *, value_);
assert (sizeof value->f == sizeof (double));
if (width == 0)
return &value->f;
static inline struct ccase *
case_ref (const struct ccase *c_)
{
- struct ccase *c = (struct ccase *) c_;
+ struct ccase *c = CONST_CAST (struct ccase *, c_);
c->ref_cnt++;
return c;
}
dict_get_vars (const struct dictionary *d, const struct variable ***vars,
size_t *cnt, enum dict_class exclude)
{
- dict_get_vars_mutable (d, (struct variable ***) vars, cnt, exclude);
+ dict_get_vars_mutable (d, CONST_CAST (struct variable ***, vars), cnt, exclude);
}
/* Sets *VARS to an array of pointers to variables in D and *CNT
static void process_node (struct gnumeric_reader *r);
-#define _xml(X) (const xmlChar *)(X)
+#define _xml(X) (CHAR_CAST (const xmlChar *, X))
-#define _xmlchar_to_int(X) atoi((const char *)X)
+#define _xmlchar_to_int(X) (atoi(CHAR_CAST (const char *, X)))
static void
gnm_file_casereader_destroy (struct casereader *reader UNUSED, void *r_)
value_copy_str_rpad (v, var_get_width (var), xv, ' ');
else
{
- const char *text = (const char *) xv;
+ const char *text = CHAR_CAST (const char *, xv);
char *endptr;
errno = 0;
if ( r->node_type == XML_READER_TYPE_TEXT )
{
xmlChar *value = xmlTextReaderValue (r->xtr);
- const char *text = (const char *) value;
+ const char *text = CHAR_CAST (const char *, value);
if ( r->row < r->start_row)
{
/* Create the dictionary and populate it */
*dict = r->dict = dict_create ();
- dict_set_encoding (r->dict, (const char *) xmlTextReaderConstEncoding (r->xtr));
+ dict_set_encoding (r->dict, CHAR_CAST (const char *, xmlTextReaderConstEncoding (r->xtr)));
for (i = 0 ; i < n_var_specs ; ++i )
{
if (z0 == page->h[a][0] && p0 == 0
&& z1 == page->n[a] - page->h[a][1] && p1 == 0)
{
- struct render_page *page_rw = (struct render_page *) page;
+ struct render_page *page_rw = CONST_CAST (struct render_page *, page);
page_rw->ref_cnt++;
return page_rw;
}