mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1054334 - Constify xpconnect's gNoString r=nbp
This commit is contained in:
parent
e9506a4b87
commit
875b3dcb01
@ -21,10 +21,12 @@ using namespace JS;
|
||||
NS_IMPL_CLASSINFO(nsJSID, nullptr, 0, NS_JS_ID_CID)
|
||||
NS_IMPL_ISUPPORTS_CI(nsJSID, nsIJSID)
|
||||
|
||||
char nsJSID::gNoString[] = "";
|
||||
const char nsJSID::gNoString[] = "";
|
||||
|
||||
nsJSID::nsJSID()
|
||||
: mID(GetInvalidIID()), mNumber(gNoString), mName(gNoString)
|
||||
: mID(GetInvalidIID()),
|
||||
mNumber(const_cast<char *>(gNoString)),
|
||||
mName(const_cast<char *>(gNoString))
|
||||
{
|
||||
}
|
||||
|
||||
@ -78,7 +80,7 @@ nsJSID::GetNumber(char * *aNumber)
|
||||
|
||||
if (!mNumber) {
|
||||
if (!(mNumber = mID.ToString()))
|
||||
mNumber = gNoString;
|
||||
mNumber = const_cast<char *>(gNoString);
|
||||
}
|
||||
|
||||
*aNumber = NS_strdup(mNumber);
|
||||
|
@ -2743,7 +2743,7 @@ public:
|
||||
bool InitWithName(const nsID& id, const char *nameString);
|
||||
bool SetName(const char* name);
|
||||
void SetNameToNoString()
|
||||
{MOZ_ASSERT(!mName, "name already set"); mName = gNoString;}
|
||||
{MOZ_ASSERT(!mName, "name already set"); mName = const_cast<char *>(gNoString);}
|
||||
bool NameIsSet() const {return nullptr != mName;}
|
||||
const nsID& ID() const {return mID;}
|
||||
bool IsValid() const {return !mID.Equals(GetInvalidIID());}
|
||||
@ -2758,7 +2758,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual ~nsJSID();
|
||||
static char gNoString[];
|
||||
static const char gNoString[];
|
||||
nsID mID;
|
||||
char* mNumber;
|
||||
char* mName;
|
||||
|
Loading…
Reference in New Issue
Block a user