From 8c77fad3400a97e890d79b7fe36cfd1f2796aafd Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sat, 11 Dec 2021 21:03:37 +0300 Subject: [PATCH] change char local vars to signed char this accomodates toolchains where char type is unsigned by default. --- qoi.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qoi.h b/qoi.h index bee6cfb..bbb0c8a 100644 --- a/qoi.h +++ b/qoi.h @@ -428,12 +428,12 @@ void *qoi_encode(const void *data, const qoi_desc *desc, int *out_len) { index[index_pos] = px; if (px.rgba.a == px_prev.rgba.a) { - char vr = px.rgba.r - px_prev.rgba.r; - char vg = px.rgba.g - px_prev.rgba.g; - char vb = px.rgba.b - px_prev.rgba.b; + signed char vr = px.rgba.r - px_prev.rgba.r; + signed char vg = px.rgba.g - px_prev.rgba.g; + signed char vb = px.rgba.b - px_prev.rgba.b; - char vg_r = vr - vg; - char vg_b = vb - vg; + signed char vg_r = vr - vg; + signed char vg_b = vb - vg; if ( vr > -3 && vr < 2 &&