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:
0b0a278
)
Add CONST_CAST macro, for casting away "const" more safely.
author
Ben Pfaff
<blp@gnu.org>
Fri, 7 Aug 2009 04:45:38 +0000
(21:45 -0700)
committer
Ben Pfaff
<blp@gnu.org>
Sun, 9 Aug 2009 03:40:28 +0000
(20:40 -0700)
29 files changed:
src/data/caseproto.c
patch
|
blob
|
history
src/data/caseproto.h
patch
|
blob
|
history
src/data/casereader.c
patch
|
blob
|
history
src/data/casewindow.c
patch
|
blob
|
history
src/data/datasheet.c
patch
|
blob
|
history
src/data/dictionary.c
patch
|
blob
|
history
src/data/procedure.c
patch
|
blob
|
history
src/data/subcase.c
patch
|
blob
|
history
src/data/value-labels.c
patch
|
blob
|
history
src/data/variable.c
patch
|
blob
|
history
src/language/lexer/variable-parser.c
patch
|
blob
|
history
src/language/xforms/count.c
patch
|
blob
|
history
src/libpspp/abt.c
patch
|
blob
|
history
src/libpspp/bt.c
patch
|
blob
|
history
src/libpspp/cast.h
patch
|
blob
|
history
src/libpspp/hash.h
patch
|
blob
|
history
src/libpspp/ll.c
patch
|
blob
|
history
src/libpspp/ll.h
patch
|
blob
|
history
src/libpspp/llx.c
patch
|
blob
|
history
src/libpspp/range-set.c
patch
|
blob
|
history
src/libpspp/range-set.h
patch
|
blob
|
history
src/libpspp/sparse-array.c
patch
|
blob
|
history
src/libpspp/str.c
patch
|
blob
|
history
src/libpspp/taint.c
patch
|
blob
|
history
src/libpspp/tmpfile.c
patch
|
blob
|
history
src/libpspp/tower.c
patch
|
blob
|
history
src/math/percentiles.c
patch
|
blob
|
history
src/output/chart.c
patch
|
blob
|
history
tests/libpspp/range-set-test.c
patch
|
blob
|
history
diff --git
a/src/data/caseproto.c
b/src/data/caseproto.c
index 1a40213a537d295f78241a0c35a0594ba3a6262a..9837013acb8bee86cb6d30bf0876a706a05dbc71 100644
(file)
--- a/
src/data/caseproto.c
+++ b/
src/data/caseproto.c
@@
-320,7
+320,7
@@
caseproto_free__ (struct caseproto *proto)
void
caseproto_refresh_long_string_cache__ (const struct caseproto *proto_)
{
void
caseproto_refresh_long_string_cache__ (const struct caseproto *proto_)
{
- struct caseproto *proto =
(struct caseproto *) proto_
;
+ struct caseproto *proto =
CONST_CAST (struct caseproto *, proto_)
;
size_t n, i;
assert (proto->long_strings == NULL);
size_t n, i;
assert (proto->long_strings == NULL);
diff --git
a/src/data/caseproto.h
b/src/data/caseproto.h
index b85a9f32d9260f02d6339b8f0852caca8518722f..b0f45c418c47aae8017b0469a5307cff6b9cd7f6 100644
(file)
--- a/
src/data/caseproto.h
+++ b/
src/data/caseproto.h
@@
-22,6
+22,7
@@
#include <stddef.h>
#include <stdlib.h>
#include <data/value.h>
#include <stddef.h>
#include <stdlib.h>
#include <data/value.h>
+#include <libpspp/cast.h>
#include <libpspp/compiler.h>
/* Case prototype.
#include <libpspp/compiler.h>
/* Case prototype.
@@
-144,7
+145,7
@@
void caseproto_free__ (struct caseproto *);
static inline struct caseproto *
caseproto_ref (const struct caseproto *proto_)
{
static inline struct caseproto *
caseproto_ref (const struct caseproto *proto_)
{
- struct caseproto *proto =
(struct caseproto *) proto_
;
+ struct caseproto *proto =
CONST_CAST (struct caseproto *, proto_)
;
proto->ref_cnt++;
return proto;
}
proto->ref_cnt++;
return proto;
}
diff --git
a/src/data/casereader.c
b/src/data/casereader.c
index a1550ac57560e5fb623d12ede14b7e1a65ca661b..5ae5a0a8ea4431019660c60e1d56d9d68ed8c3fa 100644
(file)
--- a/
src/data/casereader.c
+++ b/
src/data/casereader.c
@@
-108,7
+108,7
@@
casereader_destroy (struct casereader *reader)
struct casereader *
casereader_clone (const struct casereader *reader_)
{
struct casereader *
casereader_clone (const struct casereader *reader_)
{
- struct casereader *reader =
(struct casereader *) reader_
;
+ struct casereader *reader =
CONST_CAST (struct casereader *, reader_)
;
struct casereader *clone;
if ( reader == NULL )
return NULL;
struct casereader *clone;
if ( reader == NULL )
return NULL;
diff --git
a/src/data/casewindow.c
b/src/data/casewindow.c
index 9b04b9413c61bbace1e5b189d68e65eebe152482..936b6aa940051be14a422fde8a8773f22388eeb7 100644
(file)
--- a/
src/data/casewindow.c
+++ b/
src/data/casewindow.c
@@
-168,7
+168,7
@@
casewindow_pop_tail (struct casewindow *cw, casenumber case_cnt)
struct ccase *
casewindow_get_case (const struct casewindow *cw_, casenumber case_idx)
{
struct ccase *
casewindow_get_case (const struct casewindow *cw_, casenumber case_idx)
{
- struct casewindow *cw =
(struct casewindow *) cw_
;
+ struct casewindow *cw =
CONST_CAST (struct casewindow *, cw_)
;
assert (case_idx >= 0 && case_idx < casewindow_get_case_cnt (cw));
if (casewindow_error (cw))
assert (case_idx >= 0 && case_idx < casewindow_get_case_cnt (cw));
if (casewindow_error (cw))
diff --git
a/src/data/datasheet.c
b/src/data/datasheet.c
index fa24d8ce77014e980cb79e4700ffc63832c5d061..4abc526f0cb2a720cb8e3023eb7d732effdb5da4 100644
(file)
--- a/
src/data/datasheet.c
+++ b/
src/data/datasheet.c
@@
-275,7
+275,7
@@
datasheet_destroy (struct datasheet *ds)
const struct caseproto *
datasheet_get_proto (const struct datasheet *ds_)
{
const struct caseproto *
datasheet_get_proto (const struct datasheet *ds_)
{
- struct datasheet *ds =
(struct datasheet *) ds_
;
+ struct datasheet *ds =
CONST_CAST (struct datasheet *, ds_)
;
if (ds->proto == NULL)
{
size_t i;
if (ds->proto == NULL)
{
size_t i;
@@
-548,7
+548,7
@@
datasheet_get_row (const struct datasheet *ds, casenumber row)
{
size_t n_columns = datasheet_get_n_columns (ds);
struct ccase *c = case_create (datasheet_get_proto (ds));
{
size_t n_columns = datasheet_get_n_columns (ds);
struct ccase *c = case_create (datasheet_get_proto (ds));
- if (rw_case (
(struct datasheet *) ds
, OP_READ,
+ if (rw_case (
CONST_CAST (struct datasheet *, ds)
, OP_READ,
row, 0, n_columns, case_data_all_rw (c)))
return c;
else
row, 0, n_columns, case_data_all_rw (c)))
return c;
else
@@
-582,7
+582,8
@@
datasheet_get_value (const struct datasheet *ds, casenumber row,
size_t column, union value *value)
{
assert (row >= 0);
size_t column, union value *value)
{
assert (row >= 0);
- return rw_case ((struct datasheet *) ds, OP_READ, row, column, 1, value);
+ return rw_case (CONST_CAST (struct datasheet *, ds), OP_READ,
+ row, column, 1, value);
}
/* Stores VALUE into DS in the given ROW and COLUMN. VALUE must
}
/* Stores VALUE into DS in the given ROW and COLUMN. VALUE must
diff --git
a/src/data/dictionary.c
b/src/data/dictionary.c
index 67af049b24fee7a72e3dd6b6561a6784f87a70b7..7379d1940ad9b511bcffa03faf301aa0f7727238 100644
(file)
--- a/
src/data/dictionary.c
+++ b/
src/data/dictionary.c
@@
-1016,7
+1016,7
@@
dict_set_case_limit (struct dictionary *d, casenumber case_limit)
const struct caseproto *
dict_get_proto (const struct dictionary *d_)
{
const struct caseproto *
dict_get_proto (const struct dictionary *d_)
{
- struct dictionary *d =
(struct dictionary *) d_
;
+ struct dictionary *d =
CONST_CAST (struct dictionary *, d_)
;
if (d->proto == NULL)
{
size_t i;
if (d->proto == NULL)
{
size_t i;
@@
-1375,7
+1375,7
@@
dict_clear_vectors (struct dictionary *d)
struct attrset *
dict_get_attributes (const struct dictionary *d)
{
struct attrset *
dict_get_attributes (const struct dictionary *d)
{
- return
(struct attrset *) &d->attributes
;
+ return
CONST_CAST (struct attrset *, &d->attributes)
;
}
/* Replaces D's attributes set by a copy of ATTRS. */
}
/* Replaces D's attributes set by a copy of ATTRS. */
diff --git
a/src/data/procedure.c
b/src/data/procedure.c
index b762214d10e20a33d6bbdf89ac52253a67589453..5e013a14af767d80a097a4c46f577ed77c4c3210 100644
(file)
--- a/
src/data/procedure.c
+++ b/
src/data/procedure.c
@@
-682,7
+682,7
@@
dataset_end_of_command (struct dataset *ds)
else
{
const struct taint *taint = casereader_get_taint (ds->source);
else
{
const struct taint *taint = casereader_get_taint (ds->source);
- taint_reset_successor_taint (
(struct taint *) taint
);
+ taint_reset_successor_taint (
CONST_CAST (struct taint *, taint)
);
assert (!taint_has_tainted_successor (taint));
}
}
assert (!taint_has_tainted_successor (taint));
}
}
diff --git
a/src/data/subcase.c
b/src/data/subcase.c
index be58609693900cc5d02fff87a5d225f8a4002688..948319468c3c1d7a1c43d36663c10a49c6d168f7 100644
(file)
--- a/
src/data/subcase.c
+++ b/
src/data/subcase.c
@@
-118,7
+118,7
@@
subcase_add_var (struct subcase *sc, const struct variable *var,
const struct caseproto *
subcase_get_proto (const struct subcase *sc_)
{
const struct caseproto *
subcase_get_proto (const struct subcase *sc_)
{
- struct subcase *sc =
(struct subcase *) sc_
;
+ struct subcase *sc =
CONST_CAST (struct subcase *, sc_)
;
if (sc->proto == NULL)
{
if (sc->proto == NULL)
{
diff --git
a/src/data/value-labels.c
b/src/data/value-labels.c
index c8061f7bd5d7fee54c47f5e65aa739b442f10dce..34223955cafa81aecd4fda8e86102f0f74d7120f 100644
(file)
--- a/
src/data/value-labels.c
+++ b/
src/data/value-labels.c
@@
-24,6
+24,7
@@
#include <data/value.h>
#include <data/variable.h>
#include <libpspp/array.h>
#include <data/value.h>
#include <data/variable.h>
#include <libpspp/array.h>
+#include <libpspp/cast.h>
#include <libpspp/compiler.h>
#include <libpspp/hash-functions.h>
#include <libpspp/hmap.h>
#include <libpspp/compiler.h>
#include <libpspp/hash-functions.h>
#include <libpspp/hmap.h>
@@
-169,7
+170,8
@@
void
val_labs_replace (struct val_labs *vls, const union value *value,
const char *label)
{
val_labs_replace (struct val_labs *vls, const union value *value,
const char *label)
{
- struct val_lab *vl = (struct val_lab *) val_labs_lookup (vls, value);
+ struct val_lab *vl = CONST_CAST (struct val_lab *,
+ val_labs_lookup (vls, value));
if (vl != NULL)
{
atom_destroy (vl->label);
if (vl != NULL)
{
atom_destroy (vl->label);
@@
-183,7
+185,7
@@
val_labs_replace (struct val_labs *vls, const union value *value,
void
val_labs_remove (struct val_labs *vls, const struct val_lab *label_)
{
void
val_labs_remove (struct val_labs *vls, const struct val_lab *label_)
{
- struct val_lab *label =
(struct val_lab *) label_
;
+ struct val_lab *label =
CONST_CAST (struct val_lab *, label_)
;
hmap_delete (&vls->labels, &label->node);
value_destroy (&label->value, vls->width);
atom_destroy (label->label);
hmap_delete (&vls->labels, &label->node);
value_destroy (&label->value, vls->width);
atom_destroy (label->label);
diff --git
a/src/data/variable.c
b/src/data/variable.c
index c0767d7ce245bcfdbcec0b25080228d7c9a38dbc..bd0e8bf5691782a22ecdd376537fda692b98b95a 100644
(file)
--- a/
src/data/variable.c
+++ b/
src/data/variable.c
@@
-955,7
+955,7
@@
void *
var_attach_aux (const struct variable *v_,
void *aux, void (*aux_dtor) (struct variable *))
{
var_attach_aux (const struct variable *v_,
void *aux, void (*aux_dtor) (struct variable *))
{
- struct variable *v =
(struct variable *) v_ ; /* cast away const */
+ struct variable *v =
CONST_CAST (struct variable *, v_);
assert (v->aux == NULL);
assert (aux != NULL);
v->aux = aux;
assert (v->aux == NULL);
assert (aux != NULL);
v->aux = aux;
@@
-1013,7
+1013,7
@@
var_get_obs_vals (const struct variable *v)
void
var_set_obs_vals (const struct variable *v_, struct cat_vals *cat_vals)
{
void
var_set_obs_vals (const struct variable *v_, struct cat_vals *cat_vals)
{
- struct variable *v =
(struct variable *) v_ ; /* cast away const */
+ struct variable *v =
CONST_CAST (struct variable *, v_ );
cat_stored_values_destroy (v->obs_vals);
v->obs_vals = cat_vals;
}
cat_stored_values_destroy (v->obs_vals);
v->obs_vals = cat_vals;
}
@@
-1033,7
+1033,7
@@
var_has_obs_vals (const struct variable *v)
struct attrset *
var_get_attributes (const struct variable *v)
{
struct attrset *
var_get_attributes (const struct variable *v)
{
- return
(struct attrset *) &v->attributes
;
+ return
CONST_CAST (struct attrset *, &v->attributes)
;
}
/* Replaces variable V's attributes set by a copy of ATTRS. */
}
/* Replaces variable V's attributes set by a copy of ATTRS. */
diff --git
a/src/language/lexer/variable-parser.c
b/src/language/lexer/variable-parser.c
index 1194110efa3ac850ed1584451e2782ec12870b83..8a39dbf0b2d2d6b6684766d8352d4cbf02cfdd59 100644
(file)
--- a/
src/language/lexer/variable-parser.c
+++ b/
src/language/lexer/variable-parser.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-757,7
+757,7
@@
array_var_set_get_var (const struct var_set *vs, size_t idx)
{
struct array_var_set *avs = vs->aux;
{
struct array_var_set *avs = vs->aux;
- return
(struct variable *) avs->var[idx]
;
+ return
CONST_CAST (struct variable *, avs->var[idx])
;
}
/* If VS contains a variable named NAME, sets *IDX to its index
}
/* If VS contains a variable named NAME, sets *IDX to its index
diff --git
a/src/language/xforms/count.c
b/src/language/xforms/count.c
index 8ce2d12576697beb5562fc65fc4a03522ce2a9a0..4fb889b17717ae3a0dec8bc98ee5a81ea6e219b9 100644
(file)
--- a/
src/language/xforms/count.c
+++ b/
src/language/xforms/count.c
@@
-352,7
+352,7
@@
count_trns_proc (void *trns_, struct ccase **c,
static bool
count_trns_free (void *trns_)
{
static bool
count_trns_free (void *trns_)
{
- struct count_trns *trns =
(struct count_trns *)
trns_;
+ struct count_trns *trns = trns_;
pool_destroy (trns->pool);
return true;
}
pool_destroy (trns->pool);
return true;
}
diff --git
a/src/libpspp/abt.c
b/src/libpspp/abt.c
index 74b2ceb387f54d04e669cfbadb7eb4e7589c89a3..b776612922f2579b290f3a3657f12adb8efee0fe 100644
(file)
--- a/
src/libpspp/abt.c
+++ b/
src/libpspp/abt.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-29,6
+29,7
@@
#endif
#include <libpspp/abt.h>
#endif
#include <libpspp/abt.h>
+#include <libpspp/cast.h>
#include <stdbool.h>
#include <stdbool.h>
@@
-145,8
+146,8
@@
insert_relative (struct abt *abt, const struct abt_node *p, bool after,
p = p->down[dir];
dir = !after;
}
p = p->down[dir];
dir = !after;
}
-
((struct abt_node *)
p)->down[dir] = node;
- node->up =
(struct abt_node *) p
;
+
CONST_CAST (struct abt_node *,
p)->down[dir] = node;
+ node->up =
CONST_CAST (struct abt_node *, p)
;
abt_reaugmented (abt, node);
}
abt_reaugmented (abt, node);
}
@@
-280,7
+281,7
@@
abt_find (const struct abt *abt, const struct abt_node *target)
{
cmp = abt->compare (target, p, abt->aux);
if (cmp == 0)
{
cmp = abt->compare (target, p, abt->aux);
if (cmp == 0)
- return
(struct abt_node *) p
;
+ return
CONST_CAST (struct abt_node *, p)
;
}
return NULL;
}
return NULL;
@@
-307,7
+308,7
@@
abt_next (const struct abt *abt, const struct abt_node *p)
p = p->down[1];
while (p->down[0] != NULL)
p = p->down[0];
p = p->down[1];
while (p->down[0] != NULL)
p = p->down[0];
- return
(struct abt_node *) p
;
+ return
CONST_CAST (struct abt_node *, p)
;
}
}
}
}
@@
-332,7
+333,7
@@
abt_prev (const struct abt *abt, const struct abt_node *p)
p = p->down[0];
while (p->down[1] != NULL)
p = p->down[1];
p = p->down[0];
while (p->down[1] != NULL)
p = p->down[1];
- return
(struct abt_node *) p
;
+ return
CONST_CAST (struct abt_node *, p)
;
}
}
}
}
diff --git
a/src/libpspp/bt.c
b/src/libpspp/bt.c
index 26eb982b25d47c26c9699c24018a0910cb2dbcd5..751c8fe764cd6f71aeec94be3550855f8dd3ce6e 100644
(file)
--- a/
src/libpspp/bt.c
+++ b/
src/libpspp/bt.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-67,6
+67,8
@@
#include <stdbool.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdint.h>
+#include <libpspp/cast.h>
+
static void rebalance_subtree (struct bt *, struct bt_node *, size_t);
static struct bt_node **down_link (struct bt *, struct bt_node *);
static void rebalance_subtree (struct bt *, struct bt_node *, size_t);
static struct bt_node **down_link (struct bt *, struct bt_node *);
@@
-250,7
+252,7
@@
bt_find (const struct bt *bt, const struct bt_node *target)
{
cmp = bt->compare (target, p, bt->aux);
if (cmp == 0)
{
cmp = bt->compare (target, p, bt->aux);
if (cmp == 0)
- return
(struct bt_node *) p
;
+ return
CONST_CAST (struct bt_node *, p)
;
}
return NULL;
}
return NULL;
@@
-283,7
+285,7
@@
bt_find_ge (const struct bt *bt, const struct bt_node *target)
break;
}
}
break;
}
}
- return
(struct bt_node *) q
;
+ return
CONST_CAST (struct bt_node *, q)
;
}
/* Searches BT for, and returns, the last node in in-order whose
}
/* Searches BT for, and returns, the last node in in-order whose
@@
-314,7
+316,7
@@
bt_find_le (const struct bt *bt, const struct bt_node *target)
break;
}
}
break;
}
}
- return
(struct bt_node *) q
;
+ return
CONST_CAST (struct bt_node *, q)
;
}
/* Returns the node in BT following P in in-order.
}
/* Returns the node in BT following P in in-order.
@@
-338,7
+340,7
@@
bt_next (const struct bt *bt, const struct bt_node *p)
p = p->down[1];
while (p->down[0] != NULL)
p = p->down[0];
p = p->down[1];
while (p->down[0] != NULL)
p = p->down[0];
- return
(struct bt_node *) p
;
+ return
CONST_CAST (struct bt_node *, p)
;
}
}
}
}
@@
-363,7
+365,7
@@
bt_prev (const struct bt *bt, const struct bt_node *p)
p = p->down[0];
while (p->down[1] != NULL)
p = p->down[1];
p = p->down[0];
while (p->down[1] != NULL)
p = p->down[1];
- return
(struct bt_node *) p
;
+ return
CONST_CAST (struct bt_node *, p)
;
}
}
}
}
diff --git
a/src/libpspp/cast.h
b/src/libpspp/cast.h
index 30927899c8bfb81dee56d509d16d7a5a3a72f52e..1e33857c1e3afa0a879512378df55694ca3900bc 100644
(file)
--- a/
src/libpspp/cast.h
+++ b/
src/libpspp/cast.h
@@
-76,6
+76,13
@@
above, can easily be devised. */
#define CHECK_POINTER_COMPATIBILITY(A, B) ((void) sizeof ((A) == (B)))
above, can easily be devised. */
#define CHECK_POINTER_COMPATIBILITY(A, B) ((void) sizeof ((A) == (B)))
+/* Equivalent to casting POINTER to TYPE, but also issues a
+ warning if the cast changes anything other than an outermost
+ "const" or "volatile" qualifier. */
+#define CONST_CAST(TYPE, POINTER) \
+ (CHECK_POINTER_HAS_TYPE (POINTER, TYPE), \
+ (TYPE) (POINTER))
+
/* Given POINTER, a pointer to the given MEMBER within structure
STRUCT, returns the address of the STRUCT. */
#define UP_CAST(POINTER, STRUCT, MEMBER) \
/* Given POINTER, a pointer to the given MEMBER within structure
STRUCT, returns the address of the STRUCT. */
#define UP_CAST(POINTER, STRUCT, MEMBER) \
diff --git
a/src/libpspp/hash.h
b/src/libpspp/hash.h
index 57fc2678d09548ad50922b9130298afb6cf80cac..e586bcc0c18d1ae79242dc5a6ba42068db5b1f63 100644
(file)
--- a/
src/libpspp/hash.h
+++ b/
src/libpspp/hash.h
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git
a/src/libpspp/ll.c
b/src/libpspp/ll.c
index b9d595bc97a00212e9ebc1c156a1a01f75ed1556..e6533f2cd25fccf5beb2cbf9a4da31c279022027 100644
(file)
--- a/
src/libpspp/ll.c
+++ b/
src/libpspp/ll.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-169,7
+169,7
@@
ll_find_equal (const struct ll *r0, const struct ll *r1,
for (x = r0; x != r1; x = ll_next (x))
if (compare (x, target, aux) == 0)
break;
for (x = r0; x != r1; x = ll_next (x))
if (compare (x, target, aux) == 0)
break;
- return
(struct ll *) x
;
+ return
CONST_CAST (struct ll *, x)
;
}
/* Returns the first node in R0...R1 for which PREDICATE returns
}
/* Returns the first node in R0...R1 for which PREDICATE returns
@@
-185,7
+185,7
@@
ll_find_if (const struct ll *r0, const struct ll *r1,
for (x = r0; x != r1; x = ll_next (x))
if (predicate (x, aux))
break;
for (x = r0; x != r1; x = ll_next (x))
if (predicate (x, aux))
break;
- return
(struct ll *) x
;
+ return
CONST_CAST (struct ll *, x)
;
}
/* Compares each pair of adjacent nodes in R0...R1
}
/* Compares each pair of adjacent nodes in R0...R1
@@
-203,10
+203,10
@@
ll_find_adjacent_equal (const struct ll *r0, const struct ll *r1,
for (x = r0, y = ll_next (x); y != r1; x = y, y = ll_next (y))
if (compare (x, y, aux) == 0)
for (x = r0, y = ll_next (x); y != r1; x = y, y = ll_next (y))
if (compare (x, y, aux) == 0)
- return
(struct ll *) x
;
+ return
CONST_CAST (struct ll *, x)
;
}
}
- return
(struct ll *) r1
;
+ return
CONST_CAST (struct ll *, r1)
;
}
/* Returns the number of nodes in R0...R1.
}
/* Returns the number of nodes in R0...R1.
@@
-272,7
+272,7
@@
ll_max (const struct ll *r0, const struct ll *r1,
if (compare (x, max, aux) > 0)
max = x;
}
if (compare (x, max, aux) > 0)
max = x;
}
- return
(struct ll *) max
;
+ return
CONST_CAST (struct ll *, max)
;
}
/* Returns the least node in R0...R1 according to COMPARE given
}
/* Returns the least node in R0...R1 according to COMPARE given
@@
-291,7
+291,7
@@
ll_min (const struct ll *r0, const struct ll *r1,
if (compare (x, min, aux) < 0)
min = x;
}
if (compare (x, min, aux) < 0)
min = x;
}
- return
(struct ll *) min
;
+ return
CONST_CAST (struct ll *, min)
;
}
/* Lexicographically compares A0...A1 to B0...B1.
}
/* Lexicographically compares A0...A1 to B0...B1.
@@
-474,7
+474,7
@@
ll_find_run (const struct ll *r0, const struct ll *r1,
while (r0 != r1 && compare (ll_prev (r0), r0, aux) <= 0);
}
while (r0 != r1 && compare (ll_prev (r0), r0, aux) <= 0);
}
- return
(struct ll *) r0
;
+ return
CONST_CAST (struct ll *, r0)
;
}
/* Merges B0...B1 into A0...A1 according to COMPARE given
}
/* Merges B0...B1 into A0...A1 according to COMPARE given
@@
-681,6
+681,6
@@
ll_find_partition (const struct ll *r0, const struct ll *r1,
if (predicate (x, aux))
return NULL;
if (predicate (x, aux))
return NULL;
- return
(struct ll *) partition
;
+ return
CONST_CAST (struct ll *, partition)
;
}
\f
}
\f
diff --git
a/src/libpspp/ll.h
b/src/libpspp/ll.h
index 4d0d2eb84a6ba26dd8dfd64735b9113e08a30df0..bf871f6b0f842a0a42726de48364aad08ea4d3ea 100644
(file)
--- a/
src/libpspp/ll.h
+++ b/
src/libpspp/ll.h
@@
-52,6
+52,8
@@
#include <stddef.h>
#include <libpspp/cast.h>
#include <stddef.h>
#include <libpspp/cast.h>
+#include <libpspp/cast.h>
+
/* Embedded, circular doubly linked list.
Each list contains a single "null" element that separates the
/* Embedded, circular doubly linked list.
Each list contains a single "null" element that separates the
@@
-380,7
+382,7
@@
ll_tail (const struct ll_list *list)
static inline struct ll *
ll_null (const struct ll_list *list)
{
static inline struct ll *
ll_null (const struct ll_list *list)
{
- return
(struct ll *) &list->null
;
+ return
CONST_CAST (struct ll *, &list->null)
;
}
/* Returns the node following LL in its list,
}
/* Returns the node following LL in its list,
diff --git
a/src/libpspp/llx.c
b/src/libpspp/llx.c
index 4dc82bffeb66219bf37d12f7cff7131a0c73cccc..c58f840c40a6db106d250e0cb6b5a9dec39efa5f 100644
(file)
--- a/
src/libpspp/llx.c
+++ b/
src/libpspp/llx.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-232,7
+232,7
@@
llx_find_equal (const struct llx *r0, const struct llx *r1,
for (x = r0; x != r1; x = llx_next (x))
if (compare (llx_data (x), target, aux) == 0)
break;
for (x = r0; x != r1; x = llx_next (x))
if (compare (llx_data (x), target, aux) == 0)
break;
- return
(struct llx *) x
;
+ return
CONST_CAST (struct llx *, x)
;
}
/* Returns the first node in R0...R1 for which PREDICATE returns
}
/* Returns the first node in R0...R1 for which PREDICATE returns
@@
-248,7
+248,7
@@
llx_find_if (const struct llx *r0, const struct llx *r1,
for (x = r0; x != r1; x = llx_next (x))
if (predicate (llx_data (x), aux))
break;
for (x = r0; x != r1; x = llx_next (x))
if (predicate (llx_data (x), aux))
break;
- return
(struct llx *) x
;
+ return
CONST_CAST (struct llx *, x)
;
}
/* Compares each pair of adjacent nodes in R0...R1
}
/* Compares each pair of adjacent nodes in R0...R1
@@
-266,10
+266,10
@@
llx_find_adjacent_equal (const struct llx *r0, const struct llx *r1,
for (x = r0, y = llx_next (x); y != r1; x = y, y = llx_next (y))
if (compare (llx_data (x), llx_data (y), aux) == 0)
for (x = r0, y = llx_next (x); y != r1; x = y, y = llx_next (y))
if (compare (llx_data (x), llx_data (y), aux) == 0)
- return
(struct llx *) x
;
+ return
CONST_CAST (struct llx *, x)
;
}
}
- return
(struct llx *) r1
;
+ return
CONST_CAST (struct llx *, r1)
;
}
/* Returns the number of nodes in R0...R1.
}
/* Returns the number of nodes in R0...R1.
@@
-329,7
+329,7
@@
llx_max (const struct llx *r0, const struct llx *r1,
if (compare (llx_data (x), llx_data (max), aux) > 0)
max = x;
}
if (compare (llx_data (x), llx_data (max), aux) > 0)
max = x;
}
- return
(struct llx *) max
;
+ return
CONST_CAST (struct llx *, max)
;
}
/* Returns the least node in R0...R1 according to COMPARE given
}
/* Returns the least node in R0...R1 according to COMPARE given
@@
-348,7
+348,7
@@
llx_min (const struct llx *r0, const struct llx *r1,
if (compare (llx_data (x), llx_data (min), aux) < 0)
min = x;
}
if (compare (llx_data (x), llx_data (min), aux) < 0)
min = x;
}
- return
(struct llx *) min
;
+ return
CONST_CAST (struct llx *, min)
;
}
/* Lexicographically compares A0...A1 to B0...B1.
}
/* Lexicographically compares A0...A1 to B0...B1.
@@
-521,7
+521,7
@@
llx_find_run (const struct llx *r0, const struct llx *r1,
llx_data (r0), aux) <= 0);
}
llx_data (r0), aux) <= 0);
}
- return
(struct llx *) r0
;
+ return
CONST_CAST (struct llx *, r0)
;
}
/* Merges B0...B1 into A0...A1 according to COMPARE given
}
/* Merges B0...B1 into A0...A1 according to COMPARE given
@@
-734,7
+734,7
@@
llx_find_partition (const struct llx *r0, const struct llx *r1,
if (predicate (llx_data (x), aux))
return NULL;
if (predicate (llx_data (x), aux))
return NULL;
- return
(struct llx *) partition
;
+ return
CONST_CAST (struct llx *, partition)
;
}
\f
/* Allocates and returns a node using malloc. */
}
\f
/* Allocates and returns a node using malloc. */
diff --git
a/src/libpspp/range-set.c
b/src/libpspp/range-set.c
index efa3b4d670e7e06c3c560ebc64ade1bf4d45ae21..cd17fe02a4e2130544d5d37687cf46210ff2de39 100644
(file)
--- a/
src/libpspp/range-set.c
+++ b/
src/libpspp/range-set.c
@@
-287,7
+287,7
@@
range_set_allocate_fully (struct range_set *rs, unsigned long int request,
bool
range_set_contains (const struct range_set *rs_, unsigned long int position)
{
bool
range_set_contains (const struct range_set *rs_, unsigned long int position)
{
- struct range_set *rs =
(struct range_set *) rs_
;
+ struct range_set *rs =
CONST_CAST (struct range_set *, rs_)
;
if (position < rs->cache_end && position >= rs->cache_start)
return rs->cache_value;
else
if (position < rs->cache_end && position >= rs->cache_start)
return rs->cache_value;
else
@@
-328,7
+328,7
@@
range_set_contains (const struct range_set *rs_, unsigned long int position)
unsigned long int
range_set_scan (const struct range_set *rs_, unsigned long int start)
{
unsigned long int
range_set_scan (const struct range_set *rs_, unsigned long int start)
{
- struct range_set *rs =
(struct range_set *) rs_
;
+ struct range_set *rs =
CONST_CAST (struct range_set *, rs_)
;
unsigned long int retval = ULONG_MAX;
struct bt_node *bt_node;
unsigned long int retval = ULONG_MAX;
struct bt_node *bt_node;
diff --git
a/src/libpspp/range-set.h
b/src/libpspp/range-set.h
index 941692b40029098ea8224ea4d0a4f0e1b9026385..ee7dac23137d3c39b392b13cb11c7d560c71fc79 100644
(file)
--- a/
src/libpspp/range-set.h
+++ b/
src/libpspp/range-set.h
@@
-26,6
+26,7
@@
#include <stdbool.h>
#include <libpspp/bt.h>
#include <stdbool.h>
#include <libpspp/bt.h>
+#include <libpspp/cast.h>
/* A set of ranges. */
struct range_set
/* A set of ranges. */
struct range_set
@@
-122,7
+123,7
@@
static inline const struct range_set_node *
range_set_next (const struct range_set *rs, const struct range_set_node *node)
{
return (node != NULL
range_set_next (const struct range_set *rs, const struct range_set_node *node)
{
return (node != NULL
- ? range_set_next__ (rs,
(struct range_set_node *) node
)
+ ? range_set_next__ (rs,
CONST_CAST (struct range_set_node *, node)
)
: range_set_first__ (rs));
}
: range_set_first__ (rs));
}
@@
-147,7
+148,7
@@
static inline const struct range_set_node *
range_set_prev (const struct range_set *rs, const struct range_set_node *node)
{
return (node != NULL
range_set_prev (const struct range_set *rs, const struct range_set_node *node)
{
return (node != NULL
- ? range_set_prev__ (rs,
(struct range_set_node *) node
)
+ ? range_set_prev__ (rs,
CONST_CAST (struct range_set_node *, node)
)
: range_set_last__ (rs));
}
: range_set_last__ (rs));
}
diff --git
a/src/libpspp/sparse-array.c
b/src/libpspp/sparse-array.c
index 28398d5cc86321e9e648a9c0ac30c052c1d26641..298f2caf9eb9ae09108aa247fc6db7b000183de1 100644
(file)
--- a/
src/libpspp/sparse-array.c
+++ b/
src/libpspp/sparse-array.c
@@
-22,6
+22,7
@@
#include <string.h>
#include <libpspp/assertion.h>
#include <string.h>
#include <libpspp/assertion.h>
+#include <libpspp/cast.h>
#include <libpspp/misc.h>
#include <libpspp/pool.h>
#include <libpspp/misc.h>
#include <libpspp/pool.h>
@@
-577,7
+578,7
@@
leaf_size (const struct sparse_array *spar)
static struct leaf_node *
find_leaf_node (const struct sparse_array *spar_, unsigned long int key)
{
static struct leaf_node *
find_leaf_node (const struct sparse_array *spar_, unsigned long int key)
{
- struct sparse_array *spar =
(struct sparse_array *) spar_
;
+ struct sparse_array *spar =
CONST_CAST (struct sparse_array *, spar_)
;
const union pointer *p;
int level;
const union pointer *p;
int level;
@@
-679,7
+680,7
@@
static void *
scan_forward (const struct sparse_array *spar_, unsigned long int start,
unsigned long int *found)
{
scan_forward (const struct sparse_array *spar_, unsigned long int start,
unsigned long int *found)
{
- struct sparse_array *spar =
(struct sparse_array *) spar_
;
+ struct sparse_array *spar =
CONST_CAST (struct sparse_array *, spar_)
;
/* Check the cache. */
if (start >> BITS_PER_LEVEL == spar->cache_ofs)
/* Check the cache. */
if (start >> BITS_PER_LEVEL == spar->cache_ofs)
@@
-761,7
+762,7
@@
static void *
scan_reverse (const struct sparse_array *spar_, unsigned long int start,
unsigned long int *found)
{
scan_reverse (const struct sparse_array *spar_, unsigned long int start,
unsigned long int *found)
{
- struct sparse_array *spar =
(struct sparse_array *) spar_
;
+ struct sparse_array *spar =
CONST_CAST (struct sparse_array *, spar_)
;
/* Check the cache. */
if (start >> BITS_PER_LEVEL == spar->cache_ofs)
/* Check the cache. */
if (start >> BITS_PER_LEVEL == spar->cache_ofs)
diff --git
a/src/libpspp/str.c
b/src/libpspp/str.c
index ccd7739c647b87d989b9cbc867810d915839770c..c954a722c89987d371eee5084a9b52c452af0ee8 100644
(file)
--- a/
src/libpspp/str.c
+++ b/
src/libpspp/str.c
@@
-23,6
+23,7
@@
#include <stdint.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdlib.h>
+#include <libpspp/cast.h>
#include <libpspp/message.h>
#include <libpspp/pool.h>
#include <libpspp/message.h>
#include <libpspp/pool.h>
@@
-1214,7
+1215,7
@@
ds_capacity (const struct string *st)
char *
ds_cstr (const struct string *st_)
{
char *
ds_cstr (const struct string *st_)
{
- struct string *st =
(struct string *) st_
;
+ struct string *st =
CONST_CAST (struct string *, st_)
;
if (st->ss.string == NULL)
ds_extend (st, 1);
st->ss.string[st->ss.length] = '\0';
if (st->ss.string == NULL)
ds_extend (st, 1);
st->ss.string[st->ss.length] = '\0';
diff --git
a/src/libpspp/taint.c
b/src/libpspp/taint.c
index 3a74587bb5918ae8cee61766619187b5ca758532..4c1cecb97cdbbdbcdd2302e91f2741e7a68a8bc2 100644
(file)
--- a/
src/libpspp/taint.c
+++ b/
src/libpspp/taint.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-22,6
+22,7
@@
#include <libpspp/array.h>
#include <libpspp/assertion.h>
#include <libpspp/array.h>
#include <libpspp/assertion.h>
+#include <libpspp/cast.h>
#include "xalloc.h"
#include "xalloc.h"
@@
-79,7
+80,7
@@
taint_create (void)
struct taint *
taint_clone (const struct taint *taint_)
{
struct taint *
taint_clone (const struct taint *taint_)
{
- struct taint *taint =
(struct taint *) taint_
;
+ struct taint *taint =
CONST_CAST (struct taint *, taint_)
;
assert (taint->ref_cnt > 0);
taint->ref_cnt++;
assert (taint->ref_cnt > 0);
taint->ref_cnt++;
@@
-139,8
+140,8
@@
taint_destroy (struct taint *taint)
void
taint_propagate (const struct taint *from_, const struct taint *to_)
{
void
taint_propagate (const struct taint *from_, const struct taint *to_)
{
- struct taint *from =
(struct taint *) from_
;
- struct taint *to =
(struct taint *) to_
;
+ struct taint *from =
CONST_CAST (struct taint *, from_)
;
+ struct taint *to =
CONST_CAST (struct taint *, to_)
;
if (from != to)
{
if (from != to)
{
@@
-165,7
+166,7
@@
taint_is_tainted (const struct taint *taint)
void
taint_set_taint (const struct taint *taint_)
{
void
taint_set_taint (const struct taint *taint_)
{
- struct taint *taint =
(struct taint *) taint_
;
+ struct taint *taint =
CONST_CAST (struct taint *, taint_)
;
if (!taint->tainted)
recursively_set_taint (taint);
}
if (!taint->tainted)
recursively_set_taint (taint);
}
@@
-186,7
+187,7
@@
taint_has_tainted_successor (const struct taint *taint)
void
taint_reset_successor_taint (const struct taint *taint_)
{
void
taint_reset_successor_taint (const struct taint *taint_)
{
- struct taint *taint =
(struct taint *) taint_
;
+ struct taint *taint =
CONST_CAST (struct taint *, taint_)
;
if (taint->tainted_successor)
{
if (taint->tainted_successor)
{
diff --git
a/src/libpspp/tmpfile.c
b/src/libpspp/tmpfile.c
index 0d3093646faa6a9d20a941048760f0d0d11d8be6..aff135d0cc0a1c27b0ea9af1d58dec6beb08d19a 100644
(file)
--- a/
src/libpspp/tmpfile.c
+++ b/
src/libpspp/tmpfile.c
@@
-26,6
+26,7
@@
#include <stdlib.h>
#include <libpspp/assertion.h>
#include <stdlib.h>
#include <libpspp/assertion.h>
+#include <libpspp/cast.h>
#include "error.h"
#include "xalloc.h"
#include "error.h"
#include "xalloc.h"
@@
-81,7
+82,7
@@
tmpfile_destroy (struct tmpfile *tf)
static bool
do_seek (const struct tmpfile *tf_, off_t offset)
{
static bool
do_seek (const struct tmpfile *tf_, off_t offset)
{
- struct tmpfile *tf =
(struct tmpfile *) tf_
;
+ struct tmpfile *tf =
CONST_CAST (struct tmpfile *, tf_)
;
if (!tmpfile_error (tf))
{
if (!tmpfile_error (tf))
{
@@
-106,7
+107,7
@@
do_seek (const struct tmpfile *tf_, off_t offset)
static bool
do_read (const struct tmpfile *tf_, void *buffer, size_t bytes)
{
static bool
do_read (const struct tmpfile *tf_, void *buffer, size_t bytes)
{
- struct tmpfile *tf =
(struct tmpfile *) tf_
;
+ struct tmpfile *tf =
CONST_CAST (struct tmpfile *, tf_)
;
assert (!tmpfile_error (tf));
if (bytes > 0 && fread (buffer, bytes, 1, tf->file) != 1)
assert (!tmpfile_error (tf));
if (bytes > 0 && fread (buffer, bytes, 1, tf->file) != 1)
diff --git
a/src/libpspp/tower.c
b/src/libpspp/tower.c
index e8d253d086731c61dd539962cbc79f9c2b3b0750..9157987774e555c625d63af41a9343dc4447c574 100644
(file)
--- a/
src/libpspp/tower.c
+++ b/
src/libpspp/tower.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-21,6
+21,7
@@
#include <limits.h>
#include <libpspp/assertion.h>
#include <limits.h>
#include <libpspp/assertion.h>
+#include <libpspp/cast.h>
#include <libpspp/compiler.h>
static struct tower_node *abt_to_tower_node (const struct abt_node *);
#include <libpspp/compiler.h>
static struct tower_node *abt_to_tower_node (const struct abt_node *);
@@
-184,7
+185,7
@@
tower_lookup (const struct tower *t_,
unsigned long height,
unsigned long *node_start)
{
unsigned long height,
unsigned long *node_start)
{
- struct tower *t =
(struct tower *) t_
;
+ struct tower *t =
CONST_CAST (struct tower *, t_)
;
struct abt_node *p;
assert (height < tower_height (t));
struct abt_node *p;
assert (height < tower_height (t));
@@
-237,7
+238,7
@@
tower_lookup (const struct tower *t_,
struct tower_node *
tower_get (const struct tower *t_, unsigned long int index)
{
struct tower_node *
tower_get (const struct tower *t_, unsigned long int index)
{
- struct tower *t =
(struct tower *) t_
;
+ struct tower *t =
CONST_CAST (struct tower *, t_)
;
struct abt_node *p;
assert (index < tower_count (t));
struct abt_node *p;
assert (index < tower_count (t));
diff --git
a/src/math/percentiles.c
b/src/math/percentiles.c
index 2bde9d6f979bb5c410557bf904e06c2522702317..c76bb492ba767a90ffa2c03c8d35bf8a7d532ab6 100644
(file)
--- a/
src/math/percentiles.c
+++ b/
src/math/percentiles.c
@@
-45,7
+45,7
@@
const char *const ptile_alg_desc[] = {
double
percentile_calculate (const struct percentile *ptl, enum pc_alg alg)
{
double
percentile_calculate (const struct percentile *ptl, enum pc_alg alg)
{
- struct percentile *mutable =
(struct percentile *) ptl
;
+ struct percentile *mutable =
CONST_CAST (struct percentile *, ptl)
;
const struct order_stats *os = &ptl->parent;
assert (os->cc == ptl->w);
const struct order_stats *os = &ptl->parent;
assert (os->cc == ptl->w);
diff --git
a/src/output/chart.c
b/src/output/chart.c
index e1832e20bb39154ea36ecd702a7bc5cc68253a80..1f85d8e485d2303f1cbce08523247d854583a1e9 100644
(file)
--- a/
src/output/chart.c
+++ b/
src/output/chart.c
@@
-142,7
+142,7
@@
chart_draw_png (const struct chart *chart, const char *file_name_template,
struct chart *
chart_ref (const struct chart *chart_)
{
struct chart *
chart_ref (const struct chart *chart_)
{
- struct chart *chart =
(struct chart *) chart_
;
+ struct chart *chart =
CONST_CAST (struct chart *, chart_)
;
chart->ref_cnt++;
return chart;
}
chart->ref_cnt++;
return chart;
}
diff --git
a/tests/libpspp/range-set-test.c
b/tests/libpspp/range-set-test.c
index e8cbffa5e6334408bbd69dc4c7c2a7e9dbb72829..8d6e68316834d707254b5888f92d1b41b1064bb6 100644
(file)
--- a/
tests/libpspp/range-set-test.c
+++ b/
tests/libpspp/range-set-test.c
@@
-212,7
+212,7
@@
check_pattern (const struct range_set *rs, unsigned int pattern)
caching. */
for (start = 0; start <= 32; start++)
{
caching. */
for (start = 0; start <= 32; start++)
{
- struct range_set *nonconst_rs =
(struct range_set *) rs
;
+ struct range_set *nonconst_rs =
CONST_CAST (struct range_set *, rs)
;
nonconst_rs->cache_end = 0;
s1 = range_set_scan (rs, start);
s2 = next_1bit (pattern, start);
nonconst_rs->cache_end = 0;
s1 = range_set_scan (rs, start);
s2 = next_1bit (pattern, start);