source: trunk/src/emx/include/Attic/cpp/bitdo1.h@ 18

Last change on this file since 18 was 18, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 695 bytes
Line 
1#ifndef ONES
2#define ONES ((_BS_word)(~0L))
3#endif
4 register int nwords;
5 register _BS_word mask;
6 if (offset == 0)
7 ;
8 else if (offset + length >= _BS_BITS_PER_WORD)
9 {
10 mask = ONES _BS_RIGHT offset;
11 DOIT(*ptr++, mask);
12 length -= _BS_BITS_PER_WORD - offset;
13 }
14 else
15 {
16 mask = (ONES _BS_RIGHT (_BS_BITS_PER_WORD - length))
17 _BS_LEFT (_BS_BITS_PER_WORD - length - offset);
18 DOIT(*ptr, mask);
19 goto done;
20 }
21 nwords = _BS_INDEX(length);
22 while (--nwords >= 0)
23 {
24 DOIT(*ptr++, ONES);
25 }
26 length = _BS_POS (length);
27 if (length)
28 {
29 mask = ONES _BS_LEFT (_BS_BITS_PER_WORD - length);
30 DOIT(*ptr, mask);
31 }
32 done: ;
Note: See TracBrowser for help on using the repository browser.