Commit | Line | Data |
---|---|---|
fdc7d56f | 1 | /* |
e95fc82a KB |
2 | * Copyright (c) 1983 Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
a6547b1d | 5 | * %sccs.include.redist.c% |
fdc7d56f EW |
6 | */ |
7 | ||
4d5dca4b | 8 | #ifndef lint |
a6547b1d | 9 | static char sccsid[] = "@(#)misc.c 5.3 (Berkeley) %G%"; |
e95fc82a | 10 | #endif /* not lint */ |
4d5dca4b EW |
11 | |
12 | #include "externs.h" | |
13 | ||
14 | card(array, size) /* for beenthere, injuries */ | |
15 | register char *array; | |
16 | int size; | |
17 | { | |
18 | register char *end = array + size; | |
19 | register int i = 0; | |
20 | ||
21 | while (array < end) | |
22 | if (*array++) | |
23 | i++; | |
24 | return (i); | |
25 | } | |
26 | ||
27 | ucard(array) | |
28 | register unsigned *array; | |
29 | { | |
30 | register int j = 0, n; | |
31 | ||
32 | for (n = 0; n < NUMOFOBJECTS; n++) | |
33 | if (testbit(array, n)) | |
34 | j++; | |
35 | return (j); | |
36 | } |