mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Comment endianness
This commit is contained in:
parent
5a13cb0ed1
commit
a87a5dbdd5
1 changed files with 2 additions and 2 deletions
|
@ -10,13 +10,13 @@
|
||||||
|
|
||||||
void cairo_set_source_u32(cairo_t *cairo, uint32_t color) {
|
void cairo_set_source_u32(cairo_t *cairo, uint32_t color) {
|
||||||
int endian = 1;
|
int endian = 1;
|
||||||
if (*(char *)&endian == 1) {
|
if (*(char *)&endian == 1) { // little endian
|
||||||
cairo_set_source_rgba(cairo,
|
cairo_set_source_rgba(cairo,
|
||||||
(color >> (1*8) & 0xFF) / 255.0,
|
(color >> (1*8) & 0xFF) / 255.0,
|
||||||
(color >> (2*8) & 0xFF) / 255.0,
|
(color >> (2*8) & 0xFF) / 255.0,
|
||||||
(color >> (3*8) & 0xFF) / 255.0,
|
(color >> (3*8) & 0xFF) / 255.0,
|
||||||
(color >> (0*8) & 0xFF) / 255.0);
|
(color >> (0*8) & 0xFF) / 255.0);
|
||||||
} else {
|
} else { // big endian
|
||||||
cairo_set_source_rgba(cairo,
|
cairo_set_source_rgba(cairo,
|
||||||
(color >> (0*8) & 0xFF) / 255.0,
|
(color >> (0*8) & 0xFF) / 255.0,
|
||||||
(color >> (3*8) & 0xFF) / 255.0,
|
(color >> (3*8) & 0xFF) / 255.0,
|
||||||
|
|
Loading…
Reference in a new issue