- {
- bool with = false;
- bool paired = false;
-
- if (tt.n_vars > 0)
- {
- msg (SE, _("%s subcommand may not be used with %s."), "VARIABLES", "PAIRS");
- goto exit;
- }
-
- mode_count++;
- tt.mode = MODE_PAIRED;
- lex_match (lexer, T_EQUALS);
-
- if (!parse_variables_const (lexer, dict,
- &v1, &n_v1,
- PV_NO_DUPLICATE | PV_NUMERIC))
- goto exit;
-
- if ( lex_match (lexer, T_WITH))
- {
- with = true;
- if (!parse_variables_const (lexer, dict,
- &v2, &n_v2,
- PV_NO_DUPLICATE | PV_NUMERIC))
- goto exit;
-
- if (lex_match (lexer, T_LPAREN)
- && lex_match_id (lexer, "PAIRED")
- && lex_match (lexer, T_RPAREN))
- {
- paired = true;
- if (n_v1 != n_v2)
- {
- msg (SE, _("PAIRED was specified but the number of variables "
- "preceding WITH (%zu) did not match the number "
- "following (%zu)."),
- n_v1, n_v2);
- goto exit;
- }
- }
- }
- {
- int i;
-
- if ( !with )
- n_pairs = (n_v1 * (n_v1 - 1)) / 2.0;
- else if ( paired )
- n_pairs = n_v1;
- else
- n_pairs = n_v1 * n_v2;
-
- pairs = xcalloc (n_pairs, sizeof *pairs);
-
- if ( with)
- {
- int x = 0;
- if (paired)
- {
- for (i = 0 ; i < n_v1; ++i)
- {
- vp *pair = &pairs[i];
- (*pair)[0] = v1[i];
- (*pair)[1] = v2[i];
- }
- }
- else
- {
- for (i = 0 ; i < n_v1; ++i)
- {
- int j;
- for (j = 0 ; j < n_v2; ++j)
- {
- vp *pair = &pairs[x++];
- (*pair)[0] = v1[i];
- (*pair)[1] = v2[j];
- }
- }
- }
- }
- else
- {
- int x = 0;
- for (i = 0 ; i < n_v1; ++i)
- {
- int j;
-
- for (j = i + 1 ; j < n_v1; ++j)
- {
- vp *pair = &pairs[x++];
- (*pair)[0] = v1[i];
- (*pair)[1] = v1[j];
- }
- }
- }
-
- }
- }
+ {
+ bool with = false;
+ bool paired = false;
+
+ if (tt.n_vars > 0)
+ {
+ msg (SE, _("%s subcommand may not be used with %s."), "VARIABLES", "PAIRS");
+ goto exit;
+ }
+
+ mode_count++;
+ tt.mode = MODE_PAIRED;
+ lex_match (lexer, T_EQUALS);
+
+ if (!parse_variables_const (lexer, dict,
+ &v1, &n_v1,
+ PV_NO_DUPLICATE | PV_NUMERIC))
+ goto exit;
+
+ if ( lex_match (lexer, T_WITH))
+ {
+ with = true;
+ if (!parse_variables_const (lexer, dict,
+ &v2, &n_v2,
+ PV_NO_DUPLICATE | PV_NUMERIC))
+ goto exit;
+
+ if (lex_match (lexer, T_LPAREN)
+ && lex_match_id (lexer, "PAIRED")
+ && lex_match (lexer, T_RPAREN))
+ {
+ paired = true;
+ if (n_v1 != n_v2)
+ {
+ msg (SE, _("PAIRED was specified but the number of variables "
+ "preceding WITH (%zu) did not match the number "
+ "following (%zu)."),
+ n_v1, n_v2);
+ goto exit;
+ }
+ }
+ }
+ {
+ int i;
+
+ if ( !with )
+ n_pairs = (n_v1 * (n_v1 - 1)) / 2.0;
+ else if ( paired )
+ n_pairs = n_v1;
+ else
+ n_pairs = n_v1 * n_v2;
+
+ pairs = xcalloc (n_pairs, sizeof *pairs);
+
+ if ( with)
+ {
+ int x = 0;
+ if (paired)
+ {
+ for (i = 0 ; i < n_v1; ++i)
+ {
+ vp *pair = &pairs[i];
+ (*pair)[0] = v1[i];
+ (*pair)[1] = v2[i];
+ }
+ }
+ else
+ {
+ for (i = 0 ; i < n_v1; ++i)
+ {
+ int j;
+ for (j = 0 ; j < n_v2; ++j)
+ {
+ vp *pair = &pairs[x++];
+ (*pair)[0] = v1[i];
+ (*pair)[1] = v2[j];
+ }
+ }
+ }
+ }
+ else
+ {
+ int x = 0;
+ for (i = 0 ; i < n_v1; ++i)
+ {
+ int j;
+
+ for (j = i + 1 ; j < n_v1; ++j)
+ {
+ vp *pair = &pairs[x++];
+ (*pair)[0] = v1[i];
+ (*pair)[1] = v1[j];
+ }
+ }
+ }
+
+ }
+ }