WojciechMula / toys

Storage for my snippets, toy programs, etc.
BSD 2-Clause "Simplified" License
316 stars 38 forks source link

Why tmp in SSE22 is uint8_t? #6

Closed XZiar closed 6 years ago

XZiar commented 6 years ago

https://github.com/WojciechMula/toys/blob/20cd93d83d7eeb8fe66258d2ac0be97e753ed5f6/pixconv16bpp-32bpp/pixconv16bpp-32bpp.c#L90-L94 Why tmp is uint8_t? its value is given by an uint32_t, which may lose information.

https://github.com/WojciechMula/toys/blob/20cd93d83d7eeb8fe66258d2ac0be97e753ed5f6/pixconv16bpp-32bpp/pixconv16bpp-32bpp.c#L95-L100 It doesn't make sense performing a shift of 16bit on an uint8_t.

I think tmp should be uint32_t.

Is that a bug?

WojciechMula commented 6 years ago

@XZiar it is a bug, thank you for spotting it

WojciechMula commented 6 years ago

Fixed, thanks a lot