projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f978897
)
Use macros from cast.h instead of literal casts
author
John Darrington
<john@darrington.wattle.id.au>
Sat, 2 Oct 2010 13:59:11 +0000
(15:59 +0200)
committer
John Darrington
<john@darrington.wattle.id.au>
Sat, 2 Oct 2010 13:59:11 +0000
(15:59 +0200)
src/data/case-tmpfile.c
patch
|
blob
|
history
src/data/case.h
patch
|
blob
|
history
src/data/dictionary.c
patch
|
blob
|
history
src/data/gnumeric-reader.c
patch
|
blob
|
history
src/output/odt.c
patch
|
blob
|
history
src/output/render.c
patch
|
blob
|
history
diff --git
a/src/data/case-tmpfile.c
b/src/data/case-tmpfile.c
index b2444b9bc5f411ac9d826b9f093972461652b40b..58e437ad1b45686000c0b320e028e0f0d8ad641a 100644
(file)
--- a/
src/data/case-tmpfile.c
+++ b/
src/data/case-tmpfile.c
@@
-52,7
+52,7
@@
width_to_n_bytes (int width)
static void *
value_to_data (const union value *value_, int width)
{
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;
assert (sizeof value->f == sizeof (double));
if (width == 0)
return &value->f;
diff --git
a/src/data/case.h
b/src/data/case.h
index 0bfc62cdce96054fe461043ac2cb44bf39436c03..d00c2ad37badd69cc80f9991d99a70bf8d88084c 100644
(file)
--- a/
src/data/case.h
+++ b/
src/data/case.h
@@
-135,7
+135,7
@@
case_unshare (struct ccase *c)
static inline struct ccase *
case_ref (const struct ccase *c_)
{
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;
}
c->ref_cnt++;
return c;
}
diff --git
a/src/data/dictionary.c
b/src/data/dictionary.c
index 9222f7ec0ba85ab94bdc88952029f8e59fc4b3d5..5f86bbf518fc84822343ab60f45e7483653977dd 100644
(file)
--- a/
src/data/dictionary.c
+++ b/
src/data/dictionary.c
@@
-330,7
+330,7
@@
void
dict_get_vars (const struct dictionary *d, const struct variable ***vars,
size_t *cnt, enum dict_class exclude)
{
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
}
/* Sets *VARS to an array of pointers to variables in D and *CNT
diff --git
a/src/data/gnumeric-reader.c
b/src/data/gnumeric-reader.c
index 1e18cc7bd5efdadb82bf0e067ef2663cea059123..26b90ee8916377d500512b1145422bff1fd9a1d1 100644
(file)
--- a/
src/data/gnumeric-reader.c
+++ b/
src/data/gnumeric-reader.c
@@
-181,9
+181,9
@@
struct gnumeric_reader
static void process_node (struct gnumeric_reader *r);
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_)
static void
gnm_file_casereader_destroy (struct casereader *reader UNUSED, void *r_)
@@
-328,7
+328,7
@@
convert_xml_string_to_value (struct ccase *c, const struct variable *var,
value_copy_str_rpad (v, var_get_width (var), xv, ' ');
else
{
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;
char *endptr;
errno = 0;
@@
-459,7
+459,7
@@
gnumeric_open_reader (struct gnumeric_read_info *gri, struct dictionary **dict)
if ( r->node_type == XML_READER_TYPE_TEXT )
{
xmlChar *value = xmlTextReaderValue (r->xtr);
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)
{
if ( r->row < r->start_row)
{
@@
-499,7
+499,7
@@
gnumeric_open_reader (struct gnumeric_read_info *gri, struct dictionary **dict)
/* Create the dictionary and populate it */
*dict = r->dict = dict_create ();
/* 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 )
{
for (i = 0 ; i < n_var_specs ; ++i )
{
diff --git
a/src/output/odt.c
b/src/output/odt.c
index 906323964cb85ca13eddec3d4b8078a194946b9a..721e7c87d9766dec20761e7100aba0ca6b24ea5b 100644
(file)
--- a/
src/output/odt.c
+++ b/
src/output/odt.c
@@
-49,7
+49,7
@@
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
-#define _xml(X) (
const xmlChar *)(X
)
+#define _xml(X) (
CHAR_CAST (const xmlChar *, X)
)
struct odt_driver
{
struct odt_driver
{
diff --git
a/src/output/render.c
b/src/output/render.c
index 8c02833ceef3b225669851ef67cc13221726612f..094e68799cf93b7e72be846075f8e04da80ec499 100644
(file)
--- a/
src/output/render.c
+++ b/
src/output/render.c
@@
-1212,7
+1212,7
@@
render_page_select (const struct render_page *page, enum table_axis axis,
if (z0 == page->h[a][0] && p0 == 0
&& z1 == page->n[a] - page->h[a][1] && p1 == 0)
{
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;
}
page_rw->ref_cnt++;
return page_rw;
}