Ensure that string literals are used as |const char*| rather than |char*|. r=jag sr=brendan b=107052

This commit is contained in:
dbaron@fas.harvard.edu
2001-11-07 06:24:10 +00:00
parent 31bfc73fe9
commit 1d843feacf
70 changed files with 200 additions and 194 deletions

View File

@@ -1531,7 +1531,7 @@ nsScriptSecurityManager::IsCapabilityEnabled(const char *capability,
#define PROPERTIES_URL "chrome://communicator/locale/security/security.properties"
nsresult
Localize(char *genericString, nsString &result)
Localize(const char *genericString, nsString &result)
{
nsresult ret;

View File

@@ -394,10 +394,10 @@ static void
StripCommentDelimiters(nsString& aCommentString)
{
PRInt32 offset;
static char* kCommentStart = "<!";
static char* kCommentEnd = "->";
static char* kCommentAlternateEnd = "--!>";
static char kMinus = '-';
static const char kCommentStart[] = "<!";
static const char kCommentEnd[] = "->";
static const char kCommentAlternateEnd[] = "--!>";
static const char kMinus = '-';
offset = aCommentString.Find(kCommentStart);
if (-1 != offset) {

View File

@@ -75,7 +75,7 @@ static NS_DEFINE_IID(kXULDocumentCID, NS_XULDOCUMENT_CID);
extern nsresult NS_NewDocumentViewer(nsIDocumentViewer** aResult);
static char* gHTMLTypes[] = {
static const char* const gHTMLTypes[] = {
"text/html",
"text/plain",
"text/css",
@@ -89,7 +89,7 @@ static char* gHTMLTypes[] = {
0
};
static char* gXMLTypes[] = {
static const char* const gXMLTypes[] = {
"text/xml",
"application/xml",
"application/xhtml+xml",
@@ -100,7 +100,7 @@ static char* gXMLTypes[] = {
};
static char* gRDFTypes[] = {
static const char* const gRDFTypes[] = {
"text/rdf",
"application/vnd.mozilla.xul+xml",
"mozilla.application/cached-xul",
@@ -109,7 +109,7 @@ static char* gRDFTypes[] = {
0
};
static char* gImageTypes[] = {
static const char* const gImageTypes[] = {
"image/gif",
"image/jpeg",
"image/jpg",
@@ -538,12 +538,12 @@ RegisterTypes(nsIComponentManager* aCompMgr,
nsIFile* aPath,
const char *aLocation,
const char *aType,
char** aTypes)
const char* const* aTypes)
{
nsresult rv = NS_OK;
while (*aTypes) {
char contractid[500];
char* contentType = *aTypes++;
const char* contentType = *aTypes++;
PR_snprintf(contractid, sizeof(contractid),
NS_DOCUMENT_LOADER_FACTORY_CONTRACTID_PREFIX "%s;1?type=%s",
aCommand, contentType);

View File

@@ -63,7 +63,7 @@
#include "nsIDOMKeyEvent.h"
#include "nsIDOMMutationEvent.h"
static char* mEventNames[] = {
static const char* const mEventNames[] = {
"mousedown", "mouseup", "click", "dblclick", "mouseover",
"mouseout", "mousemove", "contextmenu", "keydown", "keyup", "keypress",
"focus", "blur", "load", "unload", "abort", "error",

View File

@@ -4658,8 +4658,8 @@ HTMLContentSink::ProcessHTTPHeaders(nsIChannel* aChannel) {
if(aChannel) {
nsCOMPtr<nsIHttpChannel> httpchannel(do_QueryInterface(aChannel));
if (httpchannel) {
char* headers[]={"link","default-style","content-base",0}; // add more http headers if you need
char** name=headers;
const char *const headers[]={"link","default-style","content-base",0}; // add more http headers if you need
const char *const *name=headers;
nsXPIDLCString tmp;
while(*name) {

View File

@@ -481,7 +481,7 @@ nsHTMLFragmentContentSink::AddBaseTagInfo(nsIHTMLContent* aContent)
}
}
static char* kSentinelStr = "endnote";
static const char kSentinelStr[] = "endnote";
NS_IMETHODIMP
nsHTMLFragmentContentSink::OpenContainer(const nsIParserNode& aNode)

View File

@@ -78,9 +78,9 @@ public:
nsCString mPlatformHTMLBindingStr;
nsCString mUserHTMLBindingStr;
static char* sHTMLBindingStr;
static char* sPlatformHTMLBindingStr;
static char* sUserHTMLBindingStr;
static const char sHTMLBindingStr[];
static const char sPlatformHTMLBindingStr[];
static const char sUserHTMLBindingStr[];
PRBool mInitialized;
@@ -97,11 +97,11 @@ public:
nsXBLSpecialDocInfo() : mInitialized(PR_FALSE) {};
};
char* nsXBLSpecialDocInfo::sHTMLBindingStr = "resource:///res/builtin/htmlBindings.xml";
char* nsXBLSpecialDocInfo::sPlatformHTMLBindingStr = "resource:///res/builtin/platformHTMLBindings.xml";
const char nsXBLSpecialDocInfo::sHTMLBindingStr[] = "resource:///res/builtin/htmlBindings.xml";
const char nsXBLSpecialDocInfo::sPlatformHTMLBindingStr[] = "resource:///res/builtin/platformHTMLBindings.xml";
// Allow for a userHTMLBindings.xml.
// XXX Should be in the user profile directory, when we have a urlspec for that
char* nsXBLSpecialDocInfo::sUserHTMLBindingStr = "resource:///res/builtin/userHTMLBindings.xml";
const char nsXBLSpecialDocInfo::sUserHTMLBindingStr[] = "resource:///res/builtin/userHTMLBindings.xml";
void nsXBLSpecialDocInfo::LoadDocInfo()
{

View File

@@ -47,7 +47,7 @@ public:
NS_IMETHOD SetFocusedWindow(nsIDOMWindowInternal* aResult)=0;
NS_IMETHOD GetSuppressFocus(PRBool* aSuppressFlag)=0;
NS_IMETHOD SetSuppressFocus(PRBool aSuppressFlag, char* aReason)=0;
NS_IMETHOD SetSuppressFocus(PRBool aSuppressFlag, const char* aReason)=0;
NS_IMETHOD GetSuppressFocusScroll(PRBool* aSuppressFlag)=0;
NS_IMETHOD SetSuppressFocusScroll(PRBool aSuppressFlag)=0;

View File

@@ -410,7 +410,7 @@ nsFocusController::GetSuppressFocus(PRBool* aSuppressFocus)
}
NS_IMETHODIMP
nsFocusController::SetSuppressFocus(PRBool aSuppressFocus, char* aReason)
nsFocusController::SetSuppressFocus(PRBool aSuppressFocus, const char* aReason)
{
if(aSuppressFocus) {
++mSuppressFocus;

View File

@@ -57,7 +57,7 @@ public:
NS_IMETHOD SetFocusedWindow(nsIDOMWindowInternal* aResult);
NS_IMETHOD GetSuppressFocus(PRBool* aSuppressFlag);
NS_IMETHOD SetSuppressFocus(PRBool aSuppressFlag, char* aReason);
NS_IMETHOD SetSuppressFocus(PRBool aSuppressFlag, const char* aReason);
NS_IMETHOD GetSuppressFocusScroll(PRBool* aSuppressFlag);
NS_IMETHOD SetSuppressFocusScroll(PRBool aSuppressFlag);

View File

@@ -1303,8 +1303,8 @@ NS_IMETHODIMP nsHTMLEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste)
if (NS_FAILED(rv)) return rv;
// the flavors that we can deal with
char* textEditorFlavors[] = { kUnicodeMime, nsnull };
char* htmlEditorFlavors[] = { kJPEGImageMime, kHTMLMime, nsnull };
const char* const textEditorFlavors[] = { kUnicodeMime, nsnull };
const char* const htmlEditorFlavors[] = { kJPEGImageMime, kHTMLMime, nsnull };
nsCOMPtr<nsISupportsArray> flavorsList;
rv = nsComponentManager::CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, nsnull,
@@ -1315,7 +1315,7 @@ NS_IMETHODIMP nsHTMLEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste)
GetFlags(&editorFlags);
// add the flavors for all editors
for (char** flavor = textEditorFlavors; *flavor; flavor++)
for (const char* const* flavor = textEditorFlavors; *flavor; flavor++)
{
nsCOMPtr<nsISupportsString> flavorString;
nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull,
@@ -1330,7 +1330,9 @@ NS_IMETHODIMP nsHTMLEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPaste)
// add the HTML-editor only flavors
if ((editorFlags & eEditorPlaintextMask) == 0)
{
for (char** htmlFlavor = htmlEditorFlavors; *htmlFlavor; htmlFlavor++)
for (const char* const* htmlFlavor = htmlEditorFlavors;
*htmlFlavor;
htmlFlavor++)
{
nsCOMPtr<nsISupportsString> flavorString;
nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull,

View File

@@ -584,7 +584,7 @@ NS_IMETHODIMP nsPlaintextEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPa
if (NS_FAILED(rv)) return rv;
// the flavors that we can deal with
char* textEditorFlavors[] = { kUnicodeMime, nsnull };
const char* const textEditorFlavors[] = { kUnicodeMime, nsnull };
nsCOMPtr<nsISupportsArray> flavorsList;
rv = nsComponentManager::CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, nsnull,
@@ -595,7 +595,7 @@ NS_IMETHODIMP nsPlaintextEditor::CanPaste(PRInt32 aSelectionType, PRBool *aCanPa
GetFlags(&editorFlags);
// add the flavors for text editors
for (char** flavor = textEditorFlavors; *flavor; flavor++)
for (const char* const* flavor = textEditorFlavors; *flavor; flavor++)
{
nsCOMPtr<nsISupportsString> flavorString;
nsComponentManager::CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, nsnull,

View File

@@ -134,7 +134,7 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory,
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIStringBundle> stringBundle;
char* propertyURL = "chrome://necko/locale/necko.properties";
const char propertyURL[] = "chrome://necko/locale/necko.properties";
rv = sBundleService->CreateBundle(propertyURL,
getter_AddRefs(stringBundle));
}

View File

@@ -61,7 +61,7 @@
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
static char *sWatcherContractID = "@mozilla.org/embedcomp/window-watcher;1";
static const char sWatcherContractID[] = "@mozilla.org/embedcomp/window-watcher;1";
PRUint32 EmbedPrivate::sWidgetCount = 0;
char *EmbedPrivate::sCompPath = nsnull;

View File

@@ -550,8 +550,8 @@ reload_clicked_cb (GtkButton *button, TestGtkBrowser *browser)
void
stream_clicked_cb (GtkButton *button, TestGtkBrowser *browser)
{
char *data;
char *data2;
const char *data;
const char *data2;
data = "<html>Hi";
data2 = " there</html>\n";
g_print("stream_clicked_cb\n");
@@ -587,8 +587,8 @@ void
menu_stream_cb (GtkMenuItem *menuitem, TestGtkBrowser *browser)
{
g_print("menu_stream_cb\n");
char *data;
char *data2;
const char *data;
const char *data2;
data = "<html>Hi";
data2 = " there</html>\n";
g_print("stream_clicked_cb\n");

View File

@@ -64,7 +64,7 @@
#include "nsRect.h"
#include "nsIWebBrowserChromeFocus.h"
static char *sWindowWatcherContractID = "@mozilla.org/embedcomp/window-watcher;1";
static const char sWindowWatcherContractID[] = "@mozilla.org/embedcomp/window-watcher;1";

View File

@@ -1200,7 +1200,7 @@ nsWebBrowserPersist::CloneNodeWithFixedUpURIAttributes(
nsresult
nsWebBrowserPersist::StoreURIAttribute(
nsIDOMNode *aNode, char *aAttribute, PRBool aNeedsPersisting,
nsIDOMNode *aNode, const char *aAttribute, PRBool aNeedsPersisting,
URIData **aData)
{
NS_ENSURE_ARG_POINTER(aNode);
@@ -1235,7 +1235,8 @@ nsWebBrowserPersist::StoreURIAttribute(
}
nsresult
nsWebBrowserPersist::FixupNodeAttribute(nsIDOMNode *aNode, char *aAttribute)
nsWebBrowserPersist::FixupNodeAttribute(nsIDOMNode *aNode,
const char *aAttribute)
{
NS_ENSURE_ARG_POINTER(aNode);
NS_ENSURE_ARG_POINTER(aAttribute);

View File

@@ -91,9 +91,10 @@ private:
nsresult MakeFilenameFromURI(
nsIURI *aURI, nsString &aFilename);
nsresult StoreURIAttribute(
nsIDOMNode *aNode, char *aAttribute, PRBool aNeedsPersisting = PR_TRUE,
nsIDOMNode *aNode, const char *aAttribute,
PRBool aNeedsPersisting = PR_TRUE,
URIData **aData = nsnull);
nsresult FixupNodeAttribute(nsIDOMNode *aNode, char *aAttribute);
nsresult FixupNodeAttribute(nsIDOMNode *aNode, const char *aAttribute);
nsresult FixupAnchor(nsIDOMNode *aNode);
nsresult StoreAndFixupStyleSheet(nsIStyleSheet *aStyleSheet);
nsresult SaveDocumentToFileWithFixup(

View File

@@ -107,7 +107,7 @@ int main(PRInt32 argc, char *argv[])
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIStringBundle> stringBundle;
char* propertyURL = "chrome://necko/locale/necko.properties";
const char propertyURL[] = "chrome://necko/locale/necko.properties";
rv = bundleService->CreateBundle(propertyURL, getter_AddRefs(stringBundle));
}

View File

@@ -35,9 +35,9 @@
*/
#ifndef HAVE_64BIT_OS
char* GenerateIdFunctionCall::printfFmt = "id0x%08p";
const char GenerateIdFunctionCall::printfFmt[] = "id0x%08p";
#else
char* GenerateIdFunctionCall::printfFmt = "id0x%016p";
const char GenerateIdFunctionCall::printfFmt[] = "id0x%016p";
#endif
/**

View File

@@ -316,7 +316,7 @@ public:
virtual ExprResult* evaluate(Node* context, ContextState* cs);
private:
static char* printfFmt;
static const char printfFmt[];
};
/**

View File

@@ -140,7 +140,7 @@ struct nsFontCharSetInfo
struct nsFontCharSetMap
{
char* mName;
const char* mName;
nsFontLangGroup* mFontLangGroup;
nsFontCharSetInfo* mInfo;
};
@@ -173,8 +173,8 @@ struct nsFontNode
struct nsFontPropertyName
{
char* mName;
int mValue;
const char* mName;
int mValue;
};
struct nsFontStretch
@@ -3396,7 +3396,8 @@ FFREToXLFDPattern(nsAWritableCString &aFFREName, nsAWritableCString &oPattern)
// substitute the charset in a FFRE (Foundry-Family-Registry-Encoding)
//
static void
FFRESubstituteCharset(nsAWritableCString &aFFREName, char *aReplacementCharset)
FFRESubstituteCharset(nsAWritableCString &aFFREName,
const char *aReplacementCharset)
{
PRInt32 charsetHyphen = aFFREName.FindChar('-');
charsetHyphen = aFFREName.FindChar('-', charsetHyphen + 1);
@@ -3408,7 +3409,8 @@ FFRESubstituteCharset(nsAWritableCString &aFFREName, char *aReplacementCharset)
// substitute the encoding in a FFRE (Foundry-Family-Registry-Encoding)
//
static void
FFRESubstituteEncoding(nsAWritableCString &aFFREName, char *aReplacementEncoding)
FFRESubstituteEncoding(nsAWritableCString &aFFREName,
const char *aReplacementEncoding)
{
PRInt32 encodingHyphen = aFFREName.FindChar('-');
encodingHyphen = aFFREName.FindChar('-', encodingHyphen + 1);

View File

@@ -39,7 +39,7 @@
** The names of the characters in the ISO Latin1 set.
** Index into this array is the encoding for that character
*/
char *isotab[256] = {
const char *const isotab[256] = {
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "space",
"exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand",

View File

@@ -192,20 +192,20 @@ typedef struct AFM_Single_Char_Metrics AFMscm;
struct fontInformation
{
double mFontVersion;
char *mFontName;
char *mFullName;
char *mFamilyName;
char *mWeight;
const char *mFontName;
const char *mFullName;
const char *mFamilyName;
const char *mWeight;
double mFontBBox_llx;
double mFontBBox_lly;
double mFontBBox_urx;
double mFontBBox_ury;
char *mVersion;
char *mNotice;
char *mEncodingScheme;
const char *mVersion;
const char *mNotice;
const char *mEncodingScheme;
PRInt32 mMappingScheme;
PRInt32 mEscChar;
char *mCharacterSet;
const char *mCharacterSet;
PRInt32 mCharacters;
PRBool mIsBaseFont;
double mVVector_0;
@@ -422,8 +422,8 @@ protected:
*/
struct AFM_SubstituteFonts
{
char* mPSName;
char* mFamily;
const char* mPSName;
const char* mFamily;
PRUint16 mWeight;
PRUint8 mStyle;
AFMFontInformation* mFontInfo;

View File

@@ -73,7 +73,7 @@ static NS_DEFINE_IID(kICharsetConverterManagerIID, NS_ICHARSETCONVERTERMANAGER_I
/*
* Paper Names
*/
char* paper_string[]={ "Letter", "Legal", "Executive", "A4", "A3" };
const char*const paper_string[]={ "Letter", "Legal", "Executive", "A4", "A3" };
/*
* global
@@ -886,7 +886,8 @@ nsPostScriptObj::end_document()
* @update 2/1/99 dwc
*/
void
nsPostScriptObj::annotate_page(char *aTemplate, int y, int delta_dir, int pn)
nsPostScriptObj::annotate_page(const char *aTemplate,
int y, int delta_dir, int pn)
{
}
@@ -896,7 +897,7 @@ nsPostScriptObj::annotate_page(char *aTemplate, int y, int delta_dir, int pn)
* @update 2/1/99 dwc. Updated 3/22/2000 to deal with only non-Unicode chars. yueheng.xu@intel.com
*/
void
nsPostScriptObj::show(const char* txt, int len, char *align)
nsPostScriptObj::show(const char* txt, int len, const char *align)
{
FILE *f;
@@ -979,7 +980,7 @@ nsPostScriptObj::preshow(const PRUnichar* txt, int len)
* @update 3/22/2000 to deal with only unicode chars. yueheng.xu@intel.com
*/
void
nsPostScriptObj::show(const PRUnichar* txt, int len, char *align)
nsPostScriptObj::show(const PRUnichar* txt, int len, const char *align)
{
FILE *f = mPrintContext->prSetup->out;
unsigned char highbyte, lowbyte;
@@ -1554,7 +1555,7 @@ int postscriptFont = 0;
* @update 2/1/98 dwc
*/
void
nsPostScriptObj::comment(char *aTheComment)
nsPostScriptObj::comment(const char *aTheComment)
{
fprintf(mPrintContext->prSetup->out,"%%%s\n", aTheComment);
@@ -1635,11 +1636,11 @@ nsPostScriptObj::GetUnixPrinterSetting(const nsCAutoString& aKey, char** aVal)
typedef struct _unixPrinterFallbacks_t {
char *key;
char *val;
const char *key;
const char *val;
} unixPrinterFallbacks_t;
static unixPrinterFallbacks_t unixPrinterFallbacks[] = {
static const unixPrinterFallbacks_t unixPrinterFallbacks[] = {
{"print.psnativefont.ja", "Ryumin-Light-EUC-H"},
{"print.psnativecode.ja", "euc-jp"},
{nsnull, nsnull}
@@ -1648,7 +1649,7 @@ static unixPrinterFallbacks_t unixPrinterFallbacks[] = {
PRBool
GetUnixPrinterFallbackSetting(const nsCAutoString& aKey, char** aVal)
{
unixPrinterFallbacks_t *p;
const unixPrinterFallbacks_t *p;
const char* key = aKey.get();
for (p=unixPrinterFallbacks; p->key; p++) {
if (strcmp(key, p->key) == 0) {

View File

@@ -159,8 +159,8 @@ struct PrintSetup_ {
int width; /* Paper size, # of cols for text xlate */
int height;
char* header;
char* footer;
const char* header;
const char* footer;
int *sizes;
XP_Bool reverse; /* Output order */
@@ -176,9 +176,9 @@ struct PrintSetup_ {
int bigger; /* Used to init sizes if sizesin NULL */
int paper_size; /* Paper Size(letter,legal,exec,a4,a3) */
char* prefix; /* For text xlate, prepended to each line */
char* eol; /* For text translation, line terminator */
char* bullet; /* What char to use for bullets */
const char* prefix; /* For text xlate, prepended to each line */
const char* eol; /* For text translation, line terminator */
const char* bullet; /* What char to use for bullets */
struct URL_Struct_ *url; /* url of doc being translated */
FILE *out; /* Where to send the output */
@@ -347,7 +347,7 @@ public:
* ???
* @update 2/1/99 dwc
*/
void annotate_page( char*, int, int, int);
void annotate_page( const char*, int, int, int);
/** ---------------------------------------------------
* translate the current coordinate system
* @update 2/1/99 dwc
@@ -357,12 +357,12 @@ public:
* Issue a PS show command, which causes image to be rastered
* @update 2/1/99 dwc
*/
void show(const char* aText, int aLen, char *aAlign);
void show(const char* aText, int aLen, const char *aAlign);
/** ---------------------------------------------------
* This version takes an Unicode string.
* @update 3/22/2000 yueheng.xu@intel.com
*/
void show(const PRUnichar* aText, int aLen, char *aAlign);
void show(const PRUnichar* aText, int aLen, const char *aAlign);
/** ---------------------------------------------------
* set the clipping path to the current path using the winding rule
* @update 2/1/99 dwc
@@ -402,7 +402,7 @@ public:
* output a postscript comment
* @update 2/1/99 dwc
*/
void comment(char *aTheComment);
void comment(const char *aTheComment);
/** ---------------------------------------------------
* setup language group
* @update 5/30/00 katakai

View File

@@ -70,7 +70,7 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
static NS_DEFINE_IID(kClassIID, NS_IOTHERHTML_DTD_IID);
static NS_DEFINE_IID(kParserServiceCID, NS_PARSERSERVICE_CID);
static char* kVerificationDir = "c:/temp";
static const char kVerificationDir[] = "c:/temp";
#ifdef ENABLE_CRC

View File

@@ -232,7 +232,7 @@ enum {
VIEW_SOURCE_MARKUPDECLARATION = 12
};
static char* kElementClasses[] = {
static const char* const kElementClasses[] = {
"start-tag",
"end-tag",
"comment",
@@ -248,7 +248,7 @@ static char* kElementClasses[] = {
"markupdeclaration"
};
static char* kBeforeText[] = {
static const char* const kBeforeText[] = {
"<",
"</",
"",
@@ -264,7 +264,7 @@ static char* kBeforeText[] = {
""
};
static char* kAfterText[] = {
static const char* const kAfterText[] = {
">",
">",
"",
@@ -281,7 +281,7 @@ static char* kAfterText[] = {
};
#ifdef DUMP_TO_FILE
static char* kDumpFileBeforeText[] = {
static const char* const kDumpFileBeforeText[] = {
"&lt;",
"&lt;/",
"",
@@ -297,7 +297,7 @@ static char* kDumpFileBeforeText[] = {
""
};
static char* kDumpFileAfterText[] = {
static const char* const kDumpFileAfterText[] = {
"&gt;",
"&gt;",
"",

View File

@@ -93,10 +93,10 @@ private:
nsIStringBundle ** aResult);
static nsresult RegisterConverterTitles(nsIRegistry * aRegistry,
char * aRegistryPath);
const char * aRegistryPath);
static nsresult RegisterConverterData(nsIRegistry * aRegistry,
char * aRegistryPath);
const char * aRegistryPath);
nsresult GetBundleValue(nsIStringBundle * aBundle, const nsIAtom * aName,
nsString * aProp, PRUnichar ** aResult);
@@ -104,10 +104,10 @@ private:
nsresult GetBundleValue(nsIStringBundle * aBundle, const nsIAtom * aName,
nsString * aProp, nsIAtom ** aResult);
nsresult GetRegistryEnumeration(char * aRegistryKey, char * aAddPrefix,
nsISupportsArray ** aArray);
nsresult GetRegistryEnumeration(const char * aRegistryKey,
const char * aAddPrefix, nsISupportsArray ** aArray);
nsresult GetRegistryEnumeration2(char * aRegistryKey, PRBool aDecoder,
nsresult GetRegistryEnumeration2(const char * aRegistryKey, PRBool aDecoder,
nsISupportsArray ** aArray);
public:
@@ -239,7 +239,7 @@ nsresult nsCharsetConverterManager::RegisterConverterManagerData()
nsresult nsCharsetConverterManager::RegisterConverterTitles(
nsIRegistry * aRegistry,
char * aRegistryPath)
const char * aRegistryPath)
{
nsresult res;
nsRegistryKey key;
@@ -259,7 +259,7 @@ nsresult nsCharsetConverterManager::RegisterConverterTitles(
nsresult nsCharsetConverterManager::RegisterConverterData(
nsIRegistry * aRegistry,
char * aRegistryPath)
const char * aRegistryPath)
{
nsresult res;
nsRegistryKey key;
@@ -329,8 +329,8 @@ nsresult nsCharsetConverterManager::GetBundleValue(nsIStringBundle * aBundle,
}
nsresult nsCharsetConverterManager::GetRegistryEnumeration(
char * aRegistryKey,
char * aAddPrefix,
const char * aRegistryKey,
const char * aAddPrefix,
nsISupportsArray ** aArray)
{
nsresult res = NS_OK;
@@ -401,7 +401,7 @@ next:
// .../uconv/decoder/name
// .../uconv/encoder/name
nsresult nsCharsetConverterManager::GetRegistryEnumeration2(
char * aRegistryKey,
const char * aRegistryKey,
PRBool aDecoder,
nsISupportsArray ** aArray)
{

View File

@@ -306,7 +306,7 @@ MySecMan::CanAccess(PRUint32 aAction, nsIXPCNativeCallContext *aCallContext, JSC
static void
TestSecurityManager(JSContext* jscontext, JSObject* glob, nsIXPConnect* xpc)
{
char* t;
const char* t;
jsval rval;
JSBool success = JS_TRUE;
MySecMan* sm = new MySecMan();

View File

@@ -75,7 +75,7 @@ static NS_DEFINE_IID(kXULDocumentCID, NS_XULDOCUMENT_CID);
extern nsresult NS_NewDocumentViewer(nsIDocumentViewer** aResult);
static char* gHTMLTypes[] = {
static const char* const gHTMLTypes[] = {
"text/html",
"text/plain",
"text/css",
@@ -89,7 +89,7 @@ static char* gHTMLTypes[] = {
0
};
static char* gXMLTypes[] = {
static const char* const gXMLTypes[] = {
"text/xml",
"application/xml",
"application/xhtml+xml",
@@ -100,7 +100,7 @@ static char* gXMLTypes[] = {
};
static char* gRDFTypes[] = {
static const char* const gRDFTypes[] = {
"text/rdf",
"application/vnd.mozilla.xul+xml",
"mozilla.application/cached-xul",
@@ -109,7 +109,7 @@ static char* gRDFTypes[] = {
0
};
static char* gImageTypes[] = {
static const char* const gImageTypes[] = {
"image/gif",
"image/jpeg",
"image/jpg",
@@ -538,12 +538,12 @@ RegisterTypes(nsIComponentManager* aCompMgr,
nsIFile* aPath,
const char *aLocation,
const char *aType,
char** aTypes)
const char* const* aTypes)
{
nsresult rv = NS_OK;
while (*aTypes) {
char contractid[500];
char* contentType = *aTypes++;
const char* contentType = *aTypes++;
PR_snprintf(contractid, sizeof(contractid),
NS_DOCUMENT_LOADER_FACTORY_CONTRACTID_PREFIX "%s;1?type=%s",
aCommand, contentType);

View File

@@ -468,7 +468,7 @@ nsHTMLButtonControlFrame::Paint(nsIPresContext* aPresContext,
// XXX a hack until the reflow state does this correctly
// XXX when it gets fixed, leave in the printf statements or add an assertion
static
void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage)
void ButtonHack(nsHTMLReflowState& aReflowState, const char* aMessage)
{
if (aReflowState.mComputedWidth == 0) {
aReflowState.mComputedWidth = aReflowState.availableWidth;

View File

@@ -468,7 +468,7 @@ nsHTMLButtonControlFrame::Paint(nsIPresContext* aPresContext,
// XXX a hack until the reflow state does this correctly
// XXX when it gets fixed, leave in the printf statements or add an assertion
static
void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage)
void ButtonHack(nsHTMLReflowState& aReflowState, const char* aMessage)
{
if (aReflowState.mComputedWidth == 0) {
aReflowState.mComputedWidth = aReflowState.availableWidth;

View File

@@ -49,10 +49,9 @@ NS_IMETHODIMP nsCNullSecurityContext::GetOrigin(char* buf, int len)
if (buf == NULL)
return NS_ERROR_NULL_POINTER;
char* origin = "file:///";
PRInt32 originLen = (PRInt32) nsCRT::strlen(origin);
const char origin[] = "file:///";
PRInt32 originLen = (PRInt32) (sizeof(origin) - 1);
if (len <= originLen) {
nsCRT::free(origin);
return NS_ERROR_NULL_POINTER;
}
// Copy origin

View File

@@ -221,8 +221,7 @@ static void LoadExtraSharedLibs()
if (!sonameList) {
// pref is not set, lets use hardcoded list
prefSonameListIsSet = PR_FALSE;
sonameList = DEFAULT_EXTRA_LIBS_LIST;
sonameList = PL_strdup(sonameList);
sonameList = PL_strdup(DEFAULT_EXTRA_LIBS_LIST);
}
if (sonameList) {
char *arrayOfLibs[PLUGIN_MAX_NUMBER_OF_EXTRA_LIBS] = {0};

View File

@@ -781,7 +781,7 @@ nsSocketTransportService::GetNeckoStringByName (const char *aName, PRUnichar **a
nsAutoString resultString; resultString.AssignWithConversion(aName);
if (!m_stringBundle) {
char* propertyURL = NECKO_MSGS_URL;
const char propertyURL[] = NECKO_MSGS_URL;
// make sure that we get this service on the UI thread.
NS_WITH_PROXIED_SERVICE(nsIStringBundleService, sBundleService, kStringBundleServiceCID,
NS_UI_THREAD_EVENTQ, &res);

View File

@@ -255,7 +255,7 @@ static PRUint32 g_StreamConverterCount = 16;
static PRUint32 g_StreamConverterCount = 15;
#endif
static char *g_StreamConverterArray[] = {
static const char *const g_StreamConverterArray[] = {
FTP_UNIX_TO_INDEX,
FTP_NT_TO_INDEX,
FTP_OS2_TO_INDEX,

View File

@@ -1475,7 +1475,7 @@ nsFtpState::S_pasv() {
}
char * string;
const char * string;
if (mIPv6ServerAddress)
string = "EPSV" CRLF;
else

View File

@@ -1996,7 +1996,7 @@ nsHttpChannel::GetReferrer(nsIURI **referrer)
#define numInvalidReferrerSchemes 8
static char * invalidReferrerSchemes [numInvalidReferrerSchemes] =
static const char *const invalidReferrerSchemes [numInvalidReferrerSchemes] =
{
"chrome",
"resource",

View File

@@ -169,7 +169,7 @@ main(int argc, char* argv[])
// in other modules (necko converters for example).
PRUint32 converterListSize = 7;
char *converterList[] = {
const char *const converterList[] = {
"?from=a/foo&to=b/foo",
"?from=b/foo&to=c/foo",
"?from=b/foo&to=d/foo",

View File

@@ -238,7 +238,7 @@ Consumer::Validate(nsIRequest* request, nsISupports *aContext) {
return rv;
}
nsresult StartLoad(char *);
nsresult StartLoad(const char *);
int main(int argc, char *argv[]) {
nsresult rv = NS_OK;
@@ -299,7 +299,7 @@ int main(int argc, char *argv[]) {
return rv;
}
nsresult StartLoad(char *aURISpec) {
nsresult StartLoad(const char *aURISpec) {
nsresult rv = NS_OK;
// create a context

View File

@@ -602,7 +602,7 @@ main(int argc, char* argv[])
/// }
PRBool bIsAsync = PR_TRUE;
char* hostName = nsnull;
const char* hostName = nsnull;
int i;

View File

@@ -70,7 +70,7 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
static NS_DEFINE_IID(kClassIID, NS_IOTHERHTML_DTD_IID);
static NS_DEFINE_IID(kParserServiceCID, NS_PARSERSERVICE_CID);
static char* kVerificationDir = "c:/temp";
static const char kVerificationDir[] = "c:/temp";
#ifdef ENABLE_CRC

View File

@@ -232,7 +232,7 @@ enum {
VIEW_SOURCE_MARKUPDECLARATION = 12
};
static char* kElementClasses[] = {
static const char* const kElementClasses[] = {
"start-tag",
"end-tag",
"comment",
@@ -248,7 +248,7 @@ static char* kElementClasses[] = {
"markupdeclaration"
};
static char* kBeforeText[] = {
static const char* const kBeforeText[] = {
"<",
"</",
"",
@@ -264,7 +264,7 @@ static char* kBeforeText[] = {
""
};
static char* kAfterText[] = {
static const char* const kAfterText[] = {
">",
">",
"",
@@ -281,7 +281,7 @@ static char* kAfterText[] = {
};
#ifdef DUMP_TO_FILE
static char* kDumpFileBeforeText[] = {
static const char* const kDumpFileBeforeText[] = {
"&lt;",
"&lt;/",
"",
@@ -297,7 +297,7 @@ static char* kDumpFileBeforeText[] = {
""
};
static char* kDumpFileAfterText[] = {
static const char* const kDumpFileAfterText[] = {
"&gt;",
"&gt;",
"",

View File

@@ -1237,7 +1237,7 @@ nsPrefMigration::CreateNewUser5Tree(nsIFileSpec * oldProfilePath, nsIFileSpec *
*
*--------------------------------------------------------------------------------*/
nsresult
nsPrefMigration::GetDirFromPref(nsIFileSpec * oldProfilePath, nsIFileSpec * newProfilePath, const char *newDirName, char* pref, nsIFileSpec* newPath, nsIFileSpec* oldPath)
nsPrefMigration::GetDirFromPref(nsIFileSpec * oldProfilePath, nsIFileSpec * newProfilePath, const char *newDirName, const char* pref, nsIFileSpec* newPath, nsIFileSpec* oldPath)
{
nsresult rv;

View File

@@ -119,7 +119,7 @@ class nsPrefMigration: public nsIPrefMigration
nsresult GetDirFromPref(nsIFileSpec* oldProfilePath,
nsIFileSpec* newProfilePath,
const char* newDirName,
char* pref,
const char* pref,
nsIFileSpec* newPath,
nsIFileSpec* oldPath);

View File

@@ -446,7 +446,7 @@ nsNSSComponent::RegisterPSMContentListener()
/* Table of pref names and SSL cipher ID */
typedef struct {
char* pref;
const char* pref;
long id;
} CipherPref;

View File

@@ -1156,7 +1156,7 @@ nsViewerApp::CreateRobot(nsBrowserWindow* aWindow)
static nsBrowserWindow* gWinData;
static int gTop100Pointer = 0;
static int gTop100LastPointer = 0;
static char * gTop100List[] = {
static const char *const gTop100List[] = {
"http://www.yahoo.com",
"http://www.netscape.com",
"http://www.mozilla.org",
@@ -1386,7 +1386,7 @@ PRBool CreateSiteDialog(nsIWidget * aParent)
{
// Dynamically find the index of the last pointer
gTop100LastPointer = 0;
char * p;
const char * p;
do {
p = gTop100List[gTop100LastPointer++];
} while (p);

View File

@@ -36,9 +36,9 @@ static NS_DEFINE_IID(kCDragServiceCID, NS_DRAGSERVICE_CID);
static PRLogModuleInfo *sDragLm = NULL;
static char *gMimeListType = "application/x-moz-internal-item-list";
static char *gMozUrlType = "_NETSCAPE_URL";
static char *gTextUriListType = "text/uri-list";
static const char gMimeListType[] = "application/x-moz-internal-item-list";
static const char gMozUrlType[] = "_NETSCAPE_URL";
static const char gTextUriListType[] = "text/uri-list";
NS_IMPL_ADDREF_INHERITED(nsDragService, nsBaseDragService)
NS_IMPL_RELEASE_INHERITED(nsDragService, nsBaseDragService)
@@ -776,7 +776,7 @@ nsDragService::GetSourceList(void)
GtkTargetList *multiTargetList = 0;
GdkAtom listAtom = gdk_atom_intern(gMimeListType, FALSE);
GtkTargetEntry target;
target.target = gMimeListType;
target.target = (gchar*)gMimeListType;
target.flags = 0;
target.info = listAtom;
multiTargetList = gtk_target_list_new(&target, 1);

View File

@@ -1362,7 +1362,7 @@ nsIMEGtkIC::SetPreeditFont(GdkFont *aFontset) {
}
void
nsIMEGtkIC::SetStatusText(char *aText) {
nsIMEGtkIC::SetStatusText(const char *aText) {
if (!aText) {
return;
}

View File

@@ -158,7 +158,7 @@ class nsIMEGtkIC {
GdkIMStyle mInputStyle;
GdkFont *GetPreeditFont();
char *mStatusText;
void SetStatusText(char*);
void SetStatusText(const char*);
void SetPreeditFont(GdkFont*);
void SetStatusFont(GdkFont*);
void SetPreeditSpotLocation(unsigned long, unsigned long);

View File

@@ -42,7 +42,7 @@ Atom nsGtkMozRemoteHelper::sMozResponseAtom = 0;
Atom nsGtkMozRemoteHelper::sMozUserAtom = 0;
// XXX get this dynamically
static char *sRemoteVersion = "5.0";
static const char sRemoteVersion[] = "5.0";
void
nsGtkMozRemoteHelper::SetupVersion(GdkWindow *aWindow)

View File

@@ -55,7 +55,7 @@ typedef enum {
struct nsLookAndFeelIntPref
{
char* name;
const char* name;
nsILookAndFeel::nsMetricID id;
PRPackedBool isSet;
nsLookAndFeelType type;
@@ -64,7 +64,7 @@ struct nsLookAndFeelIntPref
struct nsLookAndFeelFloatPref
{
char* name;
const char* name;
nsILookAndFeel::nsMetricFloatID id;
PRPackedBool isSet;
nsLookAndFeelType type;

View File

@@ -144,7 +144,7 @@ nsPersistentProperties::Load(nsIInputStream *aIn)
if (c < 0) {
break;
}
char *trimThese = " \t";
static const char trimThese[] = " \t";
key.Trim(trimThese, PR_FALSE, PR_TRUE);
c = Read();
nsAutoString value;

View File

@@ -92,7 +92,7 @@ NS_COM char* nsEscapeCount(
return 0;
int i, extra = 0;
char* hexChars = "0123456789ABCDEF";
static const char hexChars[] = "0123456789ABCDEF";
register const unsigned char* src = (const unsigned char *) str;
for (i = 0; i < len; i++)
@@ -339,7 +339,7 @@ NS_COM nsresult nsStdEscape(const char* str, PRInt16 mask, nsCString &result)
return NS_OK;
int i = 0;
char* hexChars = "0123456789ABCDEF";
static const char hexChars[] = "0123456789ABCDEF";
int len = PL_strlen(str);
PRBool forced = PR_FALSE;

View File

@@ -595,8 +595,8 @@ nsDirectoryIterator& nsDirectoryIterator::operator ++ ()
mExists = PR_FALSE;
if (!mDir)
return *this;
char* dot = ".";
char* dotdot = "..";
const char dot[] = ".";
const char dotdot[] = "..";
struct dirent* entry = readdir(mDir);
if (entry && strcmp(entry->d_name, dot) == 0)
entry = readdir(mDir);

View File

@@ -56,7 +56,7 @@
----------------------------------------------------------------------------*/
static const char* GetLinebreakString(nsLinebreakConverter::ELinebreakType aBreakType)
{
static char* sLinebreaks[] = {
static const char* const sLinebreaks[] = {
"", // any
NS_LINEBREAK, // platform
LFSTR, // content

View File

@@ -41,7 +41,7 @@
struct xptiFileTypeEntry
{
char* name;
const char* name;
int len;
xptiFileType::Type type;
};

View File

@@ -38,7 +38,7 @@
#include "plstr.h"
#include "nsID.h"
static char* ids[] = {
static const char* const ids[] = {
"5C347B10-D55C-11D1-89B7-006008911B81",
"{5C347B10-D55C-11D1-89B7-006008911B81}",
"5c347b10-d55c-11d1-89b7-006008911b81",
@@ -55,7 +55,7 @@ int main(int argc, char** argv)
{
nsID id;
for (int i = 0; i < NUM_IDS; i++) {
char* idstr = ids[i];
const char* idstr = ids[i];
if (!id.Parse(idstr)) {
fprintf(stderr, "TestID: Parse failed on test #%d\n", i);
return -1;

View File

@@ -69,7 +69,7 @@ NS_SetupRegistry()
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, NULL);
}
void InitTest(char* creationPath, char* appendPath)
void InitTest(const char* creationPath, const char* appendPath)
{
nsILocalFile* file = nsnull;
nsresult rv = nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID,
@@ -120,7 +120,7 @@ void InitTest(char* creationPath, char* appendPath)
}
void CreationTest(char* creationPath, char* appendPath,
void CreationTest(const char* creationPath, const char* appendPath,
PRInt32 whatToCreate, PRInt32 perm)
{
nsCOMPtr<nsILocalFile> file;
@@ -172,7 +172,7 @@ void CreationTest(char* creationPath, char* appendPath,
}
void CreateUniqueTest(char* creationPath, char* appendPath,
void CreateUniqueTest(const char* creationPath, const char* appendPath,
PRInt32 whatToCreate, PRInt32 perm)
{
nsCOMPtr<nsILocalFile> file;
@@ -226,7 +226,7 @@ void CreateUniqueTest(char* creationPath, char* appendPath,
void
CopyTest(char *testFile, char *targetDir)
CopyTest(const char *testFile, const char *targetDir)
{
nsCOMPtr<nsILocalFile> file;
nsCOMPtr<nsILocalFile> dir;
@@ -267,7 +267,7 @@ CopyTest(char *testFile, char *targetDir)
}
void
DeletionTest(char* creationPath, char* appendPath, PRBool recursive)
DeletionTest(const char* creationPath, const char* appendPath, PRBool recursive)
{
nsCOMPtr<nsILocalFile> file;
nsresult rv =

View File

@@ -59,8 +59,8 @@ static PRThread *gEventQueueLogThread = 0;
#endif
// in a real system, these would be members in a header class...
static char *gActivatedNotification = "nsIEventQueueActivated";
static char *gDestroyedNotification = "nsIEventQueueDestroyed";
static const char gActivatedNotification[] = "nsIEventQueueActivated";
static const char gDestroyedNotification[] = "nsIEventQueueDestroyed";
nsEventQueueImpl::nsEventQueueImpl()
{

View File

@@ -111,7 +111,7 @@ static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
#define UILOCALE_CMD_LINE_ARG "-UILocale"
#define CONTENTLOCALE_CMD_LINE_ARG "-contentLocale"
extern "C" void ShowOSAlert(char* aMessage);
extern "C" void ShowOSAlert(const char* aMessage);
#define HELP_SPACER_1 "\t"
#define HELP_SPACER_2 "\t\t"
@@ -271,7 +271,7 @@ static void InitializeMacOSXApp(int argc, char* argv[])
/* Define Class IDs */
static NS_DEFINE_CID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID);
static NS_DEFINE_CID(kCmdLineServiceCID, NS_COMMANDLINE_SERVICE_CID);
static char *sWatcherServiceContractID = "@mozilla.org/embedcomp/window-watcher;1";
static const char sWatcherServiceContractID[] = "@mozilla.org/embedcomp/window-watcher;1";
#include "nsNativeAppSupport.h"
@@ -942,11 +942,11 @@ static nsresult InitializeWindowCreator()
// Maximum allowed / used length of alert message is 255 chars, due to restrictions on Mac.
// Please make sure that file contents and fallback_alert_text are at most 255 chars.
// Fallback_alert_text must be non-const, because of inplace conversion on Mac.
static void ShowOSAlertFromFile(int argc, char **argv, const char *alert_filename, char* fallback_alert_text)
static void ShowOSAlertFromFile(int argc, char **argv, const char *alert_filename, const char* fallback_alert_text)
{
char message[256] = { 0 };
PRInt32 numRead = 0;
char *messageToShow = fallback_alert_text;
const char *messageToShow = fallback_alert_text;
nsresult rv;
nsCOMPtr<nsILocalFile> fileName;
nsCOMPtr<nsIProperties> directoryService;
@@ -1002,7 +1002,7 @@ static nsresult VerifyInstallation(int argc, char **argv)
if (exists)
{
nsCOMPtr<nsIFile> binPath;
char* lastResortMessage = "A previous install did not complete correctly. Finishing install.";
const char lastResortMessage[] = "A previous install did not complete correctly. Finishing install.";
ShowOSAlertFromFile(argc, argv, CLEANUP_MESSAGE_FILENAME, lastResortMessage);
@@ -1033,13 +1033,13 @@ static nsresult VerifyPsmAbsentOrSane(int argc, char **argv)
// In case the security component can not do its internal initialization,
// we must warn the user and exit.
char *panicMsg = "Could not initialize the browser's security component. "
const char panicMsg[] = "Could not initialize the browser's security component. "
"The most likely cause is problems with files in your "
"browser's profile directory. Please check that this "
"directory has no read/write restrictions and your "
"hard disk is not full or close to full.";
char *panicMessageFilename = "nssifail.txt";
const char panicMessageFilename[] = "nssifail.txt";
ShowOSAlertFromFile(argc, argv, panicMessageFilename, panicMsg);

View File

@@ -52,7 +52,7 @@
#include <os2.h>
#endif
extern "C" void ShowOSAlert(char* aMessage);
extern "C" void ShowOSAlert(const char* aMessage);
#if defined (MOZ_WIDGET_GTK)
@@ -96,7 +96,7 @@ ns_gtk_alert_OK_callback(GtkWidget *aWidget, gpointer aData)
* returns -2 for widget creation error
*/
int
NS_gtk_alert(char *aMessage, char *aTitle, char *aOKBtnText)
NS_gtk_alert(const char *aMessage, const char *aTitle, const char *aOKBtnText)
{
#ifdef DEBUG_dbragg
printf ("\n*** Now inside NS_gtk_alert *** \n");
@@ -107,8 +107,8 @@ NS_gtk_alert(char *aMessage, char *aTitle, char *aOKBtnText)
GtkWidget *msgLabel = NULL;
GtkWidget *packerLbl = NULL;
GtkWidget *packerBtn = NULL;
char *okBtnText = aOKBtnText;
char *title = aTitle;
const char *okBtnText = aOKBtnText;
const char *title = aTitle;
if (!aMessage)
return -1;
@@ -178,7 +178,7 @@ NS_gtk_alert(char *aMessage, char *aTitle, char *aOKBtnText)
// The maximum allowed length of aMessage is 255 characters!
void ShowOSAlert(char* aMessage)
void ShowOSAlert(const char* aMessage)
{
#ifdef DEBUG_dbragg
printf("\n****Inside ShowOSAlert ***\n");

View File

@@ -571,7 +571,7 @@ nsFindComponent::Find(nsISupports *aContext, PRBool *aDidFind)
return rv;
// Open Find dialog and prompt for search parameters.
char * urlStr = "chrome://global/content/finddialog.xul";
const char urlStr[] = "chrome://global/content/finddialog.xul";
// We need the parent's nsIDOMWindowInternal...
// 1. Get topLevelWindow nsIWebShellContainer (chrome included).
@@ -659,7 +659,7 @@ nsFindComponent::Replace( nsISupports *aContext )
return rv;
// Open Replace dialog and prompt for search parameters.
char * urlStr = "chrome://global/content/replacedialog.xul";
const char urlStr[] = "chrome://global/content/replacedialog.xul";
// We need the parent's nsIDOMWindowInternal...
// 1. Get topLevelWindow nsIWebShellContainer (chrome included).

View File

@@ -209,7 +209,7 @@ private:
nsresult InitCacheMenu(nsISupportsArray * aDecs, nsIRDFResource * aResource,
const char * aKey, nsVoidArray * aArray);
nsresult InitMoreMenu(nsISupportsArray * aDecs, nsIRDFResource * aResource,
char * aFlag);
const char * aFlag);
nsresult InitMoreSubmenus(nsISupportsArray * aDecs);
nsresult AddCharsetToItemArray(nsVoidArray * aArray, nsIAtom * aCharset,
@@ -217,22 +217,23 @@ private:
nsresult AddCharsetArrayToItemArray(nsVoidArray * aArray,
nsISupportsArray * aCharsets);
nsresult AddMenuItemToContainer(nsIRDFContainer * aContainer,
nsMenuEntry * aItem, nsIRDFResource * aType, char * aIDPrefix,
nsMenuEntry * aItem, nsIRDFResource * aType, const char * aIDPrefix,
PRInt32 aPlace);
nsresult AddMenuItemArrayToContainer(nsIRDFContainer * aContainer,
nsVoidArray * aArray, nsIRDFResource * aType);
nsresult AddCharsetToContainer(nsVoidArray * aArray,
nsIRDFContainer * aContainer, nsIAtom * aCharset, char * aIDPrefix,
nsIRDFContainer * aContainer, nsIAtom * aCharset, const char * aIDPrefix,
PRInt32 aPlace, PRInt32 aRDFPlace);
nsresult AddFromPrefsToMenu(nsVoidArray * aArray,
nsIRDFContainer * aContainer, const char * aKey, nsISupportsArray * aDecs,
char * aIDPrefix);
const char * aIDPrefix);
nsresult AddFromNolocPrefsToMenu(nsVoidArray * aArray,
nsIRDFContainer * aContainer, const char * aKey, nsISupportsArray * aDecs,
char * aIDPrefix);
const char * aIDPrefix);
nsresult AddFromStringToMenu(char * aCharsetList, nsVoidArray * aArray,
nsIRDFContainer * aContainer, nsISupportsArray * aDecs, char * aIDPrefix);
nsIRDFContainer * aContainer, nsISupportsArray * aDecs,
const char * aIDPrefix);
nsresult AddSeparatorToContainer(nsIRDFContainer * aContainer);
nsresult AddCharsetToCache(nsIAtom * aCharset, nsVoidArray * aArray,
@@ -1091,7 +1092,7 @@ nsresult nsCharsetMenu::InitAutodetMenu()
nsresult nsCharsetMenu::InitMoreMenu(
nsISupportsArray * aDecs,
nsIRDFResource * aResource,
char * aFlag)
const char * aFlag)
{
NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMoreMenu");
@@ -1139,11 +1140,11 @@ nsresult nsCharsetMenu::InitMoreSubmenus(nsISupportsArray * aDecs)
nsCOMPtr<nsIRDFContainer> container3;
nsCOMPtr<nsIRDFContainer> container4;
nsCOMPtr<nsIRDFContainer> container5;
char * key1 = "intl.charsetmenu.browser.more1";
char * key2 = "intl.charsetmenu.browser.more2";
char * key3 = "intl.charsetmenu.browser.more3";
char * key4 = "intl.charsetmenu.browser.more4";
char * key5 = "intl.charsetmenu.browser.more5";
const char key1[] = "intl.charsetmenu.browser.more1";
const char key2[] = "intl.charsetmenu.browser.more2";
const char key3[] = "intl.charsetmenu.browser.more3";
const char key4[] = "intl.charsetmenu.browser.more4";
const char key5[] = "intl.charsetmenu.browser.more5";
res = NewRDFContainer(mInner, kNC_BrowserMore1CharsetMenuRoot,
getter_AddRefs(container1));
@@ -1248,7 +1249,7 @@ nsresult nsCharsetMenu::AddMenuItemToContainer(
nsIRDFContainer * aContainer,
nsMenuEntry * aItem,
nsIRDFResource * aType,
char * aIDPrefix,
const char * aIDPrefix,
PRInt32 aPlace)
{
nsresult res = NS_OK;
@@ -1331,7 +1332,7 @@ nsresult nsCharsetMenu::AddCharsetToContainer(
nsVoidArray * aArray,
nsIRDFContainer * aContainer,
nsIAtom * aCharset,
char * aIDPrefix,
const char * aIDPrefix,
PRInt32 aPlace,
PRInt32 aRDFPlace)
{
@@ -1359,7 +1360,7 @@ nsresult nsCharsetMenu::AddFromPrefsToMenu(
nsIRDFContainer * aContainer,
const char * aKey,
nsISupportsArray * aDecs,
char * aIDPrefix)
const char * aIDPrefix)
{
nsresult res = NS_OK;
@@ -1383,7 +1384,7 @@ nsresult nsCharsetMenu::AddFromNolocPrefsToMenu(
nsIRDFContainer * aContainer,
const char * aKey,
nsISupportsArray * aDecs,
char * aIDPrefix)
const char * aIDPrefix)
{
nsresult res = NS_OK;
@@ -1404,7 +1405,7 @@ nsresult nsCharsetMenu::AddFromStringToMenu(
nsVoidArray * aArray,
nsIRDFContainer * aContainer,
nsISupportsArray * aDecs,
char * aIDPrefix)
const char * aIDPrefix)
{
nsresult res = NS_OK;
char * p = aCharsetList;

View File

@@ -3308,8 +3308,8 @@ InternetSearchDataSource::updateAtom(nsIRDFDataSource *db, nsIRDFResource *src,
struct encodings
{
char *numericEncoding;
char *stringEncoding;
const char *numericEncoding;
const char *stringEncoding;
};

View File

@@ -48,7 +48,7 @@
typedef struct _findTokenStruct
{
char *token;
const char *token;
nsString value;
} findTokenStruct, *findTokenPtr;

View File

@@ -46,7 +46,7 @@ static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
static NS_DEFINE_CID(kRDFCUtilsCID, NS_RDFCONTAINERUTILS_CID);
static char * ignoreArray[] = {
static const char * const ignoreArray[] = {
"http://",
"ftp://",
"gopher://",

View File

@@ -49,12 +49,12 @@
NS_DEFINE_CID(kWindowCID, NS_WINDOW_CID);
// protocol strings
static char *s200ExecutedCommand = "200 executed command:";
static char *s500ParseCommand = "500 command not parsable:";
static char *s501UnrecognizedCommand = "501 unrecognized command:";
static const char s200ExecutedCommand[] = "200 executed command:";
static const char s500ParseCommand[] = "500 command not parsable:";
static const char s501UnrecognizedCommand[] = "501 unrecognized command:";
// not used
//static char *s502NoWindow = "502 no appropriate window for:";
static char *s509InternalError = "509 internal error";
//static const char s502NoWindow[] = "502 no appropriate window for:";
static const char s509InternalError[] = "509 internal error";
XRemoteService::XRemoteService()
{

View File

@@ -44,7 +44,7 @@
struct DirectoryTable
{
char * directoryName; /* The formal directory name */
const char * directoryName; /* The formal directory name */
PRInt32 folderEnum; /* Directory ID */
};