/[pspp]/pspp/src/count.c
ViewVC logotype

Diff of /pspp/src/count.c

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

revision 1.21 by blp, Mon Oct 24 02:51:32 2005 UTC revision 1.22 by blp, Wed Oct 26 05:06:14 2005 UTC
# Line 230  fail: Line 230  fail:
230    
231  /* Parses a set of numeric criterion values. */  /* Parses a set of numeric criterion values. */
232  static int  static int
233  parse_numeric_criteria (struct counting * c)  parse_numeric_criteria (struct counting *c)
234  {  {
235    size_t n = 0;    size_t n = 0;
236    size_t m = 0;    size_t m = 0;
# Line 243  parse_numeric_criteria (struct counting Line 243  parse_numeric_criteria (struct counting
243        if (n + 1 >= m)        if (n + 1 >= m)
244          {          {
245            m += 16;            m += 16;
246            c->crit.n = xrealloc (c->crit.n, m * sizeof (struct cnt_num));            c->crit.n = xnrealloc (c->crit.n, m, sizeof *c->crit.n);
247          }          }
248    
249        cur = &c->crit.n[n++];        cur = &c->crit.n[n++];
# Line 324  parse_numeric_criteria (struct counting Line 324  parse_numeric_criteria (struct counting
324  /* Parses a set of string criteria values.  The skeleton is the same  /* Parses a set of string criteria values.  The skeleton is the same
325     as parse_numeric_criteria(). */     as parse_numeric_criteria(). */
326  static int  static int
327  parse_string_criteria (struct counting * c)  parse_string_criteria (struct counting *c)
328  {  {
329    int len = 0;    int len = 0;
330    
# Line 344  parse_string_criteria (struct counting * Line 344  parse_string_criteria (struct counting *
344        if (n + 1 >= m)        if (n + 1 >= m)
345          {          {
346            m += 16;            m += 16;
347            c->crit.n = xrealloc (c->crit.n, m * sizeof (struct cnt_str));            c->crit.s = xnrealloc (c->crit.s, m, sizeof *c->crit.s);
348          }          }
349    
350        if (!lex_force_string ())        if (!lex_force_string ())
# Line 368  parse_string_criteria (struct counting * Line 368  parse_string_criteria (struct counting *
368    
369  /* Counts the number of values in case C matching counting CNT. */  /* Counts the number of values in case C matching counting CNT. */
370  static inline int  static inline int
371  count_numeric (struct counting * cnt, struct ccase * c)  count_numeric (struct counting *cnt, struct ccase *c)
372  {  {
373    int counter = 0;    int counter = 0;
374    size_t i;    size_t i;
# Line 433  count_numeric (struct counting * cnt, st Line 433  count_numeric (struct counting * cnt, st
433    
434  /* Counts the number of values in case C matching counting CNT. */  /* Counts the number of values in case C matching counting CNT. */
435  static inline int  static inline int
436  count_string (struct counting * cnt, struct ccase * c)  count_string (struct counting *cnt, struct ccase *c)
437  {  {
438    int counter = 0;    int counter = 0;
439    size_t i;    size_t i;
# Line 466  count_string (struct counting * cnt, str Line 466  count_string (struct counting * cnt, str
466    
467  /* Performs the COUNT transformation T on case C. */  /* Performs the COUNT transformation T on case C. */
468  static int  static int
469  count_trns_proc (struct trns_header * trns, struct ccase * c,  count_trns_proc (struct trns_header *trns, struct ccase *c,
470                   int case_num UNUSED)                   int case_num UNUSED)
471  {  {
472    struct cnt_var_info *info;    struct cnt_var_info *info;
# Line 488  count_trns_proc (struct trns_header * tr Line 488  count_trns_proc (struct trns_header * tr
488    
489  /* Destroys all dynamic data structures associated with T. */  /* Destroys all dynamic data structures associated with T. */
490  static void  static void
491  count_trns_free (struct trns_header * t)  count_trns_free (struct trns_header *t)
492  {  {
493    struct cnt_var_info *iter, *next;    struct cnt_var_info *iter, *next;
494    

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

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