diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-06-19 01:12:26 +0200 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2019-06-19 01:12:26 +0200 |
commit | 8205db4254b4dfba3ecc0cd800e334bdf430b3e3 (patch) | |
tree | 0f6f87b53fdcfa11e70c4e5bcd3643bdff663df0 /nx-X11/programs/Xserver | |
parent | cb508b2632f661e19b44f1375ddce3ffb415f4c5 (diff) | |
download | nx-libs-8205db4254b4dfba3ecc0cd800e334bdf430b3e3.tar.gz nx-libs-8205db4254b4dfba3ecc0cd800e334bdf430b3e3.tar.bz2 nx-libs-8205db4254b4dfba3ecc0cd800e334bdf430b3e3.zip |
Font.c: code simplifications
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Font.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index c135adb72..fb441d431 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -369,18 +369,16 @@ static void nxagentFreeRemoteFontList(nxagentFontList *listRec) Bool nxagentFontFind(const char *name, int *pos) { - int low,high,res,iter,lpos; - if (!nxagentRemoteFontList.length) { *pos=0; return False; } - low = 0; - high = nxagentRemoteFontList.length - 1; - iter = 0; - res = 1; - lpos = nxagentRemoteFontList.length; + int low = 0; + int high = nxagentRemoteFontList.length - 1; + int iter = 0; + int res = 1; + int lpos = nxagentRemoteFontList.length; while (low <= high) { *pos = (high + low)/2; @@ -416,18 +414,15 @@ Bool nxagentFontFind(const char *name, int *pos) Bool nxagentFontLookUp(const char *name) { int i; - int result; - - char *scalable; if (name != NULL && strlen(name) == 0) { return 0; } - result = nxagentFontFind(name, &i); + int result = nxagentFontFind(name, &i); - scalable = NULL; + char *scalable = NULL; /* * Let's try with the scalable font description. @@ -435,9 +430,7 @@ Bool nxagentFontLookUp(const char *name) if (result == 0) { - scalable = nxagentMakeScalableFontName(name, 0); - - if (scalable != NULL) + if ((scalable = nxagentMakeScalableFontName(name, 0)) != NULL) { result = nxagentFontFind(scalable, &i); @@ -451,9 +444,7 @@ Bool nxagentFontLookUp(const char *name) if (result == 0) { - scalable = nxagentMakeScalableFontName(name, 1); - - if (scalable != NULL) + if ((scalable = nxagentMakeScalableFontName(name, 1)) != NULL) { result = nxagentFontFind(scalable, &i); @@ -888,7 +879,6 @@ static void nxagentFontDisconnect(FontPtr pFont, XID param1, void * param2) static void nxagentCollectFailedFont(FontPtr fpt, XID id) { - if (nxagentFailedToReconnectFonts.font == NULL) { nxagentFailedToReconnectFonts.size = 8; @@ -1632,7 +1622,6 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo int nxagentFreeFont(XFontStruct *fs) { - if (fs -> per_char) { #ifdef USE_XF86BIGFONT |