X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;fp=src%2Fdata%2Fdictionary.c;h=71c6e8136e7fca2b419d5580961d32a82304e9d9;hb=039238c6fd5cc2310e0d6b40358f29347cfcbce7;hp=23a07ae5863fbeecda6e804c1b97487787b5e982;hpb=69bd50b717021786aedf541394a150b72e4e9a7c;p=pspp diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 23a07ae586..71c6e8136e 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -1928,55 +1928,6 @@ dict_var_changed (const struct variable *v, unsigned int what, struct variable * } - -/* Dictionary used to contain "internal variables". */ -static struct dictionary *internal_dict; - -/* Create a variable of the specified WIDTH to be used for internal - calculations only. The variable is assigned case index CASE_IDX. */ -struct variable * -dict_create_internal_var (int case_idx, int width) -{ - if (internal_dict == NULL) - internal_dict = dict_create ("UTF-8"); - - for (;;) - { - static int counter = INT_MAX / 2; - struct variable *var; - char name[64]; - - if (++counter == INT_MAX) - counter = INT_MAX / 2; - - sprintf (name, "$internal%d", counter); - var = dict_create_var (internal_dict, name, width); - if (var != NULL) - { - set_var_case_index (var, case_idx); - return var; - } - } -} - -/* Destroys VAR, which must have been created with - dict_create_internal_var(). */ -void -dict_destroy_internal_var (struct variable *var) -{ - if (var != NULL) - { - dict_delete_var (internal_dict, var); - - /* Destroy internal_dict if it has no variables left, just so that - valgrind --leak-check --show-reachable won't show internal_dict. */ - if (dict_get_n_vars (internal_dict) == 0) - { - dict_unref (internal_dict); - internal_dict = NULL; - } - } -} int vardict_get_dict_index (const struct vardict_info *vardict)