1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-28 20:47:11 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Werner Almesberger
03c5e4ffe7 qpkg: optimize duplicate lookup when inserting a new name
- jrb.h, jrb.c (jrb_find_or_insert): new function to look for a node and
  to insert a new one if not found
- id.c (make_id): use jrb_find_or_insert to avoid looking up new nodes
  twice
- TODO: report the improvement
2010-11-19 22:20:15 -03:00
Werner Almesberger
47abebe364 qpkg: renamed "struct jrb_node" to "struct jrb" replaced JRB with "struct jrb *" 2010-11-19 20:48:49 -03:00
Werner Almesberger
c060b883a9 qpkg: mention in jrb-related files that they've been heavily edited 2010-11-19 20:37:29 -03:00
Werner Almesberger
7e641d2655 qpkg/jrb.[ch]: remove trailing spaces 2010-11-19 20:35:43 -03:00
Werner Almesberger
dec07f359a qpkg/jrb.h: general code cleanup
- jrb.h: fixed indentation
- jrb.h: named anonymous parameters
- jrb.h: removed "extern" from function prototypes
2010-11-19 19:57:38 -03:00
Werner Almesberger
cc92c67080 qpkg: (jrb) remove _gen suffix, since we removed the non-generic variants
- jrb.h, jrb.c (jrb_find_gte_gen): renamed to jrb_find_gte
- jrb.h, jrb.c (jrb_find_gen): renamed to jrb_find
- jrb.h, jrb.c (jrb_insert_gen): renamed to jrb_insert
- rbtest.c (INSERT): track jrb_insert_gen name change
2010-11-19 19:52:39 -03:00
Werner Almesberger
7f05c9e284 qpkg: remove Jval
- jrb.h (struct jrb_node): changed "key" and "val" from "Jval" to "void *"
- jrb.h, jval.c (jrb_insert_gen, jrb_find_gen, jrb_find_gte_gen, jrb_val):
  replaced "Jval" with "void *" or "const void *", respectively
- rbtest.c (cmp, INSERT): updated for Jval removal
- rbtest.c (main): use jrb_val(jrb) instead of jval_v(jrb->val)
- Makefile (OBJS_rbtest): removed jval.o
- jval.h, jval.c: removed
2010-11-19 19:47:52 -03:00
Werner Almesberger
769d31581d qpkg: removed non-generic jrb access functions
- jrb.h, jrb.c (jrb_insert_str, jrb_insert_int, jrb_insert_dbl): removed
- jrb.h, jrb.c (jrb_find_str, jrb_find_int, jrb_find_dbl): removed
- jrb.h, jrb.c (jrb_find_gte_str, jrb_find_gte_int, jrb_find_gte_dbl): removed
- jrb.c (jrb_print_tree, jrb_iprint_tree): removed unused tree dump functions
2010-11-19 19:36:31 -03:00
Werner Almesberger
2787a45c43 qpkg: added James S. Plank's red-black trees 2010-11-19 19:17:47 -03:00