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., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <config.h>
#include "error.h"
#include "var.h"
#include "vfm.h"
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
#include "debug-print.h"
/* FIXME: /N subcommand not implemented. It should be pretty simple,
struct variable *single_split; /* Single SPLIT FILE variable. */
/* Factor variables. */
- int n_factors; /* Number of factor variables. */
+ size_t n_factors; /* Number of factor variables. */
struct variable **factors; /* Factor variables. */
int is_per_factor[PROX + 1]; /* Is there per-factor data? */
if (lex_match_id ("VARIABLES"))
{
char **v;
- int nv;
+ size_t nv;
if (seen & 1)
{
goto lossage;
{
- int i;
+ size_t i;
for (i = 0; i < nv; i++)
- if (!strcmp (v[i], "VARNAME_"))
+ if (!strcasecmp (v[i], "VARNAME_"))
{
msg (SE, _("VARNAME_ cannot be explicitly specified on "
"VARIABLES."));
}
{
- int i;
+ size_t i;
for (i = 0; i < nv; i++)
{
struct variable *new_var;
- if (strcmp (v[i], "ROWTYPE_"))
+ if (strcasecmp (v[i], "ROWTYPE_"))
{
new_var = dict_create_var_assert (default_dict, v[i], 0);
attach_mxd_aux (new_var, MXD_CONTINUOUS, i);
if (dict_lookup_var (default_dict, tokid) == NULL
&& (lex_look_ahead () == '.' || lex_look_ahead () == '/'))
{
- if (!strcmp (tokid, "ROWTYPE_") || !strcmp (tokid, "VARNAME_"))
+ if (!strcasecmp (tokid, "ROWTYPE_")
+ || !strcasecmp (tokid, "VARNAME_"))
{
msg (SE, _("Split variable may not be named ROWTYPE_ "
"or VARNAME_."));
else
{
struct variable **split;
- int n;
+ size_t n;
if (!parse_variables (default_dict, &split, &n, PV_NO_DUPLICATE))
goto lossage;
}
seen |= 4;
- if (!parse_variables (default_dict, &mx->factors, &mx->n_factors, PV_NONE))
+ if (!parse_variables (default_dict, &mx->factors, &mx->n_factors,
+ PV_NONE))
goto lossage;
{
- int i;
+ size_t i;
for (i = 0; i < mx->n_factors; i++)
{
};
for (tp = tab; tp->value != -1; tp++)
- if (!strcmp (s, tp->string))
+ if (!strcasecmp (s, tp->string))
{
if (collide)
*collide = tp->collide;
di.e = token->string + token->length;
di.v = (union value *) &token->number;
di.f1 = first_column;
- di.format.type = FMT_F;
- di.format.w = token->length;
- di.format.d = 0;
+ di.format = make_output_format (FMT_F, token->length, 0);
if (!data_in (&di))
return 0;
nr.mx = mx;
nr.data = NULL;
- nr.factor_values = xmalloc (sizeof *nr.factor_values * mx->n_factors * mx->cells);
+ nr.factor_values = xmalloc (sizeof *nr.factor_values
+ * mx->n_factors * mx->cells);
nr.max_cell_idx = 0;
nr.split_values = xmalloc (sizeof *nr.split_values
* dict_get_split_cnt (default_dict));
- vfm_source = create_case_source (&matrix_data_without_rowtype_source_class,
- default_dict, &nr);
+ vfm_source = create_case_source (&matrix_data_without_rowtype_source_class, &nr);
procedure (NULL, NULL);
}
{
- int i;
+ size_t i;
for (i = 0; i < mx->n_factors; i++)
{
int type = content_type[content];
{
- st_bare_pad_copy (case_data_rw (c, mx->rowtype_->fv)->s,
- content_names[content], 8);
+ buf_copy_str_rpad (case_data_rw (c, mx->rowtype_->fv)->s, 8,
+ content_names[content]);
if (type != 1)
memset (case_data_rw (c, mx->varname_->fv)->s, ' ', 8);
cp++;
}
if (type == 1)
- st_bare_pad_copy (case_data_rw (c, mx->varname_->fv)->s,
- dict_get_var (default_dict,
- mx->first_continuous + i)->name,
- 8);
+ buf_copy_str_rpad (case_data_rw (c, mx->varname_->fv)->s, 8,
+ dict_get_var (default_dict,
+ mx->first_continuous + i)->name);
write_case (wc_data);
}
}
for (cell = 0; cell < mx->cells; cell++)
{
{
- int factor;
+ size_t factor;
for (factor = 0; factor < mx->n_factors; factor++)
{
int content;
{
- int factor;
+ size_t factor;
for (factor = 0; factor < mx->n_factors; factor++)
case_data_rw (c, mx->factors[factor]->fv)->f = SYSMIS;
mx->cells = 0;
vfm_source = create_case_source (&matrix_data_with_rowtype_source_class,
- default_dict, &wr);
+ &wr);
procedure (NULL, NULL);
free (wr.split_values);
for (iter = wr->data; iter; iter = iter->next)
{
{
- int factor;
+ size_t factor;
for (factor = 0; factor < mx->n_factors; factor++)
- {
- case_data_rw (c, mx->factors[factor]->fv)->f
- = iter->factors[factor];
- debug_printf (("f:%s ", factors[factor]->name));
- }
+ case_data_rw (c, mx->factors[factor]->fv)->f
+ = iter->factors[factor];
}
{
wr->content = -1;
{
- int i;
+ size_t i;
for (i = 0; i < mx->n_factors; i++)
{
mechanism. */
if (wr->current)
{
- int i;
+ size_t i;
for (i = 0; i < mx->n_factors; i++)
if (factor_values[i] != wr->current->factors[i])
for (iter = wr->data; iter; iter = iter->next)
{
- int i;
+ size_t i;
for (i = 0; i < mx->n_factors; i++)
if (factor_values[i] != iter->factors[i])
{
struct factor_data *new = pool_alloc (mx->container, sizeof *new);
- new->factors = pool_alloc (mx->container, sizeof *new->factors * mx->n_factors);
+ new->factors = pool_alloc (mx->container,
+ sizeof *new->factors * mx->n_factors);
{
- int i;
+ size_t i;
for (i = 0; i < mx->n_factors; i++)
new->factors[i] = factor_values[i];