pci: don't do sanity check for missing pci bus, the check can misfire.
[minix.git] / commands / byacc / warshall.c
blobb449e4e274e412815157725aa1659bdb8864fa92
1 #include "defs.h"
3 transitive_closure(R, n)
4 unsigned *R;
5 int n;
7 register int rowsize;
8 register unsigned i;
9 register unsigned *rowj;
10 register unsigned *rp;
11 register unsigned *rend;
12 register unsigned *ccol;
13 register unsigned *relend;
14 register unsigned *cword;
15 register unsigned *rowi;
17 rowsize = WORDSIZE(n);
18 relend = R + n*rowsize;
20 cword = R;
21 i = 0;
22 rowi = R;
23 while (rowi < relend)
25 ccol = cword;
26 rowj = R;
28 while (rowj < relend)
30 if (*ccol & (1 << i))
32 rp = rowi;
33 rend = rowj + rowsize;
34 while (rowj < rend)
35 *rowj++ |= *rp++;
37 else
39 rowj += rowsize;
42 ccol += rowsize;
45 if (++i >= BITS_PER_WORD)
47 i = 0;
48 cword++;
51 rowi += rowsize;
55 reflexive_transitive_closure(R, n)
56 unsigned *R;
57 int n;
59 register int rowsize;
60 register unsigned i;
61 register unsigned *rp;
62 register unsigned *relend;
64 transitive_closure(R, n);
66 rowsize = WORDSIZE(n);
67 relend = R + n*rowsize;
69 i = 0;
70 rp = R;
71 while (rp < relend)
73 *rp |= (1 << i);
74 if (++i >= BITS_PER_WORD)
76 i = 0;
77 rp++;
80 rp += rowsize;