Bug 824885 - Fix -Wdeprecated-writable-strings warnings in xremote code. r=karlt.

This commit is contained in:
Nicholas Nethercote 2012-12-26 21:57:57 -08:00
parent 14f281aef8
commit 1c8d094c0f
3 changed files with 9 additions and 8 deletions

View File

@ -58,7 +58,7 @@ const unsigned char kRemoteVersion[] = "5.1";
#endif
// Minimize the roundtrips to the X server by getting all the atoms at once
static char *XAtomNames[] = {
static const char *XAtomNames[] = {
MOZILLA_VERSION_PROP,
MOZILLA_LOCK_PROP,
MOZILLA_COMMAND_PROP,
@ -277,8 +277,9 @@ nsXRemoteService::HandleCommand(char* aCommand, nsIDOMWindow* aWindow,
cmd, '\n',
&desktopStartupID);
char* argv[3] = {"dummyappname", "-remote", aCommand};
rv = cmdline->Init(3, argv, nullptr, nsICommandLine::STATE_REMOTE_EXPLICIT);
const char* argv[3] = {"dummyappname", "-remote", aCommand};
rv = cmdline->Init(3, const_cast<char**>(argv), nullptr,
nsICommandLine::STATE_REMOTE_EXPLICIT);
if (NS_FAILED(rv))
return "509 internal error";
@ -372,8 +373,8 @@ nsXRemoteService::EnsureAtoms(void)
if (sMozVersionAtom)
return;
XInternAtoms(mozilla::DefaultXDisplay(), XAtomNames, ArrayLength(XAtomNames),
False, XAtoms);
XInternAtoms(mozilla::DefaultXDisplay(), const_cast<char**>(XAtomNames),
ArrayLength(XAtomNames), False, XAtoms);
int i = 0;
sMozVersionAtom = XAtoms[i++];

View File

@ -80,7 +80,7 @@ XRemoteClient::~XRemoteClient()
}
// Minimize the roundtrips to the X-server
static char *XAtomNames[] = {
static const char *XAtomNames[] = {
MOZILLA_VERSION_PROP,
MOZILLA_LOCK_PROP,
MOZILLA_COMMAND_PROP,
@ -107,7 +107,8 @@ XRemoteClient::Init()
return NS_ERROR_FAILURE;
// get our atoms
XInternAtoms(mDisplay, XAtomNames, ARRAY_LENGTH(XAtomNames), False, XAtoms);
XInternAtoms(mDisplay, const_cast<char**>(XAtomNames),
ARRAY_LENGTH(XAtomNames), False, XAtoms);
int i = 0;
mMozVersionAtom = XAtoms[i++];

View File

@ -65,7 +65,6 @@ private:
Atom mMozUserAtom;
Atom mMozProfileAtom;
Atom mMozProgramAtom;
Atom mMozSupportsCLAtom;
char *mLockData;