mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
xbm/parse: use uint32 instead of int for << 24
This commit is contained in:
parent
2a17df0f8b
commit
fc2754ac89
1 changed files with 5 additions and 6 deletions
|
|
@ -19,12 +19,11 @@ static unsigned char defaultcolor[] = { 255, 255, 255, 255 };
|
||||||
|
|
||||||
static uint32_t u32(unsigned char *rgba)
|
static uint32_t u32(unsigned char *rgba)
|
||||||
{
|
{
|
||||||
uint32_t ret = 0;
|
uint32_t r[4] = { 0 };
|
||||||
ret |= (rgba[3] & 0xff) << 24;
|
for (int i = 0; i < 4; i++)
|
||||||
ret |= (rgba[2] & 0xff) << 16;
|
r[i] = rgba[i];
|
||||||
ret |= (rgba[1] & 0xff) << 8;
|
return ((r[3] & 0xff) << 24) | ((r[2] & 0xff) << 16) |
|
||||||
ret |= (rgba[0] & 0xff);
|
((r[1] & 0xff) << 8) | (r[0] & 0xff);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void process_bytes(struct pixmap *pixmap, struct token *tokens)
|
static void process_bytes(struct pixmap *pixmap, struct token *tokens)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue