freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master c653b8d 1/2: * src/smooth/ftgrays.c (FT_GRAY_SET): Ad


From: Werner Lemberg
Subject: [freetype2] master c653b8d 1/2: * src/smooth/ftgrays.c (FT_GRAY_SET): Adjust for better code.
Date: Wed, 12 May 2021 17:25:41 -0400 (EDT)

branch: master
commit c653b8d2f14a4bf4ca967b976c64aa0fb2bdfd0f
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/smooth/ftgrays.c (FT_GRAY_SET): Adjust for better code.
---
 ChangeLog            |  6 +++++-
 src/smooth/ftgrays.c | 31 +++++++++++++++----------------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d482631..679327a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-2021-05-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
+2021-05-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * src/smooth/ftgrays.c (FT_GRAY_SET): Adjust for better code.
+
+2021-05-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
        [smooth] Faster bitmap sweeping.
 
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index a40877e..c29f4bf 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -409,22 +409,21 @@ typedef ptrdiff_t  FT_PtrDist;
 
   /* It is faster to write small spans byte-by-byte than calling     */
   /* `memset'.  This is mainly due to the cost of the function call. */
-#define FT_GRAY_SET( d, s, count )           \
-  FT_BEGIN_STMNT                             \
-    unsigned char* q = d;                    \
-    unsigned char  c = (unsigned char)s;     \
-    switch ( count )                         \
-    {                                        \
-      case 7: *q++ = c; /* fall through */   \
-      case 6: *q++ = c; /* fall through */   \
-      case 5: *q++ = c; /* fall through */   \
-      case 4: *q++ = c; /* fall through */   \
-      case 3: *q++ = c; /* fall through */   \
-      case 2: *q++ = c; /* fall through */   \
-      case 1: *q   = c; /* fall through */   \
-      case 0: break;                         \
-      default: FT_MEM_SET( d, s, count );    \
-    }                                        \
+#define FT_GRAY_SET( d, s, count )                          \
+  FT_BEGIN_STMNT                                            \
+    unsigned char* q = d;                                   \
+    switch ( count )                                        \
+    {                                                       \
+      case 7: *q++ = (unsigned char)s; /* fall through */   \
+      case 6: *q++ = (unsigned char)s; /* fall through */   \
+      case 5: *q++ = (unsigned char)s; /* fall through */   \
+      case 4: *q++ = (unsigned char)s; /* fall through */   \
+      case 3: *q++ = (unsigned char)s; /* fall through */   \
+      case 2: *q++ = (unsigned char)s; /* fall through */   \
+      case 1: *q   = (unsigned char)s; /* fall through */   \
+      case 0: break;                                        \
+      default: FT_MEM_SET( d, s, count );                   \
+    }                                                       \
   FT_END_STMNT
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]