Mercurial > hg > CbC > CbC_gcc
diff libiberty/splay-tree.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/libiberty/splay-tree.c Fri Oct 27 22:46:09 2017 +0900 +++ b/libiberty/splay-tree.c Thu Oct 25 07:37:49 2018 +0900 @@ -1,5 +1,5 @@ /* A splay-tree datatype. - Copyright (C) 1998-2017 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. Contributed by Mark Mitchell (mark@markmitchell.com). This file is part of GNU CC. @@ -31,6 +31,9 @@ #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif #include <stdio.h> @@ -590,3 +593,19 @@ else return 0; } + +/* Splay-tree comparison function, treating the keys as strings. */ + +int +splay_tree_compare_strings (splay_tree_key k1, splay_tree_key k2) +{ + return strcmp ((char *) k1, (char *) k2); +} + +/* Splay-tree delete function, simply using free. */ + +void +splay_tree_delete_pointers (splay_tree_value value) +{ + free ((void *) value); +}