summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libg++/include/bitdo1.h
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/lib/libg++/include/bitdo1.h')
-rw-r--r--gnu/lib/libg++/include/bitdo1.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/lib/libg++/include/bitdo1.h b/gnu/lib/libg++/include/bitdo1.h
new file mode 100644
index 0000000..c234d41
--- /dev/null
+++ b/gnu/lib/libg++/include/bitdo1.h
@@ -0,0 +1,32 @@
+#ifndef ONES
+#define ONES ((_BS_word)(~0L))
+#endif
+ register int nwords;
+ register _BS_word mask;
+ if (offset == 0)
+ ;
+ else if (offset + length >= _BS_BITS_PER_WORD)
+ {
+ mask = ONES _BS_RIGHT offset;
+ DOIT(*ptr++, mask);
+ length -= _BS_BITS_PER_WORD - offset;
+ }
+ else
+ {
+ mask = (ONES _BS_RIGHT (_BS_BITS_PER_WORD - length))
+ _BS_LEFT (_BS_BITS_PER_WORD - length - offset);
+ DOIT(*ptr, mask);
+ goto done;
+ }
+ nwords = _BS_INDEX(length);
+ while (--nwords >= 0)
+ {
+ DOIT(*ptr++, ONES);
+ }
+ length = _BS_POS (length);
+ if (length)
+ {
+ mask = ONES _BS_LEFT (_BS_BITS_PER_WORD - length);
+ DOIT(*ptr, mask);
+ }
+ done: ;
OpenPOWER on IntegriCloud