From e4d792bba44daa3b290c78bdb74c41383e90ebee Mon Sep 17 00:00:00 2001 From: "jband%netscape.com" Date: Thu, 2 Sep 1999 00:01:08 +0000 Subject: [PATCH] fix for bug 12237 - add a flag in typelib to indicate methods thatare not xpcom compliant. Stealing bit that was originally intended for varargs --- xpcom/reflect/xptinfo/public/xptinfo.h | 2 +- xpcom/typelib/xpidl/xpidl_typelib.c | 6 +++++- xpcom/typelib/xpt/public/xpt_struct.h | 6 +++--- xpcom/typelib/xpt/tools/xpt_dump.c | 6 +++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/xpcom/reflect/xptinfo/public/xptinfo.h b/xpcom/reflect/xptinfo/public/xptinfo.h index ceb5bd4d4139..34d692cb93a4 100644 --- a/xpcom/reflect/xptinfo/public/xptinfo.h +++ b/xpcom/reflect/xptinfo/public/xptinfo.h @@ -167,7 +167,7 @@ public: PRBool IsGetter() const {return (PRBool) (XPT_MD_IS_GETTER(flags) );} PRBool IsSetter() const {return (PRBool) (XPT_MD_IS_SETTER(flags) );} - PRBool IsVarArgs() const {return (PRBool) (XPT_MD_IS_VARARGS(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) );} const char* GetName() const {return name;} diff --git a/xpcom/typelib/xpidl/xpidl_typelib.c b/xpcom/typelib/xpidl/xpidl_typelib.c index 32657a8e69c9..f4d78ca9b1bc 100644 --- a/xpcom/typelib/xpidl/xpidl_typelib.c +++ b/xpcom/typelib/xpidl/xpidl_typelib.c @@ -877,10 +877,14 @@ typelib_op_dcl(TreeState *state) if (op->op_type_spec && !op_notxpcom) num_args++; /* fake param for _retval */ - if (op_noscript || op_notxpcom) + if (op_noscript) op_flags |= XPT_MD_HIDDEN; + if (op_notxpcom) + op_flags |= XPT_MD_NOTXPCOM; +/* if (op->f_varargs) op_flags |= XPT_MD_VARARGS; +*/ /* XXXshaver constructor? */ #ifdef DEBUG_shaver_method diff --git a/xpcom/typelib/xpt/public/xpt_struct.h b/xpcom/typelib/xpt/public/xpt_struct.h index 2b96a7128c5d..5bd4a2df832b 100644 --- a/xpcom/typelib/xpt/public/xpt_struct.h +++ b/xpcom/typelib/xpt/public/xpt_struct.h @@ -239,7 +239,7 @@ XPT_NewStringZ(char *bytes); * InterfaceIsTypeDescriptor. */ -/* XXX why bother with a struct? */ +/* why bother with a struct? - other code relies on this being a struct */ struct XPTTypeDescriptorPrefix { PRUint8 flags; }; @@ -382,14 +382,14 @@ struct XPTMethodDescriptor { /* flag bits -- jband and fur were right, and I was miserably wrong */ #define XPT_MD_GETTER 0x80 #define XPT_MD_SETTER 0x40 -#define XPT_MD_VARARGS 0x20 +#define XPT_MD_NOTXPCOM 0x20 #define XPT_MD_CTOR 0x10 #define XPT_MD_HIDDEN 0x08 #define XPT_MD_FLAGMASK 0xf8 #define XPT_MD_IS_GETTER(flags) (flags & XPT_MD_GETTER) #define XPT_MD_IS_SETTER(flags) (flags & XPT_MD_SETTER) -#define XPT_MD_IS_VARARGS(flags) (flags & XPT_MD_VARARGS) +#define XPT_MD_IS_NOTXPCOM(flags) (flags & XPT_MD_NOTXPCOM) #define XPT_MD_IS_CTOR(flags) (flags & XPT_MD_CTOR) #define XPT_MD_IS_HIDDEN(flags) (flags & XPT_MD_HIDDEN) diff --git a/xpcom/typelib/xpt/tools/xpt_dump.c b/xpcom/typelib/xpt/tools/xpt_dump.c index d0476416e45c..b0e7ca6865c4 100644 --- a/xpcom/typelib/xpt/tools/xpt_dump.c +++ b/xpcom/typelib/xpt/tools/xpt_dump.c @@ -534,8 +534,8 @@ XPT_DumpMethodDescriptor(XPTHeader *header, XPTMethodDescriptor *md, else fprintf(stdout, "FALSE\n"); - fprintf(stdout, "%*sIs Varargs? ", indent, " "); - if (XPT_MD_IS_VARARGS(md->flags)) + fprintf(stdout, "%*sIs NotXPCOM? ", indent, " "); + if (XPT_MD_IS_NOTXPCOM(md->flags)) fprintf(stdout, "TRUE\n"); else fprintf(stdout, "FALSE\n"); @@ -579,7 +579,7 @@ XPT_DumpMethodDescriptor(XPTHeader *header, XPTMethodDescriptor *md, XPT_MD_IS_GETTER(md->flags) ? 'G' : ' ', XPT_MD_IS_SETTER(md->flags) ? 'S' : ' ', XPT_MD_IS_HIDDEN(md->flags) ? 'H' : ' ', - XPT_MD_IS_VARARGS(md->flags) ? 'V' : ' ', + XPT_MD_IS_NOTXPCOM(md->flags) ? 'N' : ' ', XPT_MD_IS_CTOR(md->flags) ? 'C' : ' ', param_type, md->name); for (i=0; inum_args; i++) {