From 7c06335f784587f414a0092b53eaccb11cb12421 Mon Sep 17 00:00:00 2001 From: "jband%netscape.com" Date: Tue, 15 May 2001 19:09:33 +0000 Subject: [PATCH] PRBool values should be members of the set {0,1}. r=sfraser sr=jst. see bug 80722 --- xpcom/reflect/xptcall/public/xptcall.h | 10 +++++----- xpcom/reflect/xptinfo/public/xptinfo.h | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/xpcom/reflect/xptcall/public/xptcall.h b/xpcom/reflect/xptcall/public/xptcall.h index 94d00bf2d975..7dc0dd840ec3 100644 --- a/xpcom/reflect/xptcall/public/xptcall.h +++ b/xpcom/reflect/xptcall/public/xptcall.h @@ -112,11 +112,11 @@ struct nsXPTCVariant : public nsXPTCMiniVariant void SetValIsArray() {flags |= VAL_IS_ARRAY;} void SetValIsDOMString() {flags |= VAL_IS_DOMSTR;} - PRBool IsPtrData() const {return (PRBool) (flags & PTR_IS_DATA);} - PRBool IsValAllocated() const {return (PRBool) (flags & VAL_IS_ALLOCD);} - PRBool IsValInterface() const {return (PRBool) (flags & VAL_IS_IFACE);} - PRBool IsValArray() const {return (PRBool) (flags & VAL_IS_ARRAY);} - PRBool IsValDOMString() const {return (PRBool) (flags & VAL_IS_DOMSTR);} + PRBool IsPtrData() const {return 0 != (flags & PTR_IS_DATA);} + PRBool IsValAllocated() const {return 0 != (flags & VAL_IS_ALLOCD);} + PRBool IsValInterface() const {return 0 != (flags & VAL_IS_IFACE);} + PRBool IsValArray() const {return 0 != (flags & VAL_IS_ARRAY);} + PRBool IsValDOMString() const {return 0 != (flags & VAL_IS_DOMSTR);} void Init(const nsXPTCMiniVariant& mv, const nsXPTType& t, PRUint8 f) { diff --git a/xpcom/reflect/xptinfo/public/xptinfo.h b/xpcom/reflect/xptinfo/public/xptinfo.h index d9dabf1194c2..7fd0a5e35df7 100644 --- a/xpcom/reflect/xptinfo/public/xptinfo.h +++ b/xpcom/reflect/xptinfo/public/xptinfo.h @@ -174,11 +174,11 @@ public: {*(XPTParamDescriptor*)this = desc;} - PRBool IsIn() const {return (PRBool) (XPT_PD_IS_IN(flags));} - PRBool IsOut() const {return (PRBool) (XPT_PD_IS_OUT(flags));} - PRBool IsRetval() const {return (PRBool) (XPT_PD_IS_RETVAL(flags));} - PRBool IsShared() const {return (PRBool) (XPT_PD_IS_SHARED(flags));} - PRBool IsDipper() const {return (PRBool) (XPT_PD_IS_DIPPER(flags));} + PRBool IsIn() const {return 0 != (XPT_PD_IS_IN(flags));} + PRBool IsOut() const {return 0 != (XPT_PD_IS_OUT(flags));} + PRBool IsRetval() const {return 0 != (XPT_PD_IS_RETVAL(flags));} + PRBool IsShared() const {return 0 != (XPT_PD_IS_SHARED(flags));} + PRBool IsDipper() const {return 0 != (XPT_PD_IS_DIPPER(flags));} const nsXPTType GetType() const {return type.prefix;} // NOTE: other activities on types are done via methods on nsIInterfaceInfo @@ -195,11 +195,11 @@ public: nsXPTMethodInfo(const XPTMethodDescriptor& desc) {*(XPTMethodDescriptor*)this = desc;} - PRBool IsGetter() const {return (PRBool) (XPT_MD_IS_GETTER(flags) );} - PRBool IsSetter() const {return (PRBool) (XPT_MD_IS_SETTER(flags) );} - PRBool IsNotXPCOM() const {return (PRBool) (XPT_MD_IS_NOTXPCOM(flags));} - PRBool IsConstructor() const {return (PRBool) (XPT_MD_IS_CTOR(flags) );} - PRBool IsHidden() const {return (PRBool) (XPT_MD_IS_HIDDEN(flags) );} + PRBool IsGetter() const {return 0 != (XPT_MD_IS_GETTER(flags) );} + PRBool IsSetter() const {return 0 != (XPT_MD_IS_SETTER(flags) );} + PRBool IsNotXPCOM() const {return 0 != (XPT_MD_IS_NOTXPCOM(flags));} + PRBool IsConstructor() const {return 0 != (XPT_MD_IS_CTOR(flags) );} + PRBool IsHidden() const {return 0 != (XPT_MD_IS_HIDDEN(flags) );} const char* GetName() const {return name;} uint8 GetParamCount() const {return num_args;} /* idx was index before I got _sick_ of the warnings on Unix, sorry jband */