projects
/
rrq
/
rrqmisc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d8c1cca
)
debug vector_iterate for 4-bit levels
author
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Sun, 26 Jun 2022 05:46:29 +0000
(15:46 +1000)
committer
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Sun, 26 Jun 2022 05:46:29 +0000
(15:46 +1000)
vector/vector.c
patch
|
blob
|
history
diff --git
a/vector/vector.c
b/vector/vector.c
index 129ba02990e8e01d03ec6364b1092ac418e654d9..feaed9f1792ae571d92083bd4a7c642d2f9f370a 100644
(file)
--- a/
vector/vector.c
+++ b/
vector/vector.c
@@
-15,6
+15,8
@@
typedef union {
} __attribute__ ((__packed__)) as_byte[8];
} vector_indexing;
+#define VECTOR_LEVEL_MASK ( VECTOR_SLOTS - 1 )
+
#define VECTOR_PART_BYTE(i,p) ((vector_indexing*)(i))->as_byte[ (p)/2 ]
static int VECTOR_INDEX_PART(vector_index *index,int part) {
@@
-359,7
+361,7
@@
void vector_iterate(vector *pv,
if ( slot == 0 ) {
break;
}
- int i = index &
0xff
;
+ int i = index &
VECTOR_LEVEL_MASK
;
for ( ; i < VECTOR_SLOTS && index < pv->size; i++, index++, slot++ ) {
if ( itemfn( index, *slot, data ) ) {
return;