Bug 467948: Fix some "deprecated conversion from string constant" compiler warnings", round 2. r=dbaron

This commit is contained in:
Craig Topper 2009-08-18 08:48:32 -07:00
parent 5596f24f84
commit b5592178c6
5 changed files with 32 additions and 33 deletions

View File

@ -334,23 +334,23 @@ GetArrayStringValue(CFArrayRef aArray, PRInt32 aIndex, nsAString& aResult)
static
nsSafariProfileMigrator::PrefTransform gTransforms[] = {
{ CFSTR("AlwaysShowTabBar"), _SPM(BOOL), "browser.tabs.autoHide", _SPM(SetBoolInverted), PR_FALSE, -1 },
{ CFSTR("AutoFillPasswords"), _SPM(BOOL), "signon.rememberSignons", _SPM(SetBool), PR_FALSE, -1 },
{ CFSTR("OpenNewTabsInFront"), _SPM(BOOL), "browser.tabs.loadInBackground", _SPM(SetBoolInverted), PR_FALSE, -1 },
{ CFSTR("NSDefaultOpenDir"), _SPM(STRING), "browser.download.dir", _SPM(SetDownloadFolder), PR_FALSE, -1 },
{ CFSTR("AutoOpenSafeDownloads"), _SPM(BOOL), nsnull, _SPM(SetDownloadHandlers), PR_FALSE, -1 },
{ CFSTR("DownloadsClearingPolicy"), _SPM(INT), "browser.download.manager.retention", _SPM(SetDownloadRetention), PR_FALSE, -1 },
{ CFSTR("WebKitDefaultTextEncodingName"),_SPM(STRING), "intl.charset.default", _SPM(SetDefaultEncoding), PR_FALSE, -1 },
{ CFSTR("WebKitStandardFont"), _SPM(STRING), "font.name.serif.", _SPM(SetFontName), PR_FALSE, -1 },
{ CFSTR("WebKitDefaultFontSize"), _SPM(INT), "font.size.serif.", _SPM(SetFontSize), PR_FALSE, -1 },
{ CFSTR("WebKitFixedFont"), _SPM(STRING), "font.name.fixed.", _SPM(SetFontName), PR_FALSE, -1 },
{ CFSTR("WebKitDefaultFixedFontSize"), _SPM(INT), "font.size.fixed.", _SPM(SetFontSize), PR_FALSE, -1 },
{ CFSTR("WebKitMinimumFontSize"), _SPM(INT), "font.minimum-size.", _SPM(SetFontSize), PR_FALSE, -1 },
{ CFSTR("WebKitDisplayImagesKey"), _SPM(BOOL), "permissions.default.image", _SPM(SetDisplayImages), PR_FALSE, -1 },
{ CFSTR("WebKitJavaEnabled"), _SPM(BOOL), "security.enable_java", _SPM(SetBool), PR_FALSE, -1 },
{ CFSTR("WebKitJavaScriptEnabled"), _SPM(BOOL), "javascript.enabled", _SPM(SetBool), PR_FALSE, -1 },
{ CFSTR("AlwaysShowTabBar"), _SPM(BOOL), "browser.tabs.autoHide", _SPM(SetBoolInverted), PR_FALSE, { -1 } },
{ CFSTR("AutoFillPasswords"), _SPM(BOOL), "signon.rememberSignons", _SPM(SetBool), PR_FALSE, { -1 } },
{ CFSTR("OpenNewTabsInFront"), _SPM(BOOL), "browser.tabs.loadInBackground", _SPM(SetBoolInverted), PR_FALSE, { -1 } },
{ CFSTR("NSDefaultOpenDir"), _SPM(STRING), "browser.download.dir", _SPM(SetDownloadFolder), PR_FALSE, { -1 } },
{ CFSTR("AutoOpenSafeDownloads"), _SPM(BOOL), nsnull, _SPM(SetDownloadHandlers), PR_FALSE, { -1 } },
{ CFSTR("DownloadsClearingPolicy"), _SPM(INT), "browser.download.manager.retention", _SPM(SetDownloadRetention), PR_FALSE, { -1 } },
{ CFSTR("WebKitDefaultTextEncodingName"),_SPM(STRING), "intl.charset.default", _SPM(SetDefaultEncoding), PR_FALSE, { -1 } },
{ CFSTR("WebKitStandardFont"), _SPM(STRING), "font.name.serif.", _SPM(SetFontName), PR_FALSE, { -1 } },
{ CFSTR("WebKitDefaultFontSize"), _SPM(INT), "font.size.serif.", _SPM(SetFontSize), PR_FALSE, { -1 } },
{ CFSTR("WebKitFixedFont"), _SPM(STRING), "font.name.fixed.", _SPM(SetFontName), PR_FALSE, { -1 } },
{ CFSTR("WebKitDefaultFixedFontSize"), _SPM(INT), "font.size.fixed.", _SPM(SetFontSize), PR_FALSE, { -1 } },
{ CFSTR("WebKitMinimumFontSize"), _SPM(INT), "font.minimum-size.", _SPM(SetFontSize), PR_FALSE, { -1 } },
{ CFSTR("WebKitDisplayImagesKey"), _SPM(BOOL), "permissions.default.image", _SPM(SetDisplayImages), PR_FALSE, { -1 } },
{ CFSTR("WebKitJavaEnabled"), _SPM(BOOL), "security.enable_java", _SPM(SetBool), PR_FALSE, { -1 } },
{ CFSTR("WebKitJavaScriptEnabled"), _SPM(BOOL), "javascript.enabled", _SPM(SetBool), PR_FALSE, { -1 } },
{ CFSTR("WebKitJavaScriptCanOpenWindowsAutomatically"),
_SPM(BOOL), "dom.disable_open_during_load", _SPM(SetBoolInverted), PR_FALSE, -1 }
_SPM(BOOL), "dom.disable_open_during_load", _SPM(SetBoolInverted), PR_FALSE, { -1 } }
};
nsresult

