Commit 03dc5e56 authored by Etienne Renault's avatar Etienne Renault

Update to avoid the use of deprecated functions.

* src/main.c, src/rule.c: here.
parent ace6df97
......@@ -170,8 +170,7 @@ int main (int argc, char **argv)
#ifndef NDEBUG
/* Install our allocator, to ease leak detection. */
list_allocator = g_allocator_new ("List Allocator", 1024);
g_list_push_allocator (list_allocator);
list_allocator = g_slice_alloc (1024);
#endif
/* Initialize vars. */
......@@ -288,13 +287,11 @@ int main (int argc, char **argv)
}
g_list_free (include_dirs);
#ifndef NDEBUG
g_list_pop_allocator ();
g_allocator_free (list_allocator);
g_slice_free1 (1024, list_allocator);
#endif
/* Remove log handler. */
g_log_remove_handler (NULL, handler_id);
g_free (g_get_prgname ());
return 0;
}
......@@ -154,9 +154,9 @@ Tree *create_tree (char *id, char *varname, Tree *left, Tree *right)
return tree;
}
static void check_term_num (char *key, Term *value, int num)
static void check_term_num (char *key, Term *value, int* num)
{
if (num != -1 && value->number == num)
if (*num != -1 && value->number == *num)
yyerror ("duplicate terminal id \"%s\"", key);
}
......@@ -181,7 +181,7 @@ Term *create_term (char *id, int num)
if (!term_hash)
term_hash = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_foreach (term_hash, (GHFunc) check_term_num, (gpointer) num);
g_hash_table_foreach (term_hash, (GHFunc) check_term_num, (gpointer) &num);
term = g_new0 (Term, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment