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

Diff of /pspp/src/print.c

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

revision 1.21 by blp, Sun Jul 31 21:42:46 2005 UTC revision 1.22 by blp, Mon Oct 24 02:51:32 2005 UTC
# Line 249  struct fmt_list Line 249  struct fmt_list
249  static struct  static struct
250    {    {
251      struct variable **v;                /* variable list */      struct variable **v;                /* variable list */
252      int nv;                     /* number of variables in list */      size_t nv;                  /* number of variables in list */
253      int cv;                     /* number of variables from list used up so far      size_t cv;                  /* number of variables from list used up so far
254                                     by the FORTRAN-like format specifiers */                                     by the FORTRAN-like format specifiers */
255    
256      int recno;                  /* current 1-based record number */      int recno;                  /* current 1-based record number */
# Line 452  parse_variable_argument (void) Line 452  parse_variable_argument (void)
452    else    else
453      {      {
454        /* User wants dictionary format specifiers. */        /* User wants dictionary format specifiers. */
455        int i;        size_t i;
456    
457        lex_match ('*');        lex_match ('*');
458        for (i = 0; i < fx.nv; i++)        for (i = 0; i < fx.nv; i++)
# Line 500  check_string_width (const struct fmt_spe Line 500  check_string_width (const struct fmt_spe
500  static int  static int
501  fixed_parse_compatible (void)  fixed_parse_compatible (void)
502  {  {
503    int dividend;    int individual_var_width;
504    int type;    int type;
505    int i;    size_t i;
506    
507    type = fx.v[0]->type;    type = fx.v[0]->type;
508    for (i = 1; i < fx.nv; i++)    for (i = 1; i < fx.nv; i++)
# Line 610  fixed_parse_compatible (void) Line 610  fixed_parse_compatible (void)
610    
611    if ((fx.lc - fx.fc + 1) % fx.nv)    if ((fx.lc - fx.fc + 1) % fx.nv)
612      {      {
613        msg (SE, _("The %d columns %d-%d can't be evenly divided into %d "        msg (SE, _("The %d columns %d-%d can't be evenly divided into %u "
614                   "fields."), fx.lc - fx.fc + 1, fx.fc + 1, fx.lc + 1, fx.nv);                   "fields."),
615               fx.lc - fx.fc + 1, fx.fc + 1, fx.lc + 1, (unsigned) fx.nv);
616        return 0;        return 0;
617      }      }
618    
619    dividend = (fx.lc - fx.fc + 1) / fx.nv;    individual_var_width = (fx.lc - fx.fc + 1) / fx.nv;
620    fx.spec.u.v.f.w = dividend;    fx.spec.u.v.f.w = individual_var_width;
621    if (!check_output_specifier (&fx.spec.u.v.f, true)    if (!check_output_specifier (&fx.spec.u.v.f, true)
622        || !check_specifier_type (&fx.spec.u.v.f, type, true))        || !check_specifier_type (&fx.spec.u.v.f, type, true))
623      return 0;      return 0;
# Line 630  fixed_parse_compatible (void) Line 631  fixed_parse_compatible (void)
631    fx.spec.type = PRT_VAR;    fx.spec.type = PRT_VAR;
632    for (i = 0; i < fx.nv; i++)    for (i = 0; i < fx.nv; i++)
633      {      {
634        fx.spec.fc = fx.fc + dividend * i;        fx.spec.fc = fx.fc + individual_var_width * i;
635        fx.spec.u.v.v = fx.v[i];        fx.spec.u.v.v = fx.v[i];
636        append_var_spec (&fx.spec);        append_var_spec (&fx.spec);
637      }      }

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