diff options
author | Karl Williamson <khw@cpan.org> | 2020-05-29 14:25:19 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-07-17 22:04:08 -0600 |
commit | d223e1ea9ae864c0e563187f1e76240ef1acad87 (patch) | |
tree | f670961d58ff3c055cff40637ca9daacaf1b462e /doop.c | |
parent | 0654f0ab17405d0d55f0006348b4ed0084aa1fc8 (diff) | |
download | perl-d223e1ea9ae864c0e563187f1e76240ef1acad87.tar.gz |
handy.h: Create nBIT_MASK(n) macro
This encapsulates a common paradigm, making sure that it is done
correctly for the platform's size.
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -857,7 +857,7 @@ Perl_do_vecget(pTHX_ SV *sv, STRLEN offset, int size) } } else if (size < 8) - retnum = (s[uoffset] >> bitoffs) & ((1 << size) - 1); + retnum = (s[uoffset] >> bitoffs) & nBIT_MASK(size); else { if (size == 8) retnum = s[uoffset]; @@ -960,7 +960,7 @@ Perl_do_vecset(pTHX_ SV *sv) } if (size < 8) { - mask = (1 << size) - 1; + mask = nBIT_MASK(size); lval &= mask; s[offset] &= ~(mask << bitoffs); s[offset] |= lval << bitoffs; |