Charles Hixson:

byte[]    x8to7 (ubyte[] bin)

Better to add some annotations, like pure, @safe, nothrow, if you can, and to annotate the bin with an "in".


    int    fByte, fBit;

It's probably better to define them as size_t.



        switch (fBit)

I think D doesn't yet allow this switch to be _meaningfully_ a final switch.


                b    =    bin[fByte] & 0x7f;

D allows binary number literals as 0b100110010101.


                b    ~=    (b1 | b2);

Perhaps an output range is better?


        if    (b == 0)    bout    ~=    0x80;
        else            bout    ~=    b;
        fBit    =    fBit + 7;
        if    (fBit > 7)
        {    fByte++;
            fBit -=    7;

The formatting seems a bit messy.

Bye,
bearophile

Reply via email to