Bug 483899 - Fix GCC warnings in browser/components/migration/src/. r+sr=jst

This commit is contained in:
Blake Kaplan 2009-03-18 17:23:30 -07:00
Родитель 17594536b7
Коммит 663689ee49
5 изменённых файлов: 62 добавлений и 61 удалений

Просмотреть файл

@ -396,36 +396,36 @@ nsDogbertProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
static
nsDogbertProfileMigrator::PrefTransform gTransforms[] = {
// Simple Copy Prefs
{ "browser.anchor_color", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "browser.visited_color", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "browser.startup.homepage", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "security.enable_java", 0, F(GetBool), F(SetBool), PR_FALSE, -1 },
{ "network.cookie.cookieBehavior", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "network.cookie.warnAboutCookies",0, F(GetBool), F(SetBool), PR_FALSE, -1 },
{ "javascript.enabled", 0, F(GetBool), F(SetBool), PR_FALSE, -1 },
{ "network.proxy.type", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "network.proxy.no_proxies_on", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "network.proxy.autoconfig_url", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "network.proxy.ftp", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "network.proxy.ftp_port", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "network.proxy.gopher", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "network.proxy.gopher_port", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "network.proxy.http", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "network.proxy.http_port", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "network.proxy.ssl", 0, F(GetString), F(SetString), PR_FALSE, -1 },
{ "network.proxy.ssl_port", 0, F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "browser.anchor_color", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "browser.visited_color", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "browser.startup.homepage", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "security.enable_java", 0, F(GetBool), F(SetBool), PR_FALSE, { -1 } },
{ "network.cookie.cookieBehavior", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
{ "network.cookie.warnAboutCookies",0, F(GetBool), F(SetBool), PR_FALSE, { -1 } },
{ "javascript.enabled", 0, F(GetBool), F(SetBool), PR_FALSE, { -1 } },
{ "network.proxy.type", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
{ "network.proxy.no_proxies_on", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "network.proxy.autoconfig_url", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "network.proxy.ftp", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "network.proxy.ftp_port", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
{ "network.proxy.gopher", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "network.proxy.gopher_port", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
{ "network.proxy.http", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "network.proxy.http_port", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
{ "network.proxy.ssl", 0, F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "network.proxy.ssl_port", 0, F(GetInt), F(SetInt), PR_FALSE, { -1 } },
// Prefs with Different Names
{ "network.hosts.socks_server", "network.proxy.socks", F(GetString), F(SetString), PR_FALSE, -1 },
{ "network.hosts.socks_serverport", "network.proxy.socks_port", F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "browser.background_color", "browser.display.background_color", F(GetString), F(SetString), PR_FALSE, -1 },
{ "browser.foreground_color", "browser.display.foreground_color", F(GetString), F(SetString), PR_FALSE, -1 },
{ "browser.wfe.use_windows_colors", "browser.display.use_system_colors", F(GetBool), F(SetBool), PR_FALSE, -1 },
{ "browser.use_document_colors", "browser.display.use_document_colors",F(GetBool), F(SetBool), PR_FALSE, -1 },
{ "browser.use_document.fonts", "browser.display.use_document_fonts", F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "browser.link_expiration", "browser.history_expire_days", F(GetInt), F(SetInt), PR_FALSE, -1 },
{ "browser.startup.page", "browser.startup.homepage", F(GetHomepage), F(SetWStringFromASCII), PR_FALSE, -1 },
{ "general.always_load_images", "permissions.default.image", F(GetImagePref),F(SetInt), PR_FALSE, -1 },
{ "network.hosts.socks_server", "network.proxy.socks", F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "network.hosts.socks_serverport", "network.proxy.socks_port", F(GetInt), F(SetInt), PR_FALSE, { -1 } },
{ "browser.background_color", "browser.display.background_color", F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "browser.foreground_color", "browser.display.foreground_color", F(GetString), F(SetString), PR_FALSE, { -1 } },
{ "browser.wfe.use_windows_colors", "browser.display.use_system_colors", F(GetBool), F(SetBool), PR_FALSE, { -1 } },
{ "browser.use_document_colors", "browser.display.use_document_colors",F(GetBool), F(SetBool), PR_FALSE, { -1 } },
{ "browser.use_document.fonts", "browser.display.use_document_fonts", F(GetInt), F(SetInt), PR_FALSE, { -1 } },
{ "browser.link_expiration", "browser.history_expire_days", F(GetInt), F(SetInt), PR_FALSE, { -1 } },
{ "browser.startup.page", "browser.startup.homepage", F(GetHomepage), F(SetWStringFromASCII), PR_FALSE, { -1 } },
{ "general.always_load_images", "permissions.default.image", F(GetImagePref),F(SetInt), PR_FALSE, { -1 } },
};
nsresult

Просмотреть файл

@ -132,7 +132,7 @@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry(nsILocalFile* aRegistr
// "migrated" is "yes" for all valid Seamonkey profiles. It is only "no"
// for 4.x profiles.
char migratedStr[3];
errCode = NR_RegGetEntryString(reg, profileKey, "migrated",
errCode = NR_RegGetEntryString(reg, profileKey, (char *)"migrated",
migratedStr, sizeof(migratedStr));
if ((errCode != REGERR_OK && errCode != REGERR_BUFTOOSMALL) ||
strcmp(migratedStr, "no") == 0)
@ -142,13 +142,13 @@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry(nsILocalFile* aRegistr
REGINFO regInfo;
regInfo.size = sizeof(REGINFO);
if (NR_RegGetEntryInfo(reg, profileKey, "directory", &regInfo))
if (NR_RegGetEntryInfo(reg, profileKey, (char *)"directory", &regInfo))
continue;
nsCAutoString dirStr;
dirStr.SetLength(regInfo.entryLength);
errCode = NR_RegGetEntryString(reg, profileKey, "directory",
errCode = NR_RegGetEntryString(reg, profileKey, (char *)"directory",
dirStr.BeginWriting(), regInfo.entryLength);
// Remove trailing \0
dirStr.SetLength(regInfo.entryLength-1);

Просмотреть файл

@ -56,8 +56,8 @@ public:
typedef nsresult(*prefConverter)(void*, nsIPrefBranch*);
struct PrefTransform {
char* sourcePrefName;
char* targetPrefName;
const char* sourcePrefName;
const char* targetPrefName;
prefConverter prefGetterFunc;
prefConverter prefSetterFunc;
PRBool prefHasValue;

Просмотреть файл

@ -314,26 +314,26 @@ nsOperaProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
static
nsOperaProfileMigrator::PrefTransform gTransforms[] = {
{ "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), PR_FALSE, -1 },
{ nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), PR_FALSE, -1 },
{ nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), PR_FALSE, -1 },
{ nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), PR_FALSE, -1 },
{ "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), PR_FALSE, { -1 } },
{ nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), PR_FALSE, { -1 } },
{ nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), PR_FALSE, { -1 } },
{ nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), PR_FALSE, { -1 } },
{ "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), PR_FALSE, -1 },
{ "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), PR_FALSE, -1 },
{ nsnull, "Underline", _OPM(BOOL), "browser.underline_anchors", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Expiry", _OPM(INT), "browser.history_expire_days", _OPM(SetInt), PR_FALSE, -1 },
{ "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), PR_FALSE, { -1 } },
{ "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), PR_FALSE, { -1 } },
{ nsnull, "Underline", _OPM(BOOL), "browser.underline_anchors", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Expiry", _OPM(INT), "browser.history_expire_days", _OPM(SetInt), PR_FALSE, { -1 } },
{ "Security Prefs", "Enable SSL v2", _OPM(BOOL), "security.enable_ssl2", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Enable SSL v3", _OPM(BOOL), "security.enable_ssl3", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Enable TLS v1.0", _OPM(BOOL), "security.enable_tls", _OPM(SetBool), PR_FALSE, -1 },
{ "Security Prefs", "Enable SSL v2", _OPM(BOOL), "security.enable_ssl2", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Enable SSL v3", _OPM(BOOL), "security.enable_ssl3", _OPM(SetBool), PR_FALSE, { -1 } },
{ nsnull, "Enable TLS v1.0", _OPM(BOOL), "security.enable_tls", _OPM(SetBool), PR_FALSE, { -1 } },
{ "Extensions", "Scripting", _OPM(BOOL), "javascript.enabled", _OPM(SetBool), PR_FALSE, -1 }
{ "Extensions", "Scripting", _OPM(BOOL), "javascript.enabled", _OPM(SetBool), PR_FALSE, { -1 } }
};
nsresult
@ -420,7 +420,7 @@ nsOperaProfileMigrator::CopyPreferences(PRBool aReplace)
PrefTransform* transform;
PrefTransform* end = gTransforms + sizeof(gTransforms)/sizeof(PrefTransform);
char* lastSectionName = nsnull;
const char* lastSectionName = nsnull;
for (transform = gTransforms; transform < end; ++transform) {
if (transform->sectionName)
lastSectionName = transform->sectionName;
@ -430,7 +430,7 @@ nsOperaProfileMigrator::CopyPreferences(PRBool aReplace)
nsresult rv = ParseColor(parser, lastSectionName, &colorString);
if (NS_SUCCEEDED(rv)) {
transform->stringValue = colorString;
transform->prefHasValue = PR_TRUE;
transform->prefSetterFunc(transform, branch);
}
@ -881,9 +881,10 @@ nsOperaCookieMigrator::AddCookieOverride(nsIPermissionManager* aManager)
return NS_ERROR_OUT_OF_MEMORY;
uri->SetHost(domain);
rv = aManager->Add(uri, "cookie",
(mCurrHandlingInfo == 1 || mCurrHandlingInfo == 3) ? nsIPermissionManager::ALLOW_ACTION :
nsIPermissionManager::DENY_ACTION);
rv = aManager->Add(uri, "cookie",
(mCurrHandlingInfo == 1 || mCurrHandlingInfo == 3)
? (PRUint32) nsIPermissionManager::ALLOW_ACTION
: (PRUint32) nsIPermissionManager::DENY_ACTION);
mCurrHandlingInfo = 0;
@ -1164,10 +1165,10 @@ nsOperaProfileMigrator::CopySmartKeywords(nsINavBookmarksService* aBMS,
continue;
PRUint32 length = name.Length();
PRInt32 index = 0;
PRInt32 index = 0;
do {
index = name.FindChar('&', index);
if (index >= length - 2)
if ((PRUint32)index >= length - 2)
break;
// Assume "&&" is an escaped ampersand in the search query title.
@ -1179,7 +1180,7 @@ nsOperaProfileMigrator::CopySmartKeywords(nsINavBookmarksService* aBMS,
name.Cut(index, 1);
}
while (index < length);
while ((PRUint32)index < length);
nsCOMPtr<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), url.get());

Просмотреть файл

@ -74,10 +74,10 @@ public:
typedef nsresult(*prefConverter)(void*, nsIPrefBranch*);
struct PrefTransform {
char* sectionName;
char* keyName;
const char* sectionName;
const char* keyName;
PrefType type;
char* targetPrefName;
const char* targetPrefName;
prefConverter prefSetterFunc;
PRBool prefHasValue;
union {