liteserver / binn

Binary Serialization
Apache License 2.0
440 stars 58 forks source link

build issue on mips32 (big endian) #25

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hey,

I did some test builds with various compilers for various architectures.

On mips 32 be (gcc), the compiler halts with "invalid operands to binary % (have ‘u16 {aka short unsigned int }’ and ‘int’)".

I think what you meant to do at line 76, 100, 126 in binn.c is a modulo operation on a pointer address rather than a pointer.

Like: if (psource % 2 == 0) if ((uintptr_t)psource % 2 == 0)

kroggen commented 5 years ago

Hi!

I updated the fix.

If you find any problem on big endian, please inform. I have no big endian processor here to test it.

Running the tests should be sufficient.

Thank you for your contribution!