Bug 1444129, part 7 - Rename fields of XPTMethodDescriptor. r=njn draft
authorAndrew McCreight <continuation@gmail.com>
Wed, 07 Mar 2018 15:22:35 -0800
changeset 765078 0f44b0be8d09b210b9ed952c81cca7b71b224251
parent 765077 40beda1ab8c028e2145c4d7bfffa4b9d5d22cfc3
push id101960
push userbmo:continuation@gmail.com
push dateThu, 08 Mar 2018 23:46:50 +0000
reviewersnjn
bugs1444129
milestone60.0a1
Bug 1444129, part 7 - Rename fields of XPTMethodDescriptor. r=njn MozReview-Commit-ID: IwOCyKOY4mR
xpcom/reflect/xptinfo/xptinfo.h
xpcom/typelib/xpt/xpt_struct.cpp
xpcom/typelib/xpt/xpt_struct.h
--- a/xpcom/reflect/xptinfo/xptinfo.h
+++ b/xpcom/reflect/xptinfo/xptinfo.h
@@ -183,27 +183,27 @@ private:
 
 class nsXPTMethodInfo : public XPTMethodDescriptor
 {
 // NO DATA - this a flyweight wrapper
 public:
     MOZ_IMPLICIT nsXPTMethodInfo(const XPTMethodDescriptor& desc)
         {*(XPTMethodDescriptor*)this = desc;}
 
-    bool IsGetter() const {return !!(flags & kGetterMask);}
-    bool IsSetter() const {return !!(flags & kSetterMask);}
-    bool IsNotXPCOM() const {return !!(flags & kNotXPCOMMask);}
-    bool IsHidden() const {return !!(flags & kHiddenMask);}
-    bool WantsOptArgc() const {return !!(flags & kOptArgcMask);}
-    bool WantsContext() const {return !!(flags & kContextMask);}
-    const char* GetName() const {return name;}
-    uint8_t GetParamCount() const {return num_args;}
+    bool IsGetter() const { return !!(mFlags & kGetterMask); }
+    bool IsSetter() const { return !!(mFlags & kSetterMask); }
+    bool IsNotXPCOM() const { return !!(mFlags & kNotXPCOMMask); }
+    bool IsHidden() const { return !!(mFlags & kHiddenMask); }
+    bool WantsOptArgc() const { return !!(mFlags & kOptArgcMask); }
+    bool WantsContext() const { return !!(mFlags & kContextMask); }
+    const char* GetName() const { return mName; }
+    uint8_t GetParamCount() const { return mNumArgs; }
     const nsXPTParamInfo GetParam(uint8_t idx) const {
         MOZ_ASSERT(idx < GetParamCount(), "bad arg");
-        return params[idx];
+        return mParams[idx];
     }
 
 private:
     static const uint8_t kGetterMask =   0x80;
     static const uint8_t kSetterMask =   0x40;
     static const uint8_t kNotXPCOMMask = 0x20;
     static const uint8_t kHiddenMask =   0x08;
     static const uint8_t kOptArgcMask =  0x04;
--- a/xpcom/typelib/xpt/xpt_struct.cpp
+++ b/xpcom/typelib/xpt/xpt_struct.cpp
@@ -343,36 +343,36 @@ DoConstDescriptor(XPTArena *arena, NotNu
 }
 
 bool
 DoMethodDescriptor(XPTArena *arena, NotNull<XPTCursor*> cursor,
                    XPTMethodDescriptor *md, XPTInterfaceDescriptor *id)
 {
     int i;
 
-    if (!XPT_Do8(cursor, &md->flags) ||
-        !XPT_DoCString(arena, cursor, &md->name) ||
-        !XPT_Do8(cursor, &md->num_args))
+    if (!XPT_Do8(cursor, &md->mFlags) ||
+        !XPT_DoCString(arena, cursor, &md->mName) ||
+        !XPT_Do8(cursor, &md->mNumArgs))
         return false;
 
     XPTParamDescriptor* params = nullptr;
 
-    if (md->num_args) {
-        size_t n = md->num_args * sizeof(XPTParamDescriptor);
+    if (md->mNumArgs) {
+        size_t n = md->mNumArgs * sizeof(XPTParamDescriptor);
         params = static_cast<XPTParamDescriptor*>(XPT_CALLOC8(arena, n));
         if (!params)
             return false;
     }
 
-    for(i = 0; i < md->num_args; i++) {
+    for(i = 0; i < md->mNumArgs; i++) {
         if (!DoParamDescriptor(arena, cursor, &params[i], id))
             return false;
     }
 
-    md->params = params;
+    md->mParams = params;
 
     // |result| appears in the on-disk format but it isn't used,
     // because a method is either notxpcom, in which case it can't be
     // called from script so the XPT information is irrelevant, or the
     // result type is nsresult.
     XPTParamDescriptor result;
     if (!DoParamDescriptor(arena, cursor, &result, id))
         return false;
--- a/xpcom/typelib/xpt/xpt_struct.h
+++ b/xpcom/typelib/xpt/xpt_struct.h
@@ -261,16 +261,16 @@ struct XPTParamDescriptor {
   XPTTypeDescriptor mType;
 };
 
 /*
  * A MethodDescriptor is a variable-size record used to describe a single
  * interface method.
  */
 struct XPTMethodDescriptor {
-  const char* name;
-  const XPTParamDescriptor* params;
-  //XPTParamDescriptor result; // Present on disk, omitted here.
-  uint8_t flags;
-  uint8_t num_args;
+  const char* mName;
+  const XPTParamDescriptor* mParams;
+  //XPTParamDescriptor mResult; // Present on disk, omitted here.
+  uint8_t mFlags;
+  uint8_t mNumArgs;
 };
 
 #endif /* xpt_struct_h */