View File

@ -67,7 +67,7 @@ public:
struct PrefTransform {
CFStringRef keyName;
PrefType type;
char* targetPrefName;
const char* targetPrefName;
prefConverter prefSetterFunc;
PRBool prefHasValue;
union {

View File

@ -105,9 +105,9 @@ struct LiteralArray {
#define GLYPHS LiteralArray
struct TestEntry {
TestEntry (char *aUTF8FamilyString,
TestEntry (const char *aUTF8FamilyString,
const gfxFontStyle& aFontStyle,
char *aString)
const char *aString)
: utf8FamilyString(aUTF8FamilyString),
fontStyle(aFontStyle),
stringType(S_ASCII),
@ -116,10 +116,10 @@ struct TestEntry {
{
}
TestEntry (char *aUTF8FamilyString,
TestEntry (const char *aUTF8FamilyString,
const gfxFontStyle& aFontStyle,
int stringType,
char *aString)
const char *aString)
: utf8FamilyString(aUTF8FamilyString),
fontStyle(aFontStyle),
stringType(stringType),
@ -211,11 +211,11 @@ struct TestEntry {
return PR_TRUE;
}
char *utf8FamilyString;
const char *utf8FamilyString;
gfxFontStyle fontStyle;
int stringType;
char *string;
const char *string;
PRPackedBool isRTL;
nsTArray<ExpectItem> expectItems;
@ -237,10 +237,10 @@ MakeContext ()
}
TestEntry*
AddTest (char *utf8FamilyString,
AddTest (const char *utf8FamilyString,
const gfxFontStyle& fontStyle,
int stringType,
char *string)
const char *string)
{
TestEntry te (utf8FamilyString,
fontStyle,
@ -302,7 +302,7 @@ RunTest (TestEntry *test, gfxContext *ctx) {
if (test->stringType == S_ASCII) {
flags |= gfxTextRunFactory::TEXT_IS_ASCII | gfxTextRunFactory::TEXT_IS_8BIT;
length = strlen(test->string);
textRun = gfxTextRunWordCache::MakeTextRun(reinterpret_cast<PRUint8*>(test->string), length, fontGroup, &params, flags);
textRun = gfxTextRunWordCache::MakeTextRun(reinterpret_cast<const PRUint8*>(test->string), length, fontGroup, &params, flags);
} else {
NS_ConvertUTF8toUTF16 str(nsDependentCString(test->string));
length = str.Length();

View File

@ -49,9 +49,9 @@
struct iso_lang_map
{
char* iso_code;
short mac_lang_code;
short mac_script_code;
const char* iso_code;
short mac_lang_code;
short mac_script_code;
};
typedef struct iso_lang_map iso_lang_map;
@ -162,8 +162,8 @@ const iso_lang_map lang_list[] = {
struct iso_country_map
{
char* iso_code;
short mac_region_code;
const char* iso_code;
short mac_region_code;
};
typedef struct iso_country_map iso_country_map;

View File

@ -1341,8 +1341,7 @@ nsNSSCertificateDB::getCertNames(CERTCertList *certList,
if (sc) *sc = DELIM;
}
}
if (!namestr) namestr = "";
nsAutoString certname = NS_ConvertASCIItoUTF16(namestr);
nsAutoString certname = NS_ConvertASCIItoUTF16(namestr ? namestr : "");
certstr.Append(PRUnichar(DELIM));
certstr += certname;
certstr.Append(PRUnichar(DELIM));