upgrade for changed vector
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Fri, 1 Jul 2022 13:28:42 +0000 (23:28 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Fri, 1 Jul 2022 13:28:42 +0000 (23:28 +1000)
tests/example-hashvector.c

index 516cd07393cc8e790e6b872a32453e767e18e7b2..8fe73b6ad4f53397bf95e30427fec2f2bbe73ccd 100644 (file)
@@ -20,6 +20,9 @@ static int voidp_haskey(itemkeyfun *this,void *item,void *key) {
     return memcmp( item, key, sizeof( ipslot ) ) == 0;
 }
 
+static void voidp_releasekey(itemkeyfun *this,void *key) {
+}
+
 static int shrink(vector *pv,unsigned long index,void *item,void *data) {
     if ( item ) {
        if ( item == HV_HOLE ) {
@@ -36,10 +39,11 @@ int main(int argc,char **argv) {
     itemkeyfun voidpfun = {
        .hashcode = voidp_hashcode,
        .itemkey = voidp_itemkey,
-       .haskey = voidp_haskey
+       .haskey = voidp_haskey,
+       .releasekey = voidp_releasekey
     };
     hashvector hv = {
-       .table = { 4, 0 },
+       .table = { 1, 4, 0 },
        .fill = 0,
        .holes = 0,
        .type = &voidpfun