Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / security / p5-Digest-Nilsimsa / patches / patch-__nilsimsa.c
blob8d6b1746fc6bd4311211f39c9455c0557f0dd656
1 $NetBSD$
3 Fix build on systems that define popcount().
5 --- _nilsimsa.c.orig 2002-06-13 04:15:03.000000000 +0000
6 +++ _nilsimsa.c
7 @@ -48,7 +48,7 @@
8 */
10 unsigned int acc[256],threshold;
11 -unsigned char tran[256],popcount[256];
12 +unsigned char tran[256],pop_count[256];
13 struct nsrecord *selkarbi,terkarbi,*rules,gunma;
14 int nilselkarbi,nrules;
15 char *comparestr,*rulefile,*checkrulefile;
16 @@ -90,10 +90,10 @@ void dumptran()
18 void fillpopcount()
19 {int i,j;
20 - memset(popcount,0,256);
21 + memset(pop_count,0,256);
22 for (i=0;i<256;i++)
23 for (j=0;j<8;j++)
24 - popcount[i]+=1&(i>>j);
25 + pop_count[i]+=1&(i>>j);
28 int defromulate(FILE *file)
29 @@ -384,7 +384,7 @@ void makecode(struct nsrecord *a)
30 int nilsimsa(struct nsrecord *a,struct nsrecord *b)
31 {int i,bits;
32 for (i=bits=0;i<32;i++)
33 - bits+=popcount[255&(a->code[i]^b->code[i])];
34 + bits+=pop_count[255&(a->code[i]^b->code[i])];
35 return 128-bits;