comparison libiberty/splay-tree.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* A splay-tree datatype. 1 /* A splay-tree datatype.
2 Copyright (C) 1998-2017 Free Software Foundation, Inc. 2 Copyright (C) 1998-2018 Free Software Foundation, Inc.
3 Contributed by Mark Mitchell (mark@markmitchell.com). 3 Contributed by Mark Mitchell (mark@markmitchell.com).
4 4
5 This file is part of GNU CC. 5 This file is part of GNU CC.
6 6
7 GNU CC is free software; you can redistribute it and/or modify it 7 GNU CC is free software; you can redistribute it and/or modify it
28 #include "config.h" 28 #include "config.h"
29 #endif 29 #endif
30 30
31 #ifdef HAVE_STDLIB_H 31 #ifdef HAVE_STDLIB_H
32 #include <stdlib.h> 32 #include <stdlib.h>
33 #endif
34 #ifdef HAVE_STRING_H
35 #include <string.h>
33 #endif 36 #endif
34 37
35 #include <stdio.h> 38 #include <stdio.h>
36 39
37 #include "libiberty.h" 40 #include "libiberty.h"
588 else if ((char*) k1 > (char*) k2) 591 else if ((char*) k1 > (char*) k2)
589 return 1; 592 return 1;
590 else 593 else
591 return 0; 594 return 0;
592 } 595 }
596
597 /* Splay-tree comparison function, treating the keys as strings. */
598
599 int
600 splay_tree_compare_strings (splay_tree_key k1, splay_tree_key k2)
601 {
602 return strcmp ((char *) k1, (char *) k2);
603 }
604
605 /* Splay-tree delete function, simply using free. */
606
607 void
608 splay_tree_delete_pointers (splay_tree_value value)
609 {
610 free ((void *) value);
611 }