Alexandre Julliard : wineps: Return the size directly from get_bbox to avoid compiler warnings.

Alexandre Julliard julliard at winehq.org
Mon Oct 21 14:58:25 CDT 2013


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 21 14:50:53 2013 +0200

wineps: Return the size directly from get_bbox to avoid compiler warnings.

---

 dlls/wineps.drv/download.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c
index f476843..e5b57f7 100644
--- a/dlls/wineps.drv/download.c
+++ b/dlls/wineps.drv/download.c
@@ -169,16 +169,15 @@ static BOOL is_room_for_font(PSDRV_PDEVICE *physDev)
  * the font size we'll get the data directly from the TrueType HEAD table rather
  * than using GetOutlineTextMetrics.
  */
-static BOOL get_bbox(HDC hdc, RECT *rc, UINT *emsize)
+static UINT get_bbox(HDC hdc, RECT *rc)
 {
     BYTE head[54]; /* the head table is 54 bytes long */
 
     if(GetFontData(hdc, MS_MAKE_TAG('h','e','a','d'), 0, head, sizeof(head)) == GDI_ERROR)
     {
         ERR("Can't retrieve head table\n");
-        return FALSE;
+        return 0;
     }
-    *emsize = GET_BE_WORD(head + 18); /* unitsPerEm */
     if(rc)
     {
         rc->left   = (signed short)GET_BE_WORD(head + 36); /* xMin */
@@ -186,7 +185,7 @@ static BOOL get_bbox(HDC hdc, RECT *rc, UINT *emsize)
         rc->right  = (signed short)GET_BE_WORD(head + 40); /* xMax */
         rc->top    = (signed short)GET_BE_WORD(head + 42); /* yMax */
     }
-    return TRUE;
+    return GET_BE_WORD(head + 18); /* unitsPerEm */
 }
 
 /****************************************************************************
@@ -231,7 +230,7 @@ static UINT calc_ppem_for_height(HDC hdc, LONG height)
 
     if(ascent + descent == 0) return height;
 
-    get_bbox(hdc, NULL, &emsize);
+    emsize = get_bbox(hdc, NULL);
 
     return MulDiv(emsize, height, ascent + descent);
 }
@@ -314,9 +313,9 @@ BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev, BOOL vertical)
 
     if(physDev->font.fontinfo.Download == NULL) {
         RECT bbox;
-        UINT emsize;
+        UINT emsize = get_bbox(dev->hdc, &bbox);
 
-        if (!get_bbox(dev->hdc, &bbox, &emsize)) {
+        if (!emsize) {
             HeapFree(GetProcessHeap(), 0, ps_name);
             HeapFree(GetProcessHeap(), 0, potm);
             return FALSE;




More information about the wine-cvs mailing list