/[pspp]/pspp/src/crosstabs.q
ViewVC logotype

Diff of /pspp/src/crosstabs.q

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by blp, Sun Aug 7 04:39:28 2005 UTC revision 1.27 by blp, Mon Oct 24 02:51:32 2005 UTC
# Line 302  crs_custom_tables (struct cmd_crosstabs Line 302  crs_custom_tables (struct cmd_crosstabs
302    struct var_set *var_set;    struct var_set *var_set;
303    int n_by;    int n_by;
304    struct variable ***by = NULL;    struct variable ***by = NULL;
305    int *by_nvar = NULL;    size_t *by_nvar = NULL;
306    int nx = 1;    size_t nx = 1;
307    int success = 0;    int success = 0;
308    
309    /* Ensure that this is a TABLES subcommand. */    /* Ensure that this is a TABLES subcommand. */
# Line 326  crs_custom_tables (struct cmd_crosstabs Line 326  crs_custom_tables (struct cmd_crosstabs
326        if (!parse_var_set_vars (var_set, &by[n_by], &by_nvar[n_by],        if (!parse_var_set_vars (var_set, &by[n_by], &by_nvar[n_by],
327                                 PV_NO_DUPLICATE | PV_NO_SCRATCH))                                 PV_NO_DUPLICATE | PV_NO_SCRATCH))
328          goto done;          goto done;
329          if (xalloc_oversized (nx, by_nvar[n_by]))
330            {
331              msg (SE, _("Too many crosstabulation variables or dimensions."));
332              goto done;
333            }
334        nx *= by_nvar[n_by];        nx *= by_nvar[n_by];
335        n_by++;        n_by++;
336    
337        if (!lex_match (T_BY))        if (!lex_match (T_BY))
338          {          {
339            if (n_by < 1)            if (n_by < 2)
340              {              {
341                lex_error (_("expecting BY"));                lex_error (_("expecting BY"));
342                goto done;                goto done;
# Line 345  crs_custom_tables (struct cmd_crosstabs Line 350  crs_custom_tables (struct cmd_crosstabs
350      int *by_iter = xcalloc (n_by, sizeof *by_iter);      int *by_iter = xcalloc (n_by, sizeof *by_iter);
351      int i;      int i;
352    
353      xtab = xrealloc (xtab, sizeof *xtab * (nxtab + nx));      xtab = xnrealloc (xtab, sizeof *xtab, nxtab + nx);
354      for (i = 0; i < nx; i++)      for (i = 0; i < nx; i++)
355        {        {
356          struct crosstab *x;          struct crosstab *x;
# Line 408  crs_custom_variables (struct cmd_crossta Line 413  crs_custom_variables (struct cmd_crossta
413        
414    for (;;)    for (;;)
415      {      {
416        int orig_nv = variables_cnt;        size_t orig_nv = variables_cnt;
417        int i;        size_t i;
418    
419        long min, max;        long min, max;
420                

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26