Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / security / stegtunnel / patches / patch-ab
blobbb17546ff9e48fc89f4ae950f00eaf3e17260252
1 $NetBSD$
3 --- hashtab.c   2007/10/03 12:04:01     1.1
4 +++ hashtab.c   2007/10/03 12:08:02
5 @@ -28,6 +28,10 @@
6  --------------------------------------------------------------------
7  */
8  
9 +#include <sys/types.h>
10 +#include <stdlib.h>
11 +#include <string.h>
13  #ifndef STANDARD
14  #include "standard.h"
15  #endif
16 @@ -41,6 +45,7 @@
17  #include "recycle.h"
18  #endif
20 +#ifdef HASHTAB_DEBUG
21  /* sanity check -- make sure ipos, apos, and count make sense */
22  static void  hsanity(t)
23  htab *t;
24 @@ -51,7 +56,7 @@
25    /* test that apos makes sense */
26    end = (ub4)1<<(t->logsize);
27    if (end < t->apos)
28 -    printf("error:  end %ld  apos %ld\n", end, t->apos);
29 +    printf("error:  end %ld  apos %ld\n", (long) end, (long) t->apos);
31    /* test that ipos is in bucket apos */
32    if (t->ipos)
33 @@ -59,7 +64,7 @@
34      for (h=t->table[t->apos];  h && h != t->ipos;  h = h->next)
35        ;
36      if (h != t->ipos)
37 -      printf("error:ipos not in apos, apos is %ld\n", t->apos);
38 +      printf("error:ipos not in apos, apos is %ld\n", (long) t->apos);
39    }
41    /* test that t->count is the number of elements in the table */
42 @@ -68,8 +73,9 @@
43      for (h=t->table[i];  h;  h=h->next)
44        ++counter;
45    if (counter != t->count)
46 -    printf("error: counter %ld  t->count %ld\n", counter, t->count);
47 +    printf("error: counter %ld  t->count %ld\n", (long) counter, (long) t->count);
48  }
49 +#endif /* HASHTAB_DEBUG */
52  /*
53 @@ -138,7 +144,6 @@
54  void hdestroy( t)
55  htab  *t;    /* the table */
56  {
57 -  hitem *h;
58    refree(t->space);
59    free((char *)t->table);
60    free((char *)t);
61 @@ -351,10 +356,10 @@
62    printf("\n");
63    for (walk=stat; walk; walk=walk->next)
64    {
65 -    printf("items %ld:  %ld buckets\n", walk->keyl, walk->hval);
66 +    printf("items %ld:  %ld buckets\n", (long)walk->keyl, (long)walk->hval);
67    }
68    printf("\nbuckets: %ld  items: %ld  existing: %g\n\n",
69 -         ((ub4)1<<t->logsize), t->count, total);
70 +         (long)((ub4)1<<t->logsize), (long)t->count, total);
72    /* clean up */
73    while (stat)