aboutsummaryrefslogtreecommitdiff
path: root/sixel.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-06-06 11:52:09 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-06-06 11:52:09 +0000
commita08e7f358faac7bc41d869a1b2ee2e5869884e44 (patch)
treea9473f8c8b6c91b20b1a0ad8730bd3eb5108e5b3 /sixel.c
parentPKGBUILD: works on aarch64 too (diff)
sixel: fix asan runtime warning: left shift of 255 by 24 cannot...
be represented in type 'int'
Diffstat (limited to 'sixel.c')
-rw-r--r--sixel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sixel.c b/sixel.c
index 2d33cf99..afac727b 100644
--- a/sixel.c
+++ b/sixel.c
@@ -31,7 +31,7 @@ sixel_init(struct terminal *term)
term->sixel.image.height = 6;
for (size_t i = 0; i < 1 * 6; i++)
- term->sixel.image.data[i] = term->colors.alpha / 256 << 24 | term->colors.bg;
+ term->sixel.image.data[i] = term->colors.alpha / 256u << 24 | term->colors.bg;
count = 0;
@@ -220,7 +220,7 @@ resize(struct terminal *term, int new_width, int new_height)
memcpy(&new_data[r * new_width], &old_data[r * old_width], old_width * sizeof(uint32_t));
for (int c = old_width; c < new_width; c++)
- new_data[r * new_width + c] = term->colors.alpha / 256 << 24 | term->colors.bg;
+ new_data[r * new_width + c] = term->colors.alpha / 256u << 24 | term->colors.bg;
}
free(old_data);
}
@@ -228,7 +228,7 @@ resize(struct terminal *term, int new_width, int new_height)
/* Initialize new rows to background color */
for (int r = old_height; r < new_height; r++) {
for (int c = 0; c < new_width; c++)
- new_data[r * new_width + c] = term->colors.alpha / 256 << 24 | term->colors.bg;
+ new_data[r * new_width + c] = term->colors.alpha / 256u << 24 | term->colors.bg;
}
assert(new_data != NULL);
@@ -269,7 +269,7 @@ sixel_add(struct terminal *term, uint32_t color, uint8_t sixel)
size_t pixel_row = term->sixel.pos.row * 6 + i;
size_t stride = term->sixel.image.width;
size_t idx = pixel_row * stride + term->sixel.pos.col;
- term->sixel.image.data[idx] = term->colors.alpha / 256 << 24 | color;
+ term->sixel.image.data[idx] = term->colors.alpha / 256u << 24 | color;
}
}