From b88d9287df800a9753ec1b158be563bd15153516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Thu, 19 Sep 2019 18:49:29 +0300 Subject: [PATCH] sna/fb: Eliminate implicit fallthrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Duplicate a bit of code in FbDoLeftMaskByteRRop() switch statement to avoid the fall through. And while at it sort the cases based on the left byte and length. Makes the pattern matcher in my brain much happier. Signed-off-by: Ville Syrjälä --- src/sna/fb/fb.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sna/fb/fb.h b/src/sna/fb/fb.h index 90431747..ee5da97b 100644 --- a/src/sna/fb/fb.h +++ b/src/sna/fb/fb.h @@ -185,11 +185,13 @@ typedef int FbStride; FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ + case sizeof (FbBits) - 3: \ + FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ + FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \ + break; \ case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ - case sizeof (FbBits) - 3: \ - FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ case sizeof (FbBits) - 2: \ FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \ break; \