Avoid C-isms #5

Merged
PuercoPop merged 4 commits from avoid-c-isms into master 2019-04-02 07:25:07 +00:00

4 commits

Author SHA1 Message Date
Javier Olaechea
db5dd2b166 Use Read-time evaluation to make code more readable 2019-03-27 22:59:21 -05:00
Javier Olaechea
9facf444f4 Refactor uint Decoders
Instead bit-shifting to 'place' the bits where we want them to be and
adding Lisp provides the DPB function that allows us to deposit bits
where we want them in an integer.
2019-03-27 22:58:55 -05:00
Javier Olaechea
d130e45f58 Reuse uint decoders when possible
The int decoder does the same work as its corresponding uint decoder
before encoding the integer in Two's complement. We can re-use the
uint decoder instead of writing the same code in the corresponding int
decoder.
2019-03-27 22:58:25 -05:00
Javier Olaechea
5a1eaaebad Refactor int Encoders
Instead of Shifting bits and masking in order to extract a subset of
the bits Lisp provides the function LBD, which allows us to extract a
number of bits from an integer. This approach is more direct,
communicates the intent better and allows the compiler to do less work.
2019-03-27 22:56:50 -05:00