Make lots of static data const. Bug 74803. r=dbaron, sr=alecf

This commit is contained in:
sfraser%netscape.com 2006-05-17 02:39:13 +00:00
Родитель 703920816e
Коммит 25bb2b740e
4 изменённых файлов: 20 добавлений и 20 удалений

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

@ -113,7 +113,7 @@ NS_IMETHODIMP nsUnicodeDecodeHelper::ConvertByMultiTable(
PRUnichar * aDest,
PRInt32 * aDestLength,
PRInt32 aTableCount,
uRange * aRangeArray,
const uRange * aRangeArray,
uShiftTable ** aShiftTable,
uMappingTable ** aMappingTable)
{
@ -221,7 +221,7 @@ NS_IMETHODIMP nsUnicodeDecodeHelper::ConvertByFastTable(
PRInt32 * aSrcLength,
PRUnichar * aDest,
PRInt32 * aDestLength,
PRUnichar * aFastTable,
const PRUnichar * aFastTable,
PRInt32 aTableSize)
{
PRUint8 * src = (PRUint8 *)aSrc;

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

@ -75,11 +75,11 @@ public:
NS_IMETHOD ConvertByMultiTable(const char * aSrc, PRInt32 * aSrcLength,
PRUnichar * aDest, PRInt32 * aDestLength, PRInt32 aTableCount,
uRange * aRangeArray, uShiftTable ** aShiftTable,
const uRange * aRangeArray, uShiftTable ** aShiftTable,
uMappingTable ** aMappingTable);
NS_IMETHOD ConvertByFastTable(const char * aSrc, PRInt32 * aSrcLength,
PRUnichar * aDest, PRInt32 * aDestLength, PRUnichar * aFastTable,
PRUnichar * aDest, PRInt32 * aDestLength, const PRUnichar * aFastTable,
PRInt32 aTableSize);
NS_IMETHOD CreateFastTable( uShiftTable * aShiftTable,

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

@ -278,7 +278,7 @@ PRIVATE PRBool uGenAlways3ByteUTF8(
/*=================================================================================
=================================================================================*/
PRIVATE uGeneratorFunc m_generator[uNumOfCharsetType] =
PRIVATE const uGeneratorFunc m_generator[uNumOfCharsetType] =
{
uCheckAndGenAlways1Byte,
uCheckAndGenAlways2Byte,
@ -307,7 +307,7 @@ PRIVATE uGeneratorFunc m_generator[uNumOfCharsetType] =
=================================================================================*/
PRIVATE uSubGeneratorFunc m_subgenerator[uNumOfCharType] =
PRIVATE const uSubGeneratorFunc m_subgenerator[uNumOfCharType] =
{
uGenAlways1Byte,
uGenAlways2Byte,
@ -486,7 +486,7 @@ PRIVATE PRBool uCheckAndGenByTable(
)
{
PRInt16 i;
uShiftCell* cell = &(shift->shiftcell[0]);
const uShiftCell* cell = &(shift->shiftcell[0]);
PRInt16 itemnum = shift->numOfItem;
unsigned char inH, inL;
inH = (in >> 8) & 0xff;
@ -785,12 +785,12 @@ PRIVATE PRBool uGenDecomposedHangulCommon(
return PR_FALSE;
else
{
static PRUint8 lMap[LCount] = {
static const PRUint8 lMap[LCount] = {
0xa1, 0xa2, 0xa4, 0xa7, 0xa8, 0xa9, 0xb1, 0xb2, 0xb3, 0xb5,
0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe
};
static PRUint8 tMap[TCount] = {
static const PRUint8 tMap[TCount] = {
0xd4, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa9, 0xaa,
0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb4, 0xb5,
0xb6, 0xb7, 0xb8, 0xba, 0xbb, 0xbc, 0xbd, 0xbe
@ -867,20 +867,20 @@ PRIVATE PRBool uCheckAndGenJohabHangul(
for detail explaination of the following table
*/
/*
static PRUint8 lMap[LCount] = {
static const PRUint8 lMap[LCount] = {
2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
};
Therefore lMap[i] == i+2;
*/
static PRUint8 vMap[VCount] = {
static const PRUint8 vMap[VCount] = {
/* no 0,1,2 */
3,4,5,6,7, /* no 8,9 */
10,11,12,13,14,15, /* no 16,17 */
18,19,20,21,22,23, /* no 24,25 */
26,27,28,29
};
static PRUint8 tMap[TCount] = {
static const PRUint8 tMap[TCount] = {
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17, /* no 18 */
19,20,21,22,23,24,25,26,27,28,29
};

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

@ -276,7 +276,7 @@ PRIVATE PRBool uScanAlways3ByteUTF8(
/*=================================================================================
=================================================================================*/
PRIVATE uScannerFunc m_scanner[uNumOfCharsetType] =
PRIVATE const uScannerFunc m_scanner[uNumOfCharsetType] =
{
uCheckAndScanAlways1Byte,
uCheckAndScanAlways2Byte,
@ -305,7 +305,7 @@ PRIVATE uScannerFunc m_scanner[uNumOfCharsetType] =
=================================================================================*/
PRIVATE uSubScannerFunc m_subscanner[uNumOfCharType] =
PRIVATE const uSubScannerFunc m_subscanner[uNumOfCharType] =
{
uScanAlways1Byte,
uScanAlways2Byte,
@ -518,7 +518,7 @@ PRIVATE PRBool uCheckAndScanByTable(
)
{
PRInt16 i;
uShiftCell* cell = &(shift->shiftcell[0]);
const uShiftCell* cell = &(shift->shiftcell[0]);
PRInt16 itemnum = shift->numOfItem;
for(i=0;i<itemnum;i++)
{
@ -805,7 +805,7 @@ PRIVATE PRBool uScanDecomposedHangulCommon(
return PR_FALSE;
}
else {
static PRUint8 lMap[] = {
static const PRUint8 lMap[] = {
/* A1 A2 A3 A4 A5 A6 A7 */
0, 1,0xff, 2,0xff,0xff, 3,
/* A8 A9 AA AB AC AD AE AF */
@ -838,7 +838,7 @@ PRIVATE PRBool uScanDecomposedHangulCommon(
return PR_FALSE;
}
else {
static PRUint8 tMap[] = {
static const PRUint8 tMap[] = {
/* A1 A2 A3 A4 A5 A6 A7 */
1, 2, 3, 4, 5, 6, 7,
/* A8 A9 AA AB AC AD AE AF */
@ -905,19 +905,19 @@ PRIVATE PRBool uCheckAndScanJohabHangul(
* See Table 4-45 Johab Encoding's Five-Bit Binary Patterns in page 183
* of "CJKV Information Processing" for details
*/
static PRUint8 lMap[32]={ /* totaly 19 */
static const PRUint8 lMap[32]={ /* totaly 19 */
0xff,0xff,0, 1, 2, 3, 4, 5, /* 0-7 */
6, 7, 8, 9, 10, 11, 12, 13, /* 8-15 */
14, 15, 16, 17, 18, 0xff,0xff,0xff, /* 16-23 */
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff /* 24-31 */
};
static PRUint8 vMap[32]={ /* totaly 21 */
static const PRUint8 vMap[32]={ /* totaly 21 */
0xff,0xff,0xff,0, 1, 2, 3, 4, /* 0-7 */
0xff,0xff,5, 6, 7, 8, 9, 10, /* 8-15 */
0xff,0xff,11, 12, 13, 14, 15, 16, /* 16-23 */
0xff,0xff,17, 18, 19, 20, 0xff,0xff /* 24-31 */
};
static PRUint8 tMap[32]={ /* totaly 29 */
static const PRUint8 tMap[32]={ /* totaly 29 */
0xff,0, 1, 2, 3, 4, 5, 6, /* 0-7 */
7, 8, 9, 10, 11, 12, 13, 14, /* 8-15 */
15, 16, 0xff,17, 18, 19, 20, 21, /* 16-23 */