Commit f4dc6491 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

oleaut32: Use BOOL type where appropriate.

parent eae8f4ed
...@@ -353,9 +353,9 @@ HRESULT WINAPI OleCreateFontIndirect( ...@@ -353,9 +353,9 @@ HRESULT WINAPI OleCreateFontIndirect(
fd.cySize.s.Hi = 0; fd.cySize.s.Hi = 0;
fd.sWeight = 0; fd.sWeight = 0;
fd.sCharset = 0; fd.sCharset = 0;
fd.fItalic = 0; fd.fItalic = FALSE;
fd.fUnderline = 0; fd.fUnderline = FALSE;
fd.fStrikethrough = 0; fd.fStrikethrough = FALSE;
lpFontDesc = &fd; lpFontDesc = &fd;
} }
......
...@@ -2407,7 +2407,7 @@ static void MSFT_GetTdesc(TLBContext *pcx, INT type, TYPEDESC *pTd) ...@@ -2407,7 +2407,7 @@ static void MSFT_GetTdesc(TLBContext *pcx, INT type, TYPEDESC *pTd)
TRACE_(typelib)("vt type = %X\n", pTd->vt); TRACE_(typelib)("vt type = %X\n", pTd->vt);
} }
static int TLB_is_propgetput(INVOKEKIND invkind) static BOOL TLB_is_propgetput(INVOKEKIND invkind)
{ {
return (invkind == INVOKE_PROPERTYGET || return (invkind == INVOKE_PROPERTYGET ||
invkind == INVOKE_PROPERTYPUT || invkind == INVOKE_PROPERTYPUT ||
...@@ -5428,7 +5428,8 @@ static HRESULT WINAPI ITypeLibComp_fnBind( ...@@ -5428,7 +5428,8 @@ static HRESULT WINAPI ITypeLibComp_fnBind(
BINDPTR * pBindPtr) BINDPTR * pBindPtr)
{ {
ITypeLibImpl *This = impl_from_ITypeComp(iface); ITypeLibImpl *This = impl_from_ITypeComp(iface);
int typemismatch=0, i; BOOL typemismatch = FALSE;
int i;
TRACE("(%p)->(%s, 0x%x, 0x%x, %p, %p, %p)\n", This, debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr); TRACE("(%p)->(%s, 0x%x, 0x%x, %p, %p, %p)\n", This, debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr);
...@@ -5469,7 +5470,7 @@ static HRESULT WINAPI ITypeLibComp_fnBind( ...@@ -5469,7 +5470,7 @@ static HRESULT WINAPI ITypeLibComp_fnBind(
return S_OK; return S_OK;
} }
else if (hr == TYPE_E_TYPEMISMATCH) else if (hr == TYPE_E_TYPEMISMATCH)
typemismatch = 1; typemismatch = TRUE;
} }
if ((pTypeInfo->typekind == TKIND_COCLASS) && if ((pTypeInfo->typekind == TKIND_COCLASS) &&
...@@ -5540,7 +5541,7 @@ static HRESULT WINAPI ITypeLibComp_fnBind( ...@@ -5540,7 +5541,7 @@ static HRESULT WINAPI ITypeLibComp_fnBind(
return S_OK; return S_OK;
} }
else if (hr == TYPE_E_TYPEMISMATCH) else if (hr == TYPE_E_TYPEMISMATCH)
typemismatch = 1; typemismatch = TRUE;
} }
} }
......
...@@ -4682,10 +4682,10 @@ static unsigned char VARIANT_int_divbychar(DWORD * p, unsigned int n, unsigned c ...@@ -4682,10 +4682,10 @@ static unsigned char VARIANT_int_divbychar(DWORD * p, unsigned int n, unsigned c
} }
/* check to test if encoded number is a zero. Returns 1 if zero, 0 for nonzero */ /* check to test if encoded number is a zero. Returns 1 if zero, 0 for nonzero */
static int VARIANT_int_iszero(const DWORD * p, unsigned int n) static BOOL VARIANT_int_iszero(const DWORD * p, unsigned int n)
{ {
for (; n > 0; n--) if (*p++ != 0) return 0; for (; n > 0; n--) if (*p++ != 0) return FALSE;
return 1; return TRUE;
} }
/* multiply two DECIMALS, without changing either one, and place result in third /* multiply two DECIMALS, without changing either one, and place result in third
...@@ -4695,7 +4695,7 @@ static int VARIANT_int_iszero(const DWORD * p, unsigned int n) ...@@ -4695,7 +4695,7 @@ static int VARIANT_int_iszero(const DWORD * p, unsigned int n)
*/ */
static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI * result) static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI * result)
{ {
int r_overflow = 0; BOOL r_overflow = FALSE;
DWORD running[6]; DWORD running[6];
signed int mulstart; signed int mulstart;
...@@ -4786,12 +4786,12 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI ...@@ -4786,12 +4786,12 @@ static int VARIANT_DI_mul(const VARIANT_DI * a, const VARIANT_DI * b, VARIANT_DI
} }
/* cast DECIMAL into string. Any scale should be handled properly. en_US locale is /* cast DECIMAL into string. Any scale should be handled properly. en_US locale is
hardcoded (period for decimal separator, dash as negative sign). Returns 0 for hardcoded (period for decimal separator, dash as negative sign). Returns TRUE for
success, nonzero if insufficient space in output buffer. success, FALSE if insufficient space in output buffer.
*/ */
static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n) static BOOL VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n)
{ {
int overflow = 0; BOOL overflow = FALSE;
DWORD quotient[3]; DWORD quotient[3];
unsigned char remainder; unsigned char remainder;
unsigned int i; unsigned int i;
...@@ -4802,7 +4802,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n) ...@@ -4802,7 +4802,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n)
*s++ = '-'; *s++ = '-';
n--; n--;
} }
else overflow = 1; else overflow = TRUE;
} }
/* prepare initial 0 */ /* prepare initial 0 */
...@@ -4810,7 +4810,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n) ...@@ -4810,7 +4810,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n)
if (n >= 2) { if (n >= 2) {
s[0] = '0'; s[0] = '0';
s[1] = '\0'; s[1] = '\0';
} else overflow = 1; } else overflow = TRUE;
} }
i = 0; i = 0;
...@@ -4818,7 +4818,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n) ...@@ -4818,7 +4818,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n)
while (!overflow && !VARIANT_int_iszero(quotient, sizeof(quotient) / sizeof(DWORD))) { while (!overflow && !VARIANT_int_iszero(quotient, sizeof(quotient) / sizeof(DWORD))) {
remainder = VARIANT_int_divbychar(quotient, sizeof(quotient) / sizeof(DWORD), 10); remainder = VARIANT_int_divbychar(quotient, sizeof(quotient) / sizeof(DWORD), 10);
if (i + 2 > n) { if (i + 2 > n) {
overflow = 1; overflow = TRUE;
} else { } else {
s[i++] = '0' + remainder; s[i++] = '0' + remainder;
s[i] = '\0'; s[i] = '\0';
...@@ -4839,7 +4839,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n) ...@@ -4839,7 +4839,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n)
if (i <= a->scale) { if (i <= a->scale) {
unsigned int numzeroes = a->scale + 1 - i; unsigned int numzeroes = a->scale + 1 - i;
if (i + 1 + numzeroes >= n) { if (i + 1 + numzeroes >= n) {
overflow = 1; overflow = TRUE;
} else { } else {
memmove(s + numzeroes, s, (i + 1) * sizeof(WCHAR)); memmove(s + numzeroes, s, (i + 1) * sizeof(WCHAR));
i += numzeroes; i += numzeroes;
...@@ -4853,7 +4853,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n) ...@@ -4853,7 +4853,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n)
if (a->scale > 0) { if (a->scale > 0) {
unsigned int periodpos = i - a->scale; unsigned int periodpos = i - a->scale;
if (i + 2 >= n) { if (i + 2 >= n) {
overflow = 1; overflow = TRUE;
} else { } else {
memmove(s + periodpos + 1, s + periodpos, (i + 1 - periodpos) * sizeof(WCHAR)); memmove(s + periodpos + 1, s + periodpos, (i + 1 - periodpos) * sizeof(WCHAR));
s[periodpos] = '.'; i++; s[periodpos] = '.'; i++;
...@@ -4865,7 +4865,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n) ...@@ -4865,7 +4865,7 @@ static int VARIANT_DI_tostringW(const VARIANT_DI * a, WCHAR * s, unsigned int n)
} }
} }
return overflow; return !overflow;
} }
/* shift the bits of a DWORD array to the left. p[0] is assumed LSB */ /* shift the bits of a DWORD array to the left. p[0] is assumed LSB */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment