projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix description of "count" in Auxiliary Variable Parameter Record.
[pspp]
/
src
/
subclist.c
diff --git
a/src/subclist.c
b/src/subclist.c
index d2add44c178952781e384986af54e36198f7e7fa..95ea455d6164b09856c299ff54ae29dbcdcb3ea6 100644
(file)
--- a/
src/subclist.c
+++ b/
src/subclist.c
@@
-17,12
+17,13
@@
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
-0211
1-1307
, USA. */
+Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+0211
0-1301
, USA. */
#include "subclist.h"
#include <stdlib.h>
#include "subclist.h"
#include <stdlib.h>
+#include "xalloc.h"
/* I call these objects `lists' but they are in fact simple dynamic arrays */
/* I call these objects `lists' but they are in fact simple dynamic arrays */
@@
-32,7
+33,7
@@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
void
subc_list_double_create(subc_list_double *l)
{
void
subc_list_double_create(subc_list_double *l)
{
- l->data =
(double *) malloc(CHUNKSIZE * sizeof (double)
);
+ l->data =
xnmalloc (CHUNKSIZE, sizeof *l->data
);
l->sz = CHUNKSIZE;
l->n_data = 0;
}
l->sz = CHUNKSIZE;
l->n_data = 0;
}
@@
-46,14
+47,14
@@
subc_list_double_push(subc_list_double *l, double d)
if (l->n_data >= l->sz )
{
l->sz += CHUNKSIZE;
if (l->n_data >= l->sz )
{
l->sz += CHUNKSIZE;
- l->data =
realloc(l->data, l->sz * sizeof(double)
);
+ l->data =
xnrealloc (l->data, l->sz, sizeof *l->data
);
}
}
/* Return the number of items in the list */
int
}
}
/* Return the number of items in the list */
int
-subc_list_double_count(subc_list_double *l)
+subc_list_double_count(
const
subc_list_double *l)
{
return l->n_data;
}
{
return l->n_data;
}
@@
-61,7
+62,7
@@
subc_list_double_count(subc_list_double *l)
/* Index into the list (array) */
double
/* Index into the list (array) */
double
-subc_list_double_at(subc_list_double *l, int idx)
+subc_list_double_at(
const
subc_list_double *l, int idx)
{
return l->data[idx];
}
{
return l->data[idx];
}