From c635ac51cb8ca06865bbba0882f98b747c5f1825 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 13 Jul 2005 18:24:56 +0000 Subject: [PATCH] Fix a slight bug (causing possible miscoloring of parts of the titlebar) 2005-07-13 Elijah Newren Fix a slight bug (causing possible miscoloring of parts of the titlebar) introduced by the patch from #169982. * src/gradient.c: (meta_gradient_create_interwoven): (meta_gradient_create_multi_vertical): bitshifting operators do not take precedence over typecasting, so make sure to use parentheses to get the right operation order. --- ChangeLog | 12 ++++++++++++ src/gradient.c | 18 +++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d23b86b5f..d5814205c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-07-13 Elijah Newren + + Fix a slight bug (causing possible miscoloring of parts of the + titlebar) introduced by the patch from #169982. + + * src/gradient.c: + (meta_gradient_create_interwoven): + (meta_gradient_create_multi_vertical): + + bitshifting operators do not take precedence over typecasting, so + make sure to use parentheses to get the right operation order. + 2005-07-12 Elijah Newren * configure.in: post-release version bump to 2.11.1 diff --git a/src/gradient.c b/src/gradient.c index 0b7443871..a28dff59b 100644 --- a/src/gradient.c +++ b/src/gradient.c @@ -198,15 +198,15 @@ meta_gradient_create_interwoven (int width, if (k == 0) { - ptr[0] = (unsigned char) r1>>16; - ptr[1] = (unsigned char) g1>>16; - ptr[2] = (unsigned char) b1>>16; + ptr[0] = (unsigned char) (r1>>16); + ptr[1] = (unsigned char) (g1>>16); + ptr[2] = (unsigned char) (b1>>16); } else { - ptr[0] = (unsigned char) r2>>16; - ptr[1] = (unsigned char) g2>>16; - ptr[2] = (unsigned char) b2>>16; + ptr[0] = (unsigned char) (r2>>16); + ptr[1] = (unsigned char) (g2>>16); + ptr[2] = (unsigned char) (b2>>16); } for (j=1; j <= width/2; j *= 2) @@ -589,9 +589,9 @@ meta_gradient_create_multi_vertical (int width, int height, { tmp = ptr; - ptr[0] = (unsigned char) r>>16; - ptr[1] = (unsigned char) g>>16; - ptr[2] = (unsigned char) b>>16; + ptr[0] = (unsigned char) (r>>16); + ptr[1] = (unsigned char) (g>>16); + ptr[2] = (unsigned char) (b>>16); for (x=1; x <= width/2; x *= 2) memcpy (&(ptr[x*3]), ptr, x*3);