wineps.drv: Don't compare BOOL expressions with TRUE or FALSE
Frédéric Delanoy
frederic.delanoy at gmail.com
Mon Jan 27 16:57:37 CST 2014
---
dlls/wineps.drv/afm.c | 8 ++--
dlls/wineps.drv/init.c | 4 +-
dlls/wineps.drv/type1afm.c | 91 +++++++++++++++++++++-------------------------
3 files changed, 47 insertions(+), 56 deletions(-)
diff --git a/dlls/wineps.drv/afm.c b/dlls/wineps.drv/afm.c
index e07187e..7aed4f9 100644
--- a/dlls/wineps.drv/afm.c
+++ b/dlls/wineps.drv/afm.c
@@ -256,10 +256,10 @@ static BOOL AddBuiltinAFMs(void)
{
BOOL added;
- if (PSDRV_AddAFMtoList(&PSDRV_AFMFontList, *afm, &added) == FALSE)
+ if (!PSDRV_AddAFMtoList(&PSDRV_AFMFontList, *afm, &added))
return FALSE;
- if (added == FALSE)
+ if (!added)
TRACE("Ignoring built-in font %s\n", (*afm)->FontName);
++afm;
@@ -287,10 +287,10 @@ BOOL PSDRV_GetFontMetrics(void)
if (PSDRV_GlyphListInit() != 0)
return FALSE;
- if (PSDRV_GetType1Metrics() == FALSE)
+ if (!PSDRV_GetType1Metrics())
return FALSE;
- if (AddBuiltinAFMs() == FALSE)
+ if (!AddBuiltinAFMs())
return FALSE;
PSDRV_IndexGlyphList(); /* Enable fast searching of glyph names */
diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c
index ec98f04..e30dd32 100644
--- a/dlls/wineps.drv/init.c
+++ b/dlls/wineps.drv/init.c
@@ -126,7 +126,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
if (PSDRV_Heap == NULL)
return FALSE;
- if (PSDRV_GetFontMetrics() == FALSE) {
+ if (!PSDRV_GetFontMetrics()) {
HeapDestroy(PSDRV_Heap);
return FALSE;
}
@@ -794,7 +794,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
}
else {
BOOL added;
- if (PSDRV_AddAFMtoList(&pi->Fonts, afm, &added) == FALSE) {
+ if (!PSDRV_AddAFMtoList(&pi->Fonts, afm, &added)) {
PSDRV_FreeAFMList(pi->Fonts);
goto fail;
}
diff --git a/dlls/wineps.drv/type1afm.c b/dlls/wineps.drv/type1afm.c
index f9a8bcb..96ccb0d 100644
--- a/dlls/wineps.drv/type1afm.c
+++ b/dlls/wineps.drv/type1afm.c
@@ -163,7 +163,7 @@ static BOOL FindLine(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key)
BOOL ok;
ok = ReadLine(file, buffer, bufsize, &result);
- if (ok == FALSE)
+ if (!ok)
return FALSE;
if (result > 0 && strncmp(buffer, key, len) == 0)
@@ -228,7 +228,7 @@ static BOOL ReadFloat(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key,
CHAR *cp, *end_ptr;
double d;
- if (FindLine(file, buffer, bufsize, key) == FALSE)
+ if (!FindLine(file, buffer, bufsize, key))
return FALSE;
if (buffer[0] == '\0') /* line not found */
@@ -242,7 +242,7 @@ static BOOL ReadFloat(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key,
errno = 0;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0 || DoubleToFloat(p_ret, d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(p_ret, d))
{
WARN("Error parsing line '%s'\n", buffer);
*p_found = FALSE;
@@ -267,7 +267,7 @@ static BOOL ReadInt(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key,
FLOAT f;
retval = ReadFloat(file, buffer, bufsize, key, &f, p_found);
- if (retval == FALSE || *p_found == FALSE)
+ if (!retval || !*p_found)
{
*p_ret = 0;
return retval;
@@ -299,7 +299,7 @@ static BOOL ReadString(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key,
{
CHAR *cp;
- if (FindLine(file, buffer, bufsize, key) == FALSE)
+ if (!FindLine(file, buffer, bufsize, key))
return FALSE;
if (buffer[0] == '\0')
@@ -338,7 +338,7 @@ static BOOL ReadBBox(FILE *file, CHAR buffer[], INT bufsize, AFM *afm,
CHAR *cp, *end_ptr;
double d;
- if (FindLine(file, buffer, bufsize, "FontBBox") == FALSE)
+ if (!FindLine(file, buffer, bufsize, "FontBBox"))
return FALSE;
if (buffer[0] == '\0')
@@ -351,26 +351,22 @@ static BOOL ReadBBox(FILE *file, CHAR buffer[], INT bufsize, AFM *afm,
cp = buffer + sizeof("FontBBox");
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0 ||
- DoubleToFloat(&(afm->FontBBox.llx), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(afm->FontBBox.llx), d))
goto parse_error;
cp = end_ptr;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0 ||
- DoubleToFloat(&(afm->FontBBox.lly), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(afm->FontBBox.lly), d))
goto parse_error;
cp = end_ptr;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0
- || DoubleToFloat(&(afm->FontBBox.urx), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(afm->FontBBox.urx), d))
goto parse_error;
cp = end_ptr;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0
- || DoubleToFloat(&(afm->FontBBox.ury), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(afm->FontBBox.ury), d))
goto parse_error;
*p_found = TRUE;
@@ -415,7 +411,7 @@ static BOOL ReadWeight(FILE *file, CHAR buffer[], INT bufsize, AFM *afm,
CHAR *cp;
INT i;
- if (ReadString(file, buffer, bufsize, "Weight", &sz) == FALSE)
+ if (!ReadString(file, buffer, bufsize, "Weight", &sz))
return FALSE;
if (sz == NULL)
@@ -455,7 +451,7 @@ static BOOL ReadFixedPitch(FILE *file, CHAR buffer[], INT bufsize, AFM *afm,
{
LPSTR sz;
- if (ReadString(file, buffer, bufsize, "IsFixedPitch", &sz) == FALSE)
+ if (!ReadString(file, buffer, bufsize, "IsFixedPitch", &sz))
return FALSE;
if (sz == NULL)
@@ -505,40 +501,40 @@ static BOOL ReadFontMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM **p_afm)
return FALSE;
retval = ReadWeight(file, buffer, bufsize, afm, &found);
- if (retval == FALSE || found == FALSE)
+ if (!retval || !found)
goto cleanup_afm;
retval = ReadFloat(file, buffer, bufsize, "ItalicAngle",
&(afm->ItalicAngle), &found);
- if (retval == FALSE || found == FALSE)
+ if (!retval || !found)
goto cleanup_afm;
retval = ReadFixedPitch(file, buffer, bufsize, afm, &found);
- if (retval == FALSE || found == FALSE)
+ if (!retval || !found)
goto cleanup_afm;
retval = ReadBBox(file, buffer, bufsize, afm, &found);
- if (retval == FALSE || found == FALSE)
+ if (!retval || !found)
goto cleanup_afm;
retval = ReadFloat(file, buffer, bufsize, "UnderlinePosition",
&(afm->UnderlinePosition), &found);
- if (retval == FALSE || found == FALSE)
+ if (!retval || !found)
goto cleanup_afm;
retval = ReadFloat(file, buffer, bufsize, "UnderlineThickness",
&(afm->UnderlineThickness), &found);
- if (retval == FALSE || found == FALSE)
+ if (!retval || !found)
goto cleanup_afm;
retval = ReadFloat(file, buffer, bufsize, "Ascender", /* optional */
&(afm->Ascender), &found);
- if (retval == FALSE)
+ if (!retval)
goto cleanup_afm;
retval = ReadFloat(file, buffer, bufsize, "Descender", /* optional */
&(afm->Descender), &found);
- if (retval == FALSE)
+ if (!retval)
goto cleanup_afm;
afm->WinMetrics.usUnitsPerEm = 1000;
@@ -628,11 +624,10 @@ static BOOL ParseW(LPSTR sz, OLD_AFMMETRICS *metrics)
errno = 0;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0 ||
- DoubleToFloat(&(metrics->WX), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(metrics->WX), d))
goto parse_error;
- if (vector == FALSE)
+ if (!vector)
return TRUE;
/* Make sure that Y component of vector is zero */
@@ -669,26 +664,22 @@ static BOOL ParseB(LPSTR sz, OLD_AFMMETRICS *metrics)
cp = sz + 1;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0 ||
- DoubleToFloat(&(metrics->B.llx), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(metrics->B.llx), d))
goto parse_error;
cp = end_ptr;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0 ||
- DoubleToFloat(&(metrics->B.lly), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(metrics->B.lly), d))
goto parse_error;
cp = end_ptr;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0 ||
- DoubleToFloat(&(metrics->B.urx), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(metrics->B.urx), d))
goto parse_error;
cp = end_ptr;
d = strtod(cp, &end_ptr);
- if (end_ptr == cp || errno != 0 ||
- DoubleToFloat(&(metrics->B.ury), d) == FALSE)
+ if (end_ptr == cp || errno != 0 || !DoubleToFloat(&(metrics->B.ury), d))
goto parse_error;
return TRUE;
@@ -767,19 +758,19 @@ static BOOL ParseCharMetrics(LPSTR buffer, INT len, OLD_AFMMETRICS *metrics)
switch(*cp)
{
- case 'C': if (ParseC(cp, metrics) == FALSE)
+ case 'C': if (!ParseC(cp, metrics))
return FALSE;
break;
- case 'W': if (ParseW(cp, metrics) == FALSE)
+ case 'W': if (!ParseW(cp, metrics))
return FALSE;
break;
- case 'N': if (ParseN(cp, metrics) == FALSE)
+ case 'N': if (!ParseN(cp, metrics))
return FALSE;
break;
- case 'B': if (ParseB(cp, metrics) == FALSE)
+ case 'B': if (!ParseB(cp, metrics))
return FALSE;
break;
}
@@ -949,7 +940,7 @@ static BOOL ReadCharMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM *afm,
retval = ReadInt(file, buffer, bufsize, "StartCharMetrics",
&(afm->NumofMetrics), &found);
- if (retval == FALSE || found == FALSE)
+ if (!retval || !found)
{
*p_metrics = NULL;
return retval;
@@ -963,13 +954,13 @@ static BOOL ReadCharMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM *afm,
for (i = 0; i < afm->NumofMetrics; ++i)
{
retval = ReadLine(file, buffer, bufsize, &len);
- if (retval == FALSE)
+ if (!retval)
goto cleanup_old_metrics;
if(len > 0)
{
retval = ParseCharMetrics(buffer, len, old_metrics + i);
- if (retval == FALSE || old_metrics[i].C == INT_MAX)
+ if (!retval || old_metrics[i].C == INT_MAX)
goto cleanup_old_metrics;
continue;
@@ -1039,25 +1030,25 @@ static BOOL BuildAFM(FILE *file)
BOOL retval, added;
retval = ReadFontMetrics(file, buffer, sizeof(buffer), &afm);
- if (retval == FALSE || afm == NULL)
+ if (!retval || afm == NULL)
return retval;
retval = ReadString(file, buffer, sizeof(buffer), "FontName", &font_name);
- if (retval == FALSE || font_name == NULL)
+ if (!retval || font_name == NULL)
goto cleanup_afm;
retval = ReadString(file, buffer, sizeof(buffer), "FullName", &full_name);
- if (retval == FALSE || full_name == NULL)
+ if (!retval || full_name == NULL)
goto cleanup_font_name;
retval = ReadString(file, buffer, sizeof(buffer), "FamilyName",
&family_name);
- if (retval == FALSE || family_name == NULL)
+ if (!retval || family_name == NULL)
goto cleanup_full_name;
retval = ReadString(file, buffer, sizeof(buffer), "EncodingScheme",
&encoding_scheme);
- if (retval == FALSE || encoding_scheme == NULL)
+ if (!retval || encoding_scheme == NULL)
goto cleanup_family_name;
afm->FontName = font_name;
@@ -1066,11 +1057,11 @@ static BOOL BuildAFM(FILE *file)
afm->EncodingScheme = encoding_scheme;
retval = ReadCharMetrics(file, buffer, sizeof(buffer), afm, &metrics);
- if (retval == FALSE || metrics == FALSE)
+ if (!retval || metrics == NULL)
goto cleanup_encoding_scheme;
retval = PSDRV_AddAFMtoList(&PSDRV_AFMFontList, afm, &added);
- if (retval == FALSE || added == FALSE)
+ if (!retval || !added)
goto cleanup_encoding_scheme;
return TRUE;
@@ -1152,7 +1143,7 @@ static BOOL ReadAFMDir(LPCSTR dirname)
continue;
}
- if (ReadAFMFile(filename) == FALSE)
+ if (!ReadAFMFile(filename))
{
closedir(dir);
return FALSE;
--
1.8.5.2
More information about the wine-patches
mailing list