Use get_bits_long() in decode_scalar(). Use unsigned int for decoded value.
Attach a file by drag & drop or click to upload