gboolean valid;
GtkTreeIter iter;
- int j;
struct hmap count_map[SEPARATOR_CNT];
- for (j = 0; j < SEPARATOR_CNT; ++j)
+ for (int j = 0; j < SEPARATOR_CNT; ++j)
hmap_init (count_map + j);
GtkTreePath *p = gtk_tree_path_new_from_indices (first_line, -1);
gchar *line_text = NULL;
gtk_tree_model_get (GTK_TREE_MODEL (ia->text_file), &iter, 1, &line_text, -1);
- gint *counts = xzalloc (sizeof *counts * SEPARATOR_CNT);
+ gint *counts = XCALLOC (SEPARATOR_CNT, gint);
struct substring cs = ss_cstr (line_text);
for (;
if (cn == NULL)
{
- struct separator_count_node *new_cn = xzalloc (sizeof *new_cn);
+ struct separator_count_node *new_cn = XZALLOC (struct separator_count_node);
new_cn->occurance = counts[j];
new_cn->quantity = 1;
hmap_insert (&count_map[j], &new_cn->node, hash);
{
int most_frequent = -1;
int largest = 0;
- for (j = 0; j < SEPARATOR_CNT; ++j)
+ for (int j = 0; j < SEPARATOR_CNT; ++j)
{
struct separator_count_node *cn;
struct separator_count_node *next;
/* Called just before the separators page becomes visible in the
assistant. */
static void
-prepare_separators_page (PsppireImportAssistant *ia)
+prepare_separators_page (PsppireImportAssistant *ia, GtkWidget *new_page, enum IMPORT_ASSISTANT_DIRECTION dir)
{
+ if (dir != IMPORT_ASSISTANT_FORWARDS)
+ return;
+
gtk_tree_view_set_model (GTK_TREE_VIEW (ia->fields_tree_view),
GTK_TREE_MODEL (ia->delimiters_model));
char *xx = data_in (ss_cstr (ss),
"UTF-8",
var_get_write_format (var)->type,
+ settings_get_fmt_settings (),
v, var_get_width (var), "UTF-8");
free (xx);
apply_dict (const struct dictionary *dict, struct string *s)
{
size_t var_cnt = dict_get_var_cnt (dict);
- size_t i;
- for (i = 0; i < var_cnt; i++)
+ for (size_t i = 0; i < var_cnt; i++)
{
struct variable *var = dict_get_var (dict, i);
const char *name = var_get_name (var);
const struct val_labs *vls = var_get_value_labels (var);
const struct val_lab **labels = val_labs_sorted (vls);
size_t n_labels = val_labs_count (vls);
- size_t i;
syntax_gen_pspp (s, "VALUE LABELS %ss", name);
- for (i = 0; i < n_labels; i++)
+ for (size_t j = 0; j < n_labels; j++)
{
- const struct val_lab *vl = labels[i];
+ const struct val_lab *vl = labels[j];
ds_put_cstr (s, "\n ");
syntax_gen_value (s, &vl->value, width, format);
ds_put_byte (s, ' ');