зеркало из https://github.com/mozilla/pjs.git
Bug 74803: fix the data in various static name tables to be const, and fix nsStaticNameTable to accept const data. r=dbaron, sr=alecf.
This commit is contained in:
Родитель
eace838ad1
Коммит
f7fd0a80ef
|
@ -43,7 +43,7 @@
|
|||
|
||||
// define an array of all CSS keywords
|
||||
#define CSS_KEY(_name,_id) #_name,
|
||||
const char* kCSSRawKeywords[] = {
|
||||
const char* const kCSSRawKeywords[] = {
|
||||
#include "nsCSSKeywordList.h"
|
||||
};
|
||||
#undef CSS_KEY
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
// define an array of all CSS properties
|
||||
#define CSS_PROP(_name, _id, _method, _hint) #_name,
|
||||
const char* kCSSRawProperties[] = {
|
||||
const char* const kCSSRawProperties[] = {
|
||||
#include "nsCSSPropList.h"
|
||||
};
|
||||
#undef CSS_PROP
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include "XMLUtils.h"
|
||||
|
||||
#define EMPTY_ELEMENTS_COUNT 13
|
||||
const char* kHTMLEmptyTags[] =
|
||||
const char* const kHTMLEmptyTags[] =
|
||||
{
|
||||
"area",
|
||||
"base",
|
||||
|
@ -63,7 +63,7 @@ const char* kHTMLEmptyTags[] =
|
|||
};
|
||||
|
||||
#define SHORTHAND_ATTR_COUNT 12
|
||||
const char* kHTMLEmptyAttributes[] =
|
||||
const char* const kHTMLEmptyAttributes[] =
|
||||
{
|
||||
"checked",
|
||||
"compact",
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
// define an array of all color names
|
||||
#define GFX_COLOR(_name, _value) #_name,
|
||||
const char* kColorNames[] = {
|
||||
const char* const kColorNames[] = {
|
||||
#include "nsColorNameList.h"
|
||||
};
|
||||
#undef GFX_COLOR
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
// define an array of all CSS keywords
|
||||
#define CSS_KEY(_name,_id) #_name,
|
||||
const char* kCSSRawKeywords[] = {
|
||||
const char* const kCSSRawKeywords[] = {
|
||||
#include "nsCSSKeywordList.h"
|
||||
};
|
||||
#undef CSS_KEY
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
// define an array of all CSS properties
|
||||
#define CSS_PROP(_name, _id, _method, _hint) #_name,
|
||||
const char* kCSSRawProperties[] = {
|
||||
const char* const kCSSRawProperties[] = {
|
||||
#include "nsCSSPropList.h"
|
||||
};
|
||||
#undef CSS_PROP
|
||||
|
|
|
@ -121,11 +121,11 @@ nsStaticCaseInsensitiveNameTable::~nsStaticCaseInsensitiveNameTable()
|
|||
}
|
||||
|
||||
PRBool
|
||||
nsStaticCaseInsensitiveNameTable::Init(const char* Names[], PRInt32 Count)
|
||||
nsStaticCaseInsensitiveNameTable::Init(const char* const aNames[], PRInt32 Count)
|
||||
{
|
||||
NS_ASSERTION(!mNameArray, "double Init");
|
||||
NS_ASSERTION(!mNameTable.ops, "double Init");
|
||||
NS_ASSERTION(Names, "null name table");
|
||||
NS_ASSERTION(aNames, "null name table");
|
||||
NS_ASSERTION(Count, "0 count");
|
||||
|
||||
mNameArray = (nsDependentCString*)nsMemory::Alloc(Count * sizeof(nsDependentCString));
|
||||
|
@ -136,7 +136,7 @@ nsStaticCaseInsensitiveNameTable::Init(const char* Names[], PRInt32 Count)
|
|||
}
|
||||
|
||||
for (PRInt32 index = 0; index < Count; ++index) {
|
||||
char* raw = (char*) Names[index];
|
||||
const char* raw = aNames[index];
|
||||
#ifdef DEBUG
|
||||
{
|
||||
// verify invariants of contents
|
||||
|
|
|
@ -59,7 +59,7 @@ class NS_COM nsStaticCaseInsensitiveNameTable
|
|||
public:
|
||||
enum { NOT_FOUND = -1 };
|
||||
|
||||
PRBool Init(const char* Names[], PRInt32 Count);
|
||||
PRBool Init(const char* const aNames[], PRInt32 Count);
|
||||
PRInt32 Lookup(const nsACString& aName);
|
||||
PRInt32 Lookup(const nsAString& aName);
|
||||
const nsAFlatCString& GetStringValue(PRInt32 index);
|
||||
|
|
Загрузка…
Ссылка в новой задаче