projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed some compiler warnings, which arose from recent commits.
[pspp]
/
src
/
math
/
categoricals.c
diff --git
a/src/math/categoricals.c
b/src/math/categoricals.c
index 2a0d4f85ba9e000fb1e4ac36e5d37684f4d2a389..239a3a833c6dbb61dd235b7fdaf37a340c78a057 100644
(file)
--- a/
src/math/categoricals.c
+++ b/
src/math/categoricals.c
@@
-358,7
+358,12
@@
categoricals_update (struct categoricals *cat, const struct ccase *c)
{
int i;
struct variable_node *vn = NULL;
{
int i;
struct variable_node *vn = NULL;
- const double weight = cat->wv ? case_data (c, cat->wv)->f : 1.0;
+ double weight;
+
+ if (NULL == cat)
+ return;
+
+ weight = cat->wv ? case_data (c, cat->wv)->f : 1.0;
assert (NULL == cat->reverse_variable_map_short);
assert (NULL == cat->reverse_variable_map_long);
assert (NULL == cat->reverse_variable_map_short);
assert (NULL == cat->reverse_variable_map_long);
@@
-453,6
+458,9
@@
categoricals_n_total (const struct categoricals *cat)
size_t
categoricals_df_total (const struct categoricals *cat)
{
size_t
categoricals_df_total (const struct categoricals *cat)
{
+ if (NULL == cat)
+ return 0;
+
return cat->df_sum;
}
return cat->df_sum;
}
@@
-479,6
+487,10
@@
categoricals_done (const struct categoricals *cat_)
int i;
int idx_short = 0;
int idx_long = 0;
int i;
int idx_short = 0;
int idx_long = 0;
+
+ if (NULL == cat)
+ return;
+
cat->df_sum = 0;
cat->n_cats_total = 0;
cat->df_sum = 0;
cat->n_cats_total = 0;