Andrew Talbot : usp10: Avoid signed-unsigned integer comparisons.

Alexandre Julliard julliard at winehq.org
Thu Feb 28 15:49:47 CST 2013


Module: wine
Branch: master
Commit: 4ef6a9689051f4d4d6260fcdf431db99f530878b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4ef6a9689051f4d4d6260fcdf431db99f530878b

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Wed Feb 27 21:13:06 2013 +0000

usp10: Avoid signed-unsigned integer comparisons.

---

 dlls/usp10/bidi.c  |    3 ++-
 dlls/usp10/usp10.c |   24 +++++++++++++-----------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/dlls/usp10/bidi.c b/dlls/usp10/bidi.c
index 3b1823f..74ca70b 100644
--- a/dlls/usp10/bidi.c
+++ b/dlls/usp10/bidi.c
@@ -749,7 +749,8 @@ BOOL BIDI_DetermineLevels(
     )
 {
     WORD *chartype;
-    unsigned baselevel = 0,j;
+    unsigned baselevel = 0;
+    INT j;
     TRACE("%s, %d\n", debugstr_wn(lpString, uCount), uCount);
 
     chartype = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(WORD));
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 5287556..bc48ecd 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -1017,13 +1017,14 @@ HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
     if (psc && *psc)
     {
         unsigned int i;
+        INT n;
         for (i = 0; i < GLYPH_MAX / GLYPH_BLOCK_SIZE; i++)
         {
             heap_free(((ScriptCache *)*psc)->widths[i]);
         }
         for (i = 0; i < 0x10; i++)
         {
-            int j;
+            unsigned int j;
             if (((ScriptCache *)*psc)->page[i])
                 for (j = 0; j < GLYPH_MAX / GLYPH_BLOCK_SIZE; j++)
                     heap_free(((ScriptCache *)*psc)->page[i]->glyphs[j]);
@@ -1033,20 +1034,20 @@ HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
         heap_free(((ScriptCache *)*psc)->GDEF_Table);
         heap_free(((ScriptCache *)*psc)->CMAP_Table);
         heap_free(((ScriptCache *)*psc)->GPOS_Table);
-        for (i = 0; i < ((ScriptCache *)*psc)->script_count; i++)
+        for (n = 0; n < ((ScriptCache *)*psc)->script_count; n++)
         {
             int j;
-            for (j = 0; j < ((ScriptCache *)*psc)->scripts[i].language_count; j++)
+            for (j = 0; j < ((ScriptCache *)*psc)->scripts[n].language_count; j++)
             {
                 int k;
-                for (k = 0; k < ((ScriptCache *)*psc)->scripts[i].languages[j].feature_count; k++)
-                    heap_free(((ScriptCache *)*psc)->scripts[i].languages[j].features[k].lookups);
-                heap_free(((ScriptCache *)*psc)->scripts[i].languages[j].features);
+                for (k = 0; k < ((ScriptCache *)*psc)->scripts[n].languages[j].feature_count; k++)
+                    heap_free(((ScriptCache *)*psc)->scripts[n].languages[j].features[k].lookups);
+                heap_free(((ScriptCache *)*psc)->scripts[n].languages[j].features);
             }
-            for (j = 0; j < ((ScriptCache *)*psc)->scripts[i].default_language.feature_count; j++)
-                heap_free(((ScriptCache *)*psc)->scripts[i].default_language.features[j].lookups);
-            heap_free(((ScriptCache *)*psc)->scripts[i].default_language.features);
-            heap_free(((ScriptCache *)*psc)->scripts[i].languages);
+            for (j = 0; j < ((ScriptCache *)*psc)->scripts[n].default_language.feature_count; j++)
+                heap_free(((ScriptCache *)*psc)->scripts[n].default_language.features[j].lookups);
+            heap_free(((ScriptCache *)*psc)->scripts[n].default_language.features);
+            heap_free(((ScriptCache *)*psc)->scripts[n].languages);
         }
         heap_free(((ScriptCache *)*psc)->scripts);
         heap_free(((ScriptCache *)*psc)->otm);
@@ -2843,7 +2844,8 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc,
                                     SCRIPT_GLYPHPROP *pOutGlyphProps, int *pcGlyphs)
 {
     HRESULT hr;
-    unsigned int i,g;
+    int i;
+    unsigned int g;
     BOOL rtl;
     int cluster;
 




More information about the wine-cvs mailing list