PATCH: change splay_tree_key & splay_tree_value types to void*

Greg McGary greg@mcgary.org
Fri Aug 25 14:05:00 GMT 2000


Splay trees with string keys & values need to store bounds,
so a `long' doesn't do the job.  I changed `long' to `void*',
but that might be too naive if GCC supports architectures
for which sizeof (long) > sizeof (void*).  If we need
to handle that, then I guess we should make these types
unions.

Anyway, this works fine, and causes no build or testsuite regressions
on conventional 32-bit architectures.

2000-08-25  Greg McGary  <greg@mcgary.org>

	* splay-tree.h

Index: include/splay-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/include/splay-tree.h,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -p -I\$[A-Z][a-z][a-z]*: -r1.11 -r1.11.2.1
--- splay-tree.h	2000/04/06 00:12:41	1.11
+++ splay-tree.h	2000/07/18 18:06:41	1.11.2.1
@@ -1,5 +1,5 @@
 /* A splay-tree datatype.  
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
    Contributed by Mark Mitchell (mark@markmitchell.com).
 
 This file is part of GNU CC.
@@ -40,8 +40,8 @@ extern "C" {
    these types, if necessary.  These types should be sufficiently wide
    that any pointer or scalar can be cast to these types, and then
    cast back, without loss of precision.  */
-typedef unsigned long int splay_tree_key;
-typedef unsigned long int splay_tree_value;
+typedef void *splay_tree_key;
+typedef void *splay_tree_value;
 
 /* Forward declaration for a node in the tree.  */
 typedef struct splay_tree_node_s *splay_tree_node;


More information about the Gcc-patches mailing list