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

This commit is contained in:
sfraser%netscape.com 2003-02-26 01:15:36 +00:00
parent 225e4b4592
commit eab5d38cb2
71 changed files with 237 additions and 228 deletions

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 BIG5_cls [ 256 / 8 ] = {
static const PRUint32 BIG5_cls [ 256 / 8 ] = {
PCK4BITS(1,1,1,1,1,1,1,1), // 00 - 07
PCK4BITS(1,1,1,1,1,1,0,0), // 08 - 0f
PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(3,3,3,3,3,3,3,0) // f8 - ff
};
static PRUint32 BIG5_st [ 3] = {
static const PRUint32 BIG5_st [ 3] = {
PCK4BITS(eError,eStart,eStart, 3,eError,eError,eError,eError),//00-07
PCK4BITS(eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError),//08-0f
PCK4BITS(eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart) //10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 CP1252_cls [ 256 / 8 ] = {
static const PRUint32 CP1252_cls [ 256 / 8 ] = {
PCK4BITS(2,2,2,2,2,2,2,2), // 00 - 07
PCK4BITS(2,2,2,2,2,2,0,0), // 08 - 0f
PCK4BITS(2,2,2,2,2,2,2,2), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(1,1,1,1,1,1,1,1) // f8 - ff
};
static PRUint32 CP1252_st [ 3] = {
static const PRUint32 CP1252_st [ 3] = {
PCK4BITS(eError, 3,eStart,eError,eError,eError,eItsMe,eItsMe),//00-07
PCK4BITS(eItsMe,eError, 4,eStart,eError, 5, 4,eError),//08-0f
PCK4BITS(eError, 4,eStart,eStart,eStart,eStart,eStart,eStart) //10-17

View File

@ -47,7 +47,7 @@
the "Cyrillic Software Suite" written by John Neystdt.
http://www.neystadt.org/cyrillic (You can also find it from CPAN)
*/
PRUint16 gCyrillicProb[33][33] = {{
const PRUint16 gCyrillicProb[33][33] = {{
0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 EUCJP_cls [ 256 / 8 ] = {
static const PRUint32 EUCJP_cls [ 256 / 8 ] = {
PCK4BITS(4,4,4,4,4,4,4,4), // 00 - 07
PCK4BITS(4,4,4,4,4,4,5,5), // 08 - 0f
PCK4BITS(4,4,4,4,4,4,4,4), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(0,0,0,0,0,0,0,5) // f8 - ff
};
static PRUint32 EUCJP_st [ 5] = {
static const PRUint32 EUCJP_st [ 5] = {
PCK4BITS( 3, 4, 3, 5,eStart,eError,eError,eError),//00-07
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
PCK4BITS(eItsMe,eItsMe,eStart,eError,eStart,eError,eError,eError),//10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 EUCKR_cls [ 256 / 8 ] = {
static const PRUint32 EUCKR_cls [ 256 / 8 ] = {
PCK4BITS(1,1,1,1,1,1,1,1), // 00 - 07
PCK4BITS(1,1,1,1,1,1,0,0), // 08 - 0f
PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(2,2,2,2,2,2,2,0) // f8 - ff
};
static PRUint32 EUCKR_st [ 2] = {
static const PRUint32 EUCKR_st [ 2] = {
PCK4BITS(eError,eStart, 3,eError,eError,eError,eError,eError),//00-07
PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart) //08-0f
};

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 EUCTW_cls [ 256 / 8 ] = {
static const PRUint32 EUCTW_cls [ 256 / 8 ] = {
PCK4BITS(2,2,2,2,2,2,2,2), // 00 - 07
PCK4BITS(2,2,2,2,2,2,0,0), // 08 - 0f
PCK4BITS(2,2,2,2,2,2,2,2), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(3,3,3,3,3,3,3,0) // f8 - ff
};
static PRUint32 EUCTW_st [ 6] = {
static const PRUint32 EUCTW_st [ 6] = {
PCK4BITS(eError,eError,eStart, 3, 3, 3, 4,eError),//00-07
PCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//08-0f
PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eStart,eError),//10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 gb18030_cls [ 256 / 8 ] = {
static const PRUint32 gb18030_cls [ 256 / 8 ] = {
PCK4BITS(1,1,1,1,1,1,1,1), // 00 - 07
PCK4BITS(1,1,1,1,1,1,0,0), // 08 - 0f
PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(6,6,6,6,6,6,6,0) // f8 - ff
};
static PRUint32 gb18030_st [ 6] = {
static const PRUint32 gb18030_st [ 6] = {
PCK4BITS(eError,eStart,eStart,eStart,eStart,eStart, 3,eError),//00-07
PCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//08-0f
PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart),//10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 GB2312_cls [ 256 / 8 ] = {
static const PRUint32 GB2312_cls [ 256 / 8 ] = {
PCK4BITS(1,1,1,1,1,1,1,1), // 00 - 07
PCK4BITS(1,1,1,1,1,1,0,0), // 08 - 0f
PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(2,2,2,2,2,2,2,0) // f8 - ff
};
static PRUint32 GB2312_st [ 2] = {
static const PRUint32 GB2312_st [ 2] = {
PCK4BITS(eError,eStart, 3,eError,eError,eError,eError,eError),//00-07
PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart) //08-0f
};

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 HZ_cls [ 256 / 8 ] = {
static const PRUint32 HZ_cls [ 256 / 8 ] = {
PCK4BITS(1,0,0,0,0,0,0,0), // 00 - 07
PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(1,1,1,1,1,1,1,1) // f8 - ff
};
static PRUint32 HZ_st [ 6] = {
static const PRUint32 HZ_st [ 6] = {
PCK4BITS(eStart,eError, 3,eStart,eStart,eStart,eError,eError),//00-07
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
PCK4BITS(eItsMe,eItsMe,eError,eError,eStart,eStart, 4,eError),//10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 ISO2022CN_cls [ 256 / 8 ] = {
static const PRUint32 ISO2022CN_cls [ 256 / 8 ] = {
PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
};
static PRUint32 ISO2022CN_st [ 8] = {
static const PRUint32 ISO2022CN_st [ 8] = {
PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eStart,eStart),//00-07
PCK4BITS(eStart,eError,eError,eError,eError,eError,eError,eError),//08-0f
PCK4BITS(eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 ISO2022JP_cls [ 256 / 8 ] = {
static const PRUint32 ISO2022JP_cls [ 256 / 8 ] = {
PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
PCK4BITS(0,0,0,0,0,0,2,2), // 08 - 0f
PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
};
static PRUint32 ISO2022JP_st [ 6] = {
static const PRUint32 ISO2022JP_st [ 6] = {
PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eStart,eStart),//00-07
PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//08-0f
PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 ISO2022KR_cls [ 256 / 8 ] = {
static const PRUint32 ISO2022KR_cls [ 256 / 8 ] = {
PCK4BITS(2,0,0,0,0,0,0,0), // 00 - 07
PCK4BITS(0,0,0,0,0,0,0,0), // 08 - 0f
PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
};
static PRUint32 ISO2022KR_st [ 5] = {
static const PRUint32 ISO2022KR_st [ 5] = {
PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eError,eError),//00-07
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
PCK4BITS(eItsMe,eItsMe,eError,eError,eError, 4,eError,eError),//10-17

View File

@ -59,7 +59,7 @@
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kParserServiceCID, NS_PARSERSERVICE_CID);
static eHTMLTags gWatchTags[] =
static const eHTMLTags gWatchTags[] =
{ eHTMLTag_meta,
eHTMLTag_unknown
};

View File

@ -78,7 +78,7 @@ nsEUCStatistics gEUCKRStatistics =
May need improvement ....
*/
nsVerifier *gZhTwVerifierSet[ZHTW_DETECTOR_NUM_VERIFIERS] = {
nsVerifier* const gZhTwVerifierSet[ZHTW_DETECTOR_NUM_VERIFIERS] = {
&nsUTF8Verifier,
&nsBIG5Verifier,
&nsISO2022CNVerifier,
@ -88,7 +88,7 @@ nsVerifier *gZhTwVerifierSet[ZHTW_DETECTOR_NUM_VERIFIERS] = {
&nsUCS2LEVerifier
};
nsEUCStatistics *gZhTwStatisticsSet[ZHTW_DETECTOR_NUM_VERIFIERS] = {
nsEUCStatistics* const gZhTwStatisticsSet[ZHTW_DETECTOR_NUM_VERIFIERS] = {
nsnull,
&gBig5Statistics,
nsnull,
@ -100,7 +100,7 @@ nsEUCStatistics *gZhTwStatisticsSet[ZHTW_DETECTOR_NUM_VERIFIERS] = {
//==========================================================
nsVerifier *gKoVerifierSet[KO_DETECTOR_NUM_VERIFIERS] = {
nsVerifier* const gKoVerifierSet[KO_DETECTOR_NUM_VERIFIERS] = {
&nsUTF8Verifier,
&nsEUCKRVerifier,
&nsISO2022KRVerifier,
@ -111,7 +111,7 @@ nsVerifier *gKoVerifierSet[KO_DETECTOR_NUM_VERIFIERS] = {
//==========================================================
nsVerifier *gZhCnVerifierSet[ZHCN_DETECTOR_NUM_VERIFIERS] = {
nsVerifier* const gZhCnVerifierSet[ZHCN_DETECTOR_NUM_VERIFIERS] = {
&nsUTF8Verifier,
&nsGB2312Verifier,
&nsGB18030Verifier,
@ -124,7 +124,7 @@ nsVerifier *gZhCnVerifierSet[ZHCN_DETECTOR_NUM_VERIFIERS] = {
//==========================================================
nsVerifier *gJaVerifierSet[JA_DETECTOR_NUM_VERIFIERS] = {
nsVerifier* const gJaVerifierSet[JA_DETECTOR_NUM_VERIFIERS] = {
&nsUTF8Verifier,
&nsSJISVerifier,
&nsEUCJPVerifier,
@ -136,7 +136,7 @@ nsVerifier *gJaVerifierSet[JA_DETECTOR_NUM_VERIFIERS] = {
//==========================================================
nsVerifier *gZhVerifierSet[ZH_DETECTOR_NUM_VERIFIERS] = {
nsVerifier* const gZhVerifierSet[ZH_DETECTOR_NUM_VERIFIERS] = {
&nsUTF8Verifier,
&nsGB2312Verifier,
&nsGB18030Verifier,
@ -149,7 +149,7 @@ nsVerifier *gZhVerifierSet[ZH_DETECTOR_NUM_VERIFIERS] = {
&nsUCS2LEVerifier
};
nsEUCStatistics *gZhStatisticsSet[ZH_DETECTOR_NUM_VERIFIERS] = {
nsEUCStatistics* const gZhStatisticsSet[ZH_DETECTOR_NUM_VERIFIERS] = {
nsnull,
&gGB2312Statistics,
&gBig5Statistics,
@ -163,7 +163,7 @@ nsEUCStatistics *gZhStatisticsSet[ZH_DETECTOR_NUM_VERIFIERS] = {
//==========================================================
nsVerifier *gCJKVerifierSet[CJK_DETECTOR_NUM_VERIFIERS] = {
nsVerifier* const gCJKVerifierSet[CJK_DETECTOR_NUM_VERIFIERS] = {
&nsUTF8Verifier,
&nsSJISVerifier,
&nsEUCJPVerifier,
@ -181,7 +181,7 @@ nsVerifier *gCJKVerifierSet[CJK_DETECTOR_NUM_VERIFIERS] = {
&nsUCS2LEVerifier
};
nsEUCStatistics *gCJKStatisticsSet[CJK_DETECTOR_NUM_VERIFIERS] = {
nsEUCStatistics* const gCJKStatisticsSet[CJK_DETECTOR_NUM_VERIFIERS] = {
nsnull,
nsnull,
&gEUCJPStatistics,
@ -275,7 +275,7 @@ void nsEUCSampler::CalFreq()
//----------------------------------------------------------
NS_IMPL_ISUPPORTS1(nsXPCOMDetector, nsICharsetDetector);
NS_IMPL_ISUPPORTS1(nsXPCOMStringDetector, nsIStringCharsetDetector);
nsPSMDetector::nsPSMDetector(PRUint8 aItems, nsVerifier** aVerifierSet, nsEUCStatistics** aStatisticsSet)
nsPSMDetector::nsPSMDetector(PRUint8 aItems, nsVerifier* const * aVerifierSet, nsEUCStatistics* const * aStatisticsSet)
{
mClassRunSampler = (nsnull != aStatisticsSet);
mStatisticsData = aStatisticsSet;
@ -488,7 +488,7 @@ void nsPSMDetector::Sample(const char* aBuf, PRUint32 aLen, PRBool aLastChance)
} // if(mRunSampler)
}
//----------------------------------------------------------
nsXPCOMDetector::nsXPCOMDetector(PRUint8 aItems, nsVerifier **aVer, nsEUCStatistics** aStatisticsSet)
nsXPCOMDetector::nsXPCOMDetector(PRUint8 aItems, nsVerifier * const *aVer, nsEUCStatistics* const * aStatisticsSet)
: nsPSMDetector( aItems, aVer, aStatisticsSet)
{
mObserver = nsnull;
@ -534,7 +534,7 @@ void nsXPCOMDetector::Report(const char* charset)
mObserver->Notify(charset, eSureAnswer);
}
//----------------------------------------------------------
nsXPCOMStringDetector::nsXPCOMStringDetector(PRUint8 aItems, nsVerifier** aVer, nsEUCStatistics** aStatisticsSet)
nsXPCOMStringDetector::nsXPCOMStringDetector(PRUint8 aItems, nsVerifier* const * aVer, nsEUCStatistics* const * aStatisticsSet)
: nsPSMDetector( aItems, aVer, aStatisticsSet)
{
}

View File

@ -123,7 +123,9 @@ typedef struct {
float mSecoundByteStdDev;
float mSecoundByteMean;
float mSecoundByteWeight;
} nsEUCStatistics;
} nsEUCStatisticsMutable;
typedef const nsEUCStatisticsMutable nsEUCStatistics;
/*
extern nsEUCStatistics gBig5Statistics =
@ -157,25 +159,25 @@ static nsEUCStatistics gEUCKRStatistics =
May need improvement ....
*/
#define ZHTW_DETECTOR_NUM_VERIFIERS 7
extern nsVerifier *gZhTwVerifierSet[];
extern nsEUCStatistics *gZhTwStatisticsSet[];
extern nsVerifier* const gZhTwVerifierSet[];
extern nsEUCStatistics* const gZhTwStatisticsSet[];
#define KO_DETECTOR_NUM_VERIFIERS 6
extern nsVerifier *gKoVerifierSet[];
extern nsVerifier* const gKoVerifierSet[];
#define ZHCN_DETECTOR_NUM_VERIFIERS 8
extern nsVerifier *gZhCnVerifierSet[];
extern nsVerifier* const gZhCnVerifierSet[];
#define JA_DETECTOR_NUM_VERIFIERS 7
extern nsVerifier *gJaVerifierSet[];
extern nsVerifier* const gJaVerifierSet[];
#define ZH_DETECTOR_NUM_VERIFIERS 10
extern nsVerifier *gZhVerifierSet[];
extern nsEUCStatistics *gZhStatisticsSet[];
extern nsVerifier* const gZhVerifierSet[];
extern nsEUCStatistics* const gZhStatisticsSet[];
#define CJK_DETECTOR_NUM_VERIFIERS 15
extern nsVerifier *gCJKVerifierSet[];
extern nsEUCStatistics *gCJKStatisticsSet[];
extern nsVerifier* const gCJKVerifierSet[];
extern nsEUCStatistics* const gCJKStatisticsSet[];
class nsEUCSampler {
public:
@ -220,7 +222,7 @@ class nsEUCSampler {
//----------------------------------------------------------
class nsPSMDetector {
public :
nsPSMDetector(PRUint8 aItems, nsVerifier** aVerifierSet, nsEUCStatistics** aStatisticsSet);
nsPSMDetector(PRUint8 aItems, nsVerifier* const * aVerifierSet, nsEUCStatistics* const * aStatisticsSet);
virtual ~nsPSMDetector() {};
virtual PRBool HandleData(const char* aBuf, PRUint32 aLen);
@ -233,8 +235,8 @@ protected:
PRUint8 mClassItems;
PRUint8 mState[MAX_VERIFIERS];
PRUint8 mItemIdx[MAX_VERIFIERS];
nsVerifier** mVerifier;
nsEUCStatistics** mStatisticsData;
nsVerifier* const * mVerifier;
nsEUCStatistics* const * mStatisticsData;
PRBool mDone;
PRBool mRunSampler;
@ -257,7 +259,7 @@ class nsXPCOMDetector :
{
NS_DECL_ISUPPORTS
public:
nsXPCOMDetector(PRUint8 aItems, nsVerifier** aVer, nsEUCStatistics** aStatisticsSet);
nsXPCOMDetector(PRUint8 aItems, nsVerifier* const * aVer, nsEUCStatistics* const * aStatisticsSet);
virtual ~nsXPCOMDetector();
NS_IMETHOD Init(nsICharsetDetectionObserver* aObserver);
NS_IMETHOD DoIt(const char* aBuf, PRUint32 aLen, PRBool* oDontFeedMe);
@ -276,7 +278,7 @@ class nsXPCOMStringDetector :
{
NS_DECL_ISUPPORTS
public:
nsXPCOMStringDetector(PRUint8 aItems, nsVerifier** aVer, nsEUCStatistics** aStatisticsSet);
nsXPCOMStringDetector(PRUint8 aItems, nsVerifier* const * aVer, nsEUCStatistics* const * aStatisticsSet);
virtual ~nsXPCOMStringDetector();
NS_IMETHOD DoIt(const char* aBuf, PRUint32 aLen,
const char** oCharset,

View File

@ -69,7 +69,7 @@ typedef struct nsPkgInt {
nsSftMsk sftmsk;
nsBitSft bitsft;
nsUnitMsk unitmsk;
PRUint32 *data;
const PRUint32 *data;
} nsPkgInt;

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 SJIS_cls [ 256 / 8 ] = {
static const PRUint32 SJIS_cls [ 256 / 8 ] = {
PCK4BITS(1,1,1,1,1,1,1,1), // 00 - 07
PCK4BITS(1,1,1,1,1,1,0,0), // 08 - 0f
PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(4,4,4,4,4,0,0,0) // f8 - ff
};
static PRUint32 SJIS_st [ 3] = {
static PRUint32 const SJIS_st [ 3] = {
PCK4BITS(eError,eStart,eStart, 3,eError,eError,eError,eError),//00-07
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
PCK4BITS(eItsMe,eItsMe,eError,eError,eStart,eStart,eStart,eStart) //10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 UCS2BE_cls [ 256 / 8 ] = {
static const PRUint32 UCS2BE_cls [ 256 / 8 ] = {
PCK4BITS(0,0,0,0,0,0,0,0), // 00 - 07
PCK4BITS(0,0,1,0,0,2,0,0), // 08 - 0f
PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(0,0,0,0,0,0,4,5) // f8 - ff
};
static PRUint32 UCS2BE_st [ 7] = {
static const PRUint32 UCS2BE_st [ 7] = {
PCK4BITS( 5, 7, 7,eError, 4, 3,eError,eError),//00-07
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
PCK4BITS(eItsMe,eItsMe, 6, 6, 6, 6,eError,eError),//10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 UCS2LE_cls [ 256 / 8 ] = {
static const PRUint32 UCS2LE_cls [ 256 / 8 ] = {
PCK4BITS(0,0,0,0,0,0,0,0), // 00 - 07
PCK4BITS(0,0,1,0,0,2,0,0), // 08 - 0f
PCK4BITS(0,0,0,0,0,0,0,0), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(0,0,0,0,0,0,4,5) // f8 - ff
};
static PRUint32 UCS2LE_st [ 7] = {
static const PRUint32 UCS2LE_st [ 7] = {
PCK4BITS( 6, 6, 7, 6, 4, 3,eError,eError),//00-07
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
PCK4BITS(eItsMe,eItsMe, 5, 5, 5,eError,eItsMe,eError),//10-17

View File

@ -43,7 +43,7 @@
* if you have any question. Thanks
*/
#include "nsVerifier.h"
static PRUint32 UTF8_cls [ 256 / 8 ] = {
static const PRUint32 UTF8_cls [ 256 / 8 ] = {
PCK4BITS(1,1,1,1,1,1,1,1), // 00 - 07
PCK4BITS(1,1,1,1,1,1,0,0), // 08 - 0f
PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17
@ -79,7 +79,7 @@ PCK4BITS(12,13,13,13,14,15,0,0) // f8 - ff
};
static PRUint32 UTF8_st [ 26] = {
static const PRUint32 UTF8_st [ 26] = {
PCK4BITS(eError,eStart,eError,eError,eError,eError, 12, 10),//00-07
PCK4BITS( 9, 11, 8, 7, 6, 5, 4, 3),//08-0f
PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//10-17

View File

@ -46,12 +46,14 @@ typedef enum {
eItsMe = 2
} nsSMState;
typedef struct nsVerifier {
typedef struct _nsVerifierMutable {
const char* charset;
nsPkgInt cclass;
PRUint32 stFactor; // >= number of cclass.
nsPkgInt states;
} nsVerifier;
} nsVerifierMutable;
typedef const nsVerifierMutable nsVerifier;
#define GETCLASS(v,c) GETFROMPCK(((unsigned char)(c)), (v)->cclass)
#define GETNEXTSTATE(v,c,s) \

View File

@ -55,7 +55,7 @@
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static eHTMLTags gTags[] =
static const eHTMLTags gTags[] =
{ eHTMLTag_instruction,
eHTMLTag_unknown
};

View File

@ -132,7 +132,7 @@ void genCyrillicClass(const char* name, const char* charset)
printf("cannot locate %s Decoder\n", charset);
return;
}
printf("static PRUint8 %sMap [128] = {\n",name);
printf("static const PRUint8 %sMap [128] = {\n",name);
PRUint8 i,j;
for(i=0x80;i!=0x00;i+=0x10)
{

View File

@ -40,7 +40,7 @@ print FILE <<EOF;
*/
EOF
$table = \%Lingua::DetectCharset::StatKoi::StatsTableKoi;
print FILE "PRUint16 gCyrillicProb[33][33] = {";
print FILE "const PRUint16 gCyrillicProb[33][33] = {";
print FILE "{ \n";
print FILE "0,\n";
for($j = 0xc0; $j < 0xe0; $j++)

View File

@ -82,7 +82,7 @@ sub Gen4BitsClass {
my($cls);
my($ret);
$ret = "";
$ret .= "static PRUint32 " . $name . "_cls [ 256 / 8 ] = {\n";
$ret .= "static const PRUint32 " . $name . "_cls [ 256 / 8 ] = {\n";
for($i = 0; $i < 0x100; $i+= 8) {
$ret .= "PCK4BITS(";
for($j = $i; $j < $i + 8; $j++) {
@ -131,7 +131,7 @@ sub Gen4BitsState {
my($i,$j);
my($ret);
$ret = "";
$ret .= "static PRUint32 " . $name . "_st [ " . ($lenafterpad >> 3) . "] = {\n";
$ret .= "static const PRUint32 " . $name . "_st [ " . ($lenafterpad >> 3) . "] = {\n";
for($i = 0; $i < $lenafterpad ; $i+= 8) {
$ret .= "PCK4BITS(";
for($j = $i; $j < $i + 8; $j++) {

View File

@ -57,7 +57,7 @@ struct iso_lang_map
};
typedef struct iso_lang_map iso_lang_map;
iso_lang_map lang_list[] = {
const iso_lang_map lang_list[] = {
{ "sq", langAlbanian, smRoman },
{ "am", langAmharic, smEthiopic },
{ "ar", langArabic, smArabic },
@ -166,7 +166,7 @@ struct iso_country_map
typedef struct iso_country_map iso_country_map;
iso_country_map country_list[] = {
const iso_country_map country_list[] = {
{ "US", verUS},
{ "EG", verArabic},
{ "DZ", verArabic},

View File

@ -39,7 +39,7 @@
DO NOT EDIT THIS DOCUMENT !!! THIS DOCUMENT IS GENERATED BY
mozilla/intl/lwbrk/tools/anzx4501.pl
*/
static PRUint32 gLBClass00[32] = {
static const PRUint32 gLBClass00[32] = {
0x55555555, // U+0000 - U+0007
0x55555555, // U+0008 - U+000F
0x55555555, // U+0010 - U+0017
@ -74,7 +74,7 @@ static PRUint32 gLBClass00[32] = {
0x88888888, // U+00F8 - U+00FF
};
static PRUint32 gLBClass20[32] = {
static const PRUint32 gLBClass20[32] = {
0x55555555, // U+2000 - U+2007
0x88885555, // U+2008 - U+200F
0x88828888, // U+2010 - U+2017
@ -109,7 +109,7 @@ static PRUint32 gLBClass20[32] = {
0x88888888, // U+20F8 - U+20FF
};
static PRUint32 gLBClass21[32] = {
static const PRUint32 gLBClass21[32] = {
0x88888888, // U+2100 - U+2107
0x88888888, // U+2108 - U+210F
0x83888888, // U+2110 - U+2117
@ -144,7 +144,7 @@ static PRUint32 gLBClass21[32] = {
0x88888888, // U+21F8 - U+21FF
};
static PRUint32 gLBClass30[32] = {
static const PRUint32 gLBClass30[32] = {
0x55555115, // U+3000 - U+3007
0x10101010, // U+3008 - U+300F
0x10105510, // U+3010 - U+3017

View File

@ -199,7 +199,7 @@
#define MAX_CLASSES 10
static PRUint16 gPair[MAX_CLASSES] = {
static const PRUint16 gPair[MAX_CLASSES] = {
0x01FF,
0x0002,
0x0006,
@ -214,7 +214,7 @@ static PRUint16 gPair[MAX_CLASSES] = {
static inline int
GETCLASSFROMTABLE(PRUint32* t, PRUint16 l)
GETCLASSFROMTABLE(const PRUint32* t, PRUint16 l)
{
return ((((t)[(l>>3)]) >> ((l & 0x0007)<<2)) & 0x000f);
}

View File

@ -373,7 +373,7 @@ sub printarray
my($r, $def) = @_;
printf "[%s || %s]\n", $r, $def;
$k = hex($r) * 256;
printf HEADER "static PRUint32 gLBClass%s[32] = {\n", $r;
printf HEADER "static const PRUint32 gLBClass%s[32] = {\n", $r;
for($i = 0 ; $i < 256; $i+= 8)
{
for($j = 7 ; $j >= 0; $j-- )

View File

@ -85,14 +85,14 @@ 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) = 0;
/**
* Converts data using a fast lookup table.
*/
NS_IMETHOD ConvertByFastTable(const char * aSrc, PRInt32 * aSrcLength,
PRUnichar * aDest, PRInt32 * aDestLength, PRUnichar * aFastTable,
PRUnichar * aDest, PRInt32 * aDestLength, const PRUnichar * aFastTable,
PRInt32 aTableSize) = 0;
/**

View File

@ -103,7 +103,10 @@ typedef struct {
PRInt16 numOfItem;
PRInt16 classID;
uShiftCell shiftcell[1];
} uShiftTable;
} uShiftTableMutable;
typedef const uShiftTableMutable uShiftTable;
/*=====================================*/
@ -114,7 +117,8 @@ typedef struct {
/*=====================================*/
typedef PRUint16* uMappingTable;
typedef PRUint16* uMappingTableMutable;
typedef const PRUint16* uMappingTable;
#endif

View File

@ -492,123 +492,126 @@ static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
#define ENCODER_NAME_BASE "Unicode Encoder-"
// ucvja
PRUint16 g_uf0201Mapping[] = {
const PRUint16 g_uf0201Mapping[] = {
#include "jis0201.uf"
};
PRUint16 g_uf0201GLMapping[] = {
const PRUint16 g_uf0201GLMapping[] = {
#include "jis0201gl.uf"
};
PRUint16 g_uf0208Mapping[] = {
const PRUint16 g_uf0208Mapping[] = {
#include "jis0208.uf"
};
PRUint16 g_uf0208extMapping[] = {
const PRUint16 g_uf0208extMapping[] = {
#include "jis0208ext.uf"
};
PRUint16 g_uf0212Mapping[] = {
const PRUint16 g_uf0212Mapping[] = {
#include "jis0212.uf"
};
// ucvtw2
PRUint16 g_ufCNS1MappingTable[] = {
const PRUint16 g_ufCNS1MappingTable[] = {
#include "cns_1.uf"
};
PRUint16 g_ufCNS2MappingTable[] = {
const PRUint16 g_ufCNS2MappingTable[] = {
#include "cns_2.uf"
};
PRUint16 g_ufCNS3MappingTable[] = {
const PRUint16 g_ufCNS3MappingTable[] = {
#include "cns3.uf"
};
PRUint16 g_ufCNS4MappingTable[] = {
const PRUint16 g_ufCNS4MappingTable[] = {
#include "cns4.uf"
};
PRUint16 g_ufCNS5MappingTable[] = {
const PRUint16 g_ufCNS5MappingTable[] = {
#include "cns5.uf"
};
PRUint16 g_ufCNS6MappingTable[] = {
const PRUint16 g_ufCNS6MappingTable[] = {
#include "cns6.uf"
};
PRUint16 g_ufCNS7MappingTable[] = {
const PRUint16 g_ufCNS7MappingTable[] = {
#include "cns7.uf"
};
PRUint16 g_utCNS1MappingTable[] = {
const PRUint16 g_utCNS1MappingTable[] = {
#include "cns_1.ut"
};
PRUint16 g_utCNS2MappingTable[] = {
const PRUint16 g_utCNS2MappingTable[] = {
#include "cns_2.ut"
};
PRUint16 g_utCNS3MappingTable[] = {
const PRUint16 g_utCNS3MappingTable[] = {
#include "cns3.ut"
};
PRUint16 g_utCNS4MappingTable[] = {
const PRUint16 g_utCNS4MappingTable[] = {
#include "cns4.ut"
};
PRUint16 g_utCNS5MappingTable[] = {
const PRUint16 g_utCNS5MappingTable[] = {
#include "cns5.ut"
};
PRUint16 g_utCNS6MappingTable[] = {
const PRUint16 g_utCNS6MappingTable[] = {
#include "cns6.ut"
};
PRUint16 g_utCNS7MappingTable[] = {
const PRUint16 g_utCNS7MappingTable[] = {
#include "cns7.ut"
};
PRUint16 g_ASCIIMappingTable[] = {
const PRUint16 g_ASCIIMappingTable[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
// ucvtw
PRUint16 g_ufBig5Mapping[] = {
const PRUint16 g_ufBig5Mapping[] = {
#include "big5.uf"
};
PRUint16 g_utBIG5Mapping[] = {
const PRUint16 g_utBIG5Mapping[] = {
#include "big5.ut"
};
PRUint16 g_ufBig5HKSCSMapping[] = {
const PRUint16 g_ufBig5HKSCSMapping[] = {
#include "hkscs.uf"
};
PRUint16 g_ASCIIMapping[] = {
const PRUint16 g_ASCIIMapping[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
PRUint16 g_utBig5HKSCSMapping[] = {
const PRUint16 g_utBig5HKSCSMapping[] = {
#include "hkscs.ut"
};
// ucvko
PRUint16 g_utKSC5601Mapping[] = {
const PRUint16 g_utKSC5601Mapping[] = {
#include "u20kscgl.ut"
};
PRUint16 g_ufKSC5601Mapping[] = {
const PRUint16 g_ufKSC5601Mapping[] = {
#include "u20kscgl.uf"
};
PRUint16 g_ucvko_AsciiMapping[] = {
const PRUint16 g_ucvko_AsciiMapping[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
PRUint16 g_HangulNullMapping[] ={
const PRUint16 g_HangulNullMapping[] ={
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0xAC00, 0xD7A3, 0xAC00
};
PRUint16 g_ufJohabJamoMapping[] ={
const PRUint16 g_ufJohabJamoMapping[] ={
#include "johabjamo.uf"
};

View File

@ -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;

View File

@ -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,

View File

@ -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
};

View File

@ -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 */

View File

@ -46,7 +46,7 @@
//--------------------------------------------------------------------
static PRBool gInitToGBKTable = PR_FALSE;
static PRUnichar gGBKToUnicodeTable[MAX_GBK_LENGTH] = {
static const PRUnichar gGBKToUnicodeTable[MAX_GBK_LENGTH] = {
#include "cp936map.h"
};
static PRUint16 gUnicodeToGBKTable[0xA000-0x4e00];

View File

@ -48,7 +48,7 @@
#include "gbku.h"
static PRInt16 g_2BytesShiftTable[] = {
static const PRInt16 g_2BytesShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};
@ -64,7 +64,7 @@ public:
protected:
};
static PRUint16 g_utGBKUnique2Bytes[] = {
static const PRUint16 g_utGBKUnique2Bytes[] = {
#include "gbkuniq2b.ut"
};
nsGBKUnique2BytesToUnicode::nsGBKUnique2BytesToUnicode()
@ -85,7 +85,7 @@ public:
protected:
};
static PRUint16 g_utGB18030Unique2Bytes[] = {
static const PRUint16 g_utGB18030Unique2Bytes[] = {
#include "gb18030uniq2b.ut"
};
nsGB18030Unique2BytesToUnicode::nsGB18030Unique2BytesToUnicode()
@ -97,10 +97,11 @@ nsGB18030Unique2BytesToUnicode::nsGB18030Unique2BytesToUnicode()
//------------------------------------------------------------
// nsGB18030Unique4BytesToUnicode
//------------------------------------------------------------
static PRInt16 g_GB18030_4BytesShiftTable[] = {
static const PRInt16 g_GB18030_4BytesShiftTable[] = {
0, u4BytesGB18030Charset,
ShiftCell(0,0,0,0,0,0,0,0)
};
class nsGB18030Unique4BytesToUnicode : public nsTableDecoderSupport
{
public:
@ -110,7 +111,7 @@ public:
protected:
};
static PRUint16 g_utGB18030Unique4Bytes[] = {
static const PRUint16 g_utGB18030Unique4Bytes[] = {
#include "gb180304bytes.ut"
};
nsGB18030Unique4BytesToUnicode::nsGB18030Unique4BytesToUnicode()

View File

@ -57,11 +57,11 @@
// Global table initialization function defined in gbku.h
//-------------------------------------------------------------
static PRInt16 g_2BytesShiftTable[] = {
static const PRInt16 g_2BytesShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};
static PRInt16 g_4BytesGB18030ShiftTable[] = {
static const PRInt16 g_4BytesGB18030ShiftTable[] = {
0, u4BytesGB18030Charset,
ShiftCell(0,0,0,0,0,0,0,0)
};
@ -70,7 +70,7 @@ static PRInt16 g_4BytesGB18030ShiftTable[] = {
// Private class used by nsUnicodeToGB18030 and nsUnicodeToGB18030Font0
// nsUnicodeToGB18030Uniq2Bytes
//-----------------------------------------------------------------------
static PRUint16 g_uf_gb18030_2bytes[] = {
static const PRUint16 g_uf_gb18030_2bytes[] = {
#include "gb18030uniq2b.uf"
};
class nsUnicodeToGB18030Uniq2Bytes : public nsTableEncoderSupport
@ -85,7 +85,7 @@ protected:
// Private class used by nsUnicodeToGB18030
// nsUnicodeTo4BytesGB18030
//-----------------------------------------------------------------------
static PRUint16 g_uf_gb18030_4bytes[] = {
static const PRUint16 g_uf_gb18030_4bytes[] = {
#include "gb180304bytes.uf"
};
class nsUnicodeTo4BytesGB18030 : public nsTableEncoderSupport
@ -100,7 +100,7 @@ protected:
// Private class used by nsUnicodeToGBK
// nsUnicodeToGBKUniq2Bytes
//-----------------------------------------------------------------------
static PRUint16 g_uf_gbk_2bytes[] = {
static const PRUint16 g_uf_gbk_2bytes[] = {
#include "gbkuniq2b.uf"
};
class nsUnicodeToGBKUniq2Bytes : public nsTableEncoderSupport

View File

@ -41,14 +41,14 @@
#include "prtypes.h"
extern PRUint16 g_ut0201Mapping[];
extern PRUint16 g_ut0208Mapping[];
extern PRUint16 g_ut0212Mapping[];
extern const PRUint16 g_ut0201Mapping[];
extern const PRUint16 g_ut0208Mapping[];
extern const PRUint16 g_ut0212Mapping[];
extern PRUint16 g_uf0201Mapping[];
extern PRUint16 g_uf0201GLMapping[];
extern PRUint16 g_uf0208Mapping[];
extern PRUint16 g_uf0208extMapping[];
extern PRUint16 g_uf0212Mapping[];
extern const PRUint16 g_uf0201Mapping[];
extern const PRUint16 g_uf0201GLMapping[];
extern const PRUint16 g_uf0208Mapping[];
extern const PRUint16 g_uf0208extMapping[];
extern const PRUint16 g_uf0212Mapping[];
#endif /* nsUCVJADll_h___ */

View File

@ -54,7 +54,7 @@ static const PRInt16 g0208ShiftTable[] = {
ShiftCell(0,0,0,0,0,0,0,0)
};
static PRInt16 g0212ShiftTable[] = {
static const PRInt16 g0212ShiftTable[] = {
0, u2BytesGRPrefix8FCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};

View File

@ -41,7 +41,7 @@
#include "nsUCConstructors.h"
// Shift Table
static PRInt16 g0201ShiftTable[] = {
static const PRInt16 g0201ShiftTable[] = {
1, u1ByteCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};

View File

@ -43,7 +43,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g0208ShiftTable[] = {
static const PRInt16 g0208ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};

View File

@ -43,7 +43,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g0212ShiftTable[] = {
static const PRInt16 g0212ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};

View File

@ -111,7 +111,7 @@ nsCP949ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
return CreateMultiTableDecoder(sizeof(g_CP949Ranges) / sizeof(g_CP949Ranges[0]),
(uRange*) &g_CP949Ranges,
(const uRange*) &g_CP949Ranges,
(uShiftTable**) &g_CP949ShiftTableSet,
(uMappingTable**) &g_CP949MappingTableSet, 1,
aOuter, aIID, aResult);

View File

@ -99,7 +99,7 @@ nsJohabToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
return CreateMultiTableDecoder(sizeof(g_JOHABRanges) / sizeof(g_JOHABRanges[0]),
(uRange*) &g_JOHABRanges,
(const uRange*) &g_JOHABRanges,
(uShiftTable**) &g_JOHABShiftTableSet,
(uMappingTable**) &g_JOHABMappingTableSet, 1,
aOuter, aIID, aResult);

View File

@ -41,10 +41,10 @@
#include "prtypes.h"
extern "C" PRUint16 g_utKSC5601Mapping[];
extern "C" PRUint16 g_ufKSC5601Mapping[];
extern "C" PRUint16 g_ucvko_AsciiMapping[];
extern "C" PRUint16 g_HangulNullMapping[];
extern "C" PRUint16 g_ufJohabJamoMapping[];
extern const PRUint16 g_utKSC5601Mapping[];
extern const PRUint16 g_ufKSC5601Mapping[];
extern const PRUint16 g_ucvko_AsciiMapping[];
extern const PRUint16 g_HangulNullMapping[];
extern const PRUint16 g_ufJohabJamoMapping[];
#endif /* nsUCvKODll_h___ */

View File

@ -67,7 +67,8 @@ NS_METHOD
nsUnicodeToKSC5601Constructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
return CreateMultiTableEncoder(2, (uShiftTable**) g_ShiftTable,
return CreateMultiTableEncoder(2,
(uShiftTable**) g_ShiftTable,
(uMappingTable**) g_MappingTable,
8 /* max length = src * 8 */,
aOuter, aIID, aResult);

View File

@ -224,7 +224,7 @@ NS_IMETHODIMP nsUTF16DiffEndianToUnicode::Convert(
return res;
}
nsresult UTF16ConvertToUnicode(PRUint8& aState, PRUint8& aData, const char * aSrc, PRInt32 * aSrcLength, PRUnichar * aDest, PRInt32 * aDestLength)
static nsresult UTF16ConvertToUnicode(PRUint8& aState, PRUint8& aData, const char * aSrc, PRInt32 * aSrcLength, PRUnichar * aDest, PRInt32 * aDestLength)
{
const char* src = aSrc;
const char* srcEnd = aSrc + *aSrcLength;

View File

@ -90,7 +90,7 @@ nsBIG5HKSCSToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
return CreateMultiTableDecoder(6,
(uRange* ) &g_BIG5HKSCSRanges,
(const uRange* ) &g_BIG5HKSCSRanges,
(uShiftTable**) &g_BIG5HKSCSShiftTableSet,
(uMappingTable**) &g_BIG5HKSCSMappingTableSet,
1,

View File

@ -74,7 +74,7 @@ nsBIG5ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
return CreateMultiTableDecoder(2,
(uRange* ) &g_BIG5Ranges,
(const uRange* ) &g_BIG5Ranges,
(uShiftTable**) &g_BIG5ShiftTableSet,
(uMappingTable**) &g_BIG5MappingTableSet, 1,
aOuter, aIID, aResult);

View File

@ -41,10 +41,10 @@
#include "prtypes.h"
extern "C" PRUint16 g_ufBig5Mapping[];
extern "C" PRUint16 g_utBIG5Mapping[];
extern "C" PRUint16 g_ASCIIMapping[];
extern "C" PRUint16 g_ufBig5HKSCSMapping[];
extern "C" PRUint16 g_utBig5HKSCSMapping[];
extern const PRUint16 g_ufBig5Mapping[];
extern const PRUint16 g_utBIG5Mapping[];
extern const PRUint16 g_ASCIIMapping[];
extern const PRUint16 g_ufBig5HKSCSMapping[];
extern const PRUint16 g_utBig5HKSCSMapping[];
#endif /* nsUCvTWDll_h___ */

View File

@ -123,7 +123,7 @@ nsEUCTWToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
return CreateMultiTableDecoder(8,
(uRange*) &g_EUCTWRanges,
(const uRange*) &g_EUCTWRanges,
(uShiftTable**) &g_EUCTWShiftTableSet,
(uMappingTable**) &g_EUCTWMappingTableSet,
1, aOuter, aIID, aResult);

View File

@ -41,20 +41,20 @@
#include "prtypes.h"
extern "C" PRUint16 g_ASCIIMappingTable[] ;
extern "C" PRUint16 g_ufCNS1MappingTable[];
extern "C" PRUint16 g_ufCNS2MappingTable[];
extern "C" PRUint16 g_ufCNS3MappingTable[];
extern "C" PRUint16 g_ufCNS4MappingTable[];
extern "C" PRUint16 g_ufCNS5MappingTable[];
extern "C" PRUint16 g_ufCNS6MappingTable[];
extern "C" PRUint16 g_ufCNS7MappingTable[];
extern "C" PRUint16 g_utCNS1MappingTable[];
extern "C" PRUint16 g_utCNS2MappingTable[];
extern "C" PRUint16 g_utCNS3MappingTable[];
extern "C" PRUint16 g_utCNS4MappingTable[];
extern "C" PRUint16 g_utCNS5MappingTable[];
extern "C" PRUint16 g_utCNS6MappingTable[];
extern "C" PRUint16 g_utCNS7MappingTable[];
extern const PRUint16 g_ASCIIMappingTable[] ;
extern const PRUint16 g_ufCNS1MappingTable[];
extern const PRUint16 g_ufCNS2MappingTable[];
extern const PRUint16 g_ufCNS3MappingTable[];
extern const PRUint16 g_ufCNS4MappingTable[];
extern const PRUint16 g_ufCNS5MappingTable[];
extern const PRUint16 g_ufCNS6MappingTable[];
extern const PRUint16 g_ufCNS7MappingTable[];
extern const PRUint16 g_utCNS1MappingTable[];
extern const PRUint16 g_utCNS2MappingTable[];
extern const PRUint16 g_utCNS3MappingTable[];
extern const PRUint16 g_utCNS4MappingTable[];
extern const PRUint16 g_utCNS5MappingTable[];
extern const PRUint16 g_utCNS6MappingTable[];
extern const PRUint16 g_utCNS7MappingTable[];
#endif /* nsUCvTW2Dll_h___ */

View File

@ -43,7 +43,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g_ShiftTable[] = {
static const PRInt16 g_ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};

View File

@ -44,7 +44,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g_ShiftTable[] = {
static const PRInt16 g_ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};

View File

@ -44,7 +44,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g_ShiftTable[] = {
static const PRInt16 g_ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};

View File

@ -44,7 +44,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g_ShiftTable[] = {
static const PRInt16 g_ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};

View File

@ -43,7 +43,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g_ShiftTable[] = {
static const PRInt16 g_ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};

View File

@ -43,7 +43,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g_ShiftTable[] = {
static const PRInt16 g_ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};

View File

@ -43,7 +43,7 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRInt16 g_ShiftTable[] = {
static const PRInt16 g_ShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};

View File

@ -53,7 +53,7 @@ inline NS_METHOD StabilizedQueryInterface(T* aNewObject,
}
NS_METHOD
CreateMultiTableDecoder(PRInt32 aTableCount, uRange * aRangeArray,
CreateMultiTableDecoder(PRInt32 aTableCount, const uRange * aRangeArray,
uShiftTable ** aShiftTable,
uMappingTable ** aMappingTable,
PRUint32 aMaxLengthFactor,

View File

@ -48,7 +48,7 @@
// all the useful constructors
NS_METHOD
CreateMultiTableDecoder(PRInt32 aTableCount,
uRange * aRangeArray,
const uRange * aRangeArray,
uShiftTable ** aShiftTable,
uMappingTable ** aMappingTable,
PRUint32 aMaxLengthFactor,
@ -62,7 +62,6 @@ CreateMultiTableEncoder(PRInt32 aTableCount,
uShiftTable ** aShiftTable,
uMappingTable ** aMappingTable,
PRUint32 aMaxLengthFactor,
nsISupports* aOuter,
REFNSIID aIID,
void** aResult);
@ -71,7 +70,6 @@ NS_METHOD
CreateTableEncoder(uShiftTable * aShiftTable,
uMappingTable * aMappingTable,
PRUint32 aMaxLengthFactor,
nsISupports* aOuter,
REFNSIID aIID,
void** aResult);
@ -80,7 +78,6 @@ NS_METHOD
CreateTableDecoder(uShiftTable * aShiftTable,
uMappingTable * aMappingTable,
PRUint32 aMaxLengthFactor,
nsISupports* aOuter,
REFNSIID aIID,
void** aResult);
@ -88,7 +85,6 @@ CreateTableDecoder(uShiftTable * aShiftTable,
NS_METHOD
CreateOneByteDecoder(uShiftTable * aShiftTable,
uMappingTable * aMappingTable,
nsISupports* aOuter,
REFNSIID aIID,
void** aResult);

View File

@ -255,7 +255,7 @@ NS_IMETHODIMP nsTableDecoderSupport::ConvertNoBuff(const char * aSrc,
nsMultiTableDecoderSupport::nsMultiTableDecoderSupport(
PRInt32 aTableCount,
uRange * aRangeArray,
const uRange * aRangeArray,
uShiftTable ** aShiftTable,
uMappingTable ** aMappingTable,
PRUint32 aMaxLengthFactor)

View File

@ -219,7 +219,7 @@ public:
/**
* Class constructor.
*/
nsMultiTableDecoderSupport(PRInt32 aTableCount, uRange * aRangeArray,
nsMultiTableDecoderSupport(PRInt32 aTableCount, const uRange * aRangeArray,
uShiftTable ** aShiftTable,
uMappingTable ** aMappingTable,
PRUint32 aMaxLengthFactor);
@ -233,7 +233,7 @@ protected:
nsIUnicodeDecodeHelper * mHelper; // decoder helper object
PRInt32 mTableCount;
uRange * mRangeArray;
const uRange * mRangeArray;
uShiftTable ** mShiftTable;
uMappingTable ** mMappingTable;

View File

@ -41,16 +41,16 @@
*/
#include "nscore.h"
static PRUnichar gUpperToTitle[] = {
static const PRUnichar gUpperToTitle[] = {
0x01F1, 0x01F2,
0x01C4, 0x01C5,
0x01C7, 0x01C8,
0x01CA, 0x01CB,
};
static PRUint32 gUpperToTitleItems = 4;
static const PRUint32 gUpperToTitleItems = 4;
static PRUint16 gToUpper[] =
static const PRUint16 gToUpper[] =
{ /* From To Every Diff */
0x0061, ((0x19 << 8) | 0x01), 0xffe0 ,
0x00b5, ((0x00 << 8) | 0x3b), 0x02e7 ,
@ -161,9 +161,9 @@ static PRUint16 gToUpper[] =
0xff41, ((0x19 << 8) | 0x01), 0xffe0
};
static PRUint32 gToUpperItems = 107;
static const PRUint32 gToUpperItems = 107;
static PRUint16 gToLower[] =
static const PRUint16 gToLower[] =
{ /* From To Every Diff */
0x0041, ((0x19 << 8) | 0x01), 0x0020 ,
0x00c0, ((0x16 << 8) | 0x01), 0x0020 ,
@ -266,9 +266,9 @@ static PRUint16 gToLower[] =
0xff21, ((0x19 << 8) | 0x01), 0x0020
};
static PRUint32 gToLowerItems = 99;
static const PRUint32 gToLowerItems = 99;
static PRUint32 gCaseBlocks [8] = {
static const PRUint32 gCaseBlocks [8] = {
0xC000003F,
0x00000012,
0x00000000,

View File

@ -41,7 +41,7 @@
*/
#include "nscore.h"
static PRUint8 gGenCatIdx1[224] = {
static const PRUint8 gGenCatIdx1[224] = {
0, // U+0000 - U+0007 : 0x44444444
0, // U+0008 - U+000F : 0x44444444
0, // U+0010 - U+0017 : 0x44444444
@ -268,7 +268,7 @@ static PRUint8 gGenCatIdx1[224] = {
62, // U+06F8 - U+06FF : 0x00000022
};
static PRUint8 gGenCatIdx2[288] = {
static const PRUint8 gGenCatIdx2[288] = {
63, // U+0900 - U+0907 : 0x55501110
6, // U+0908 - U+090F : 0x55555555
6, // U+0910 - U+0917 : 0x55555555
@ -559,7 +559,7 @@ static PRUint8 gGenCatIdx2[288] = {
43, // U+11F8 - U+11FF : 0x00000055
};
static PRUint8 gGenCatIdx3[320] = {
static const PRUint8 gGenCatIdx3[320] = {
6, // U+1E00 - U+1E07 : 0x55555555
6, // U+1E08 - U+1E0F : 0x55555555
6, // U+1E10 - U+1E17 : 0x55555555
@ -882,7 +882,7 @@ static PRUint8 gGenCatIdx3[320] = {
17, // U+27F8 - U+27FF : 0x00000000
};
static PRUint8 gGenCatIdx4[128] = {
static const PRUint8 gGenCatIdx4[128] = {
171, // U+3000 - U+3007 : 0x25576663
125, // U+3008 - U+300F : 0x66666666
172, // U+3010 - U+3017 : 0x66667766
@ -1013,7 +1013,7 @@ static PRUint8 gGenCatIdx4[128] = {
22, // U+33F8 - U+33FF : 0x07777777
};
static PRUint8 gGenCatIdx5[224] = {
static const PRUint8 gGenCatIdx5[224] = {
6, // U+F900 - U+F907 : 0x55555555
6, // U+F908 - U+F90F : 0x55555555
6, // U+F910 - U+F917 : 0x55555555

View File

@ -71,20 +71,20 @@ enum {
class nsCompressedMap {
public:
nsCompressedMap(PRUnichar *aTable, PRUint32 aSize);
nsCompressedMap(const PRUnichar *aTable, PRUint32 aSize);
~nsCompressedMap();
PRUnichar Map(PRUnichar aChar);
protected:
PRUnichar Lookup(PRUint32 l, PRUint32 m, PRUint32 r, PRUnichar aChar);
private:
PRUnichar *mTable;
const PRUnichar *mTable;
PRUint32 mSize;
PRUint32 *mCache;
PRUint32 mLastBase;
};
nsCompressedMap::nsCompressedMap(PRUnichar *aTable, PRUint32 aSize)
nsCompressedMap::nsCompressedMap(const PRUnichar *aTable, PRUint32 aSize)
{
MOZ_COUNT_CTOR(nsCompressedMap);
mTable = aTable;
@ -467,8 +467,8 @@ nsCaseConversionImp2::CaseInsensitiveCompare(const PRUnichar *aLeft,
nsCaseConversionImp2::nsCaseConversionImp2()
{
if (gInit++ == 0) {
gUpperMap = new nsCompressedMap(NS_REINTERPRET_CAST(PRUnichar*, &gToUpper[0]), gToUpperItems);
gLowerMap = new nsCompressedMap(NS_REINTERPRET_CAST(PRUnichar*, &gToLower[0]), gToLowerItems);
gUpperMap = new nsCompressedMap(NS_REINTERPRET_CAST(const PRUnichar*, &gToUpper[0]), gToUpperItems);
gLowerMap = new nsCompressedMap(NS_REINTERPRET_CAST(const PRUnichar*, &gToLower[0]), gToLowerItems);
}
}

View File

@ -46,7 +46,7 @@ NS_DEFINE_CID(kHankakuToZenkakuCID, NS_HANKAKUTOZENKAKU_CID);
// Basic mapping from Hankaku to Zenkaku
// Nigori and Maru is take care out side this basic mapping
static PRUnichar gBasicMapping[0x40] =
static const PRUnichar gBasicMapping[0x40] =
{
// 0xff60
0xff60,0x3002,0x300c,0x300d,0x3001,0x30fb,0x30f2,0x30a1,

View File

@ -195,20 +195,20 @@ while(<UNICODATA>) {
######################################################################
$ttotal = 0;
print OUT "static PRUnichar gUpperToTitle[] = { \n";
print OUT "static const PRUnichar gUpperToTitle[] = { \n";
while(($upper, $title) = each(%utot)) {
print OUT " 0x" . $upper . ", 0x" . $utot{$upper} . ", \n";
$ttotal++;
}
print OUT "};\n\n";
print OUT "static PRUint32 gUpperToTitleItems = $ttotal;\n\n";
print OUT "static const PRUint32 gUpperToTitleItems = $ttotal;\n\n";
######################################################################
#
# Print out gToUpper table
#
######################################################################
print OUT "static PRUint16 gToUpper[] = \n";
print OUT "static const PRUint16 gToUpper[] = \n";
print OUT "{ /* From To Every Diff */ \n";
$utotal=0;
$ufrom = 0; # remember the start of the output item
@ -262,7 +262,7 @@ for ($i = 0; $i <= $#ucv; $i++)
printf OUT "((0x%02x << 8) | 0x%02x), 0x%04x \n};\n\n",
($ucv[$i] - $ufrom), $ulastd[$i], $ud[$i];
$utotal++;
print OUT "static PRUint32 gToUpperItems = $utotal;\n\n";
print OUT "static const PRUint32 gToUpperItems = $utotal;\n\n";
}
#
# printf "%4x - %4x - %4x - %4x\n", $ucv[$i], $uv[$i], $ud[$i], $ulastd[$i];
@ -274,7 +274,7 @@ for ($i = 0; $i <= $#ucv; $i++)
# Print out gToLower table
#
######################################################################
print OUT "static PRUint16 gToLower[] = \n";
print OUT "static const PRUint16 gToLower[] = \n";
print OUT "{ /* From To Every Diff */ \n";
$ltotal=0;
$lfrom = 0; # remember the start of the output item
@ -327,14 +327,14 @@ for ($i = 0; $i <= $#lcv; $i++)
printf OUT "((0x%02x << 8) | 0x%02x), 0x%04x \n};\n\n",
($lcv[$i] - $lfrom), $llastd[$i], $ld[$i];
$ltotal++;
print OUT "static PRUint32 gToLowerItems = $ltotal;\n\n";
print OUT "static const PRUint32 gToLowerItems = $ltotal;\n\n";
}
#
# printf "%4x - %4x - %4x - %4x\n", $lcv[$i], $lv[$i], $ld[$i], $llastd[$i];
#
}
print OUT "static PRUint32 gCaseBlocks [8] = {\n";
print OUT "static const PRUint32 gCaseBlocks [8] = {\n";
for($idx=0;$idx<8;$idx++)
{
printf OUT "0x%08X", $blk[$idx];

View File

@ -173,7 +173,7 @@ for($t = 1; $t <= $tt; $t++)
$th = $range[($t-1) * 2 + 1];
$ts = ( $th - $tl ) >> 3;
$totaldata += $ts + 1;
printf OUT "static PRUint8 gGenCatIdx%d[%d] = {\n", $t, $ts + 1;
printf OUT "static const PRUint8 gGenCatIdx%d[%d] = {\n", $t, $ts + 1;
for($i = ($tl >> 3); $i <= ($th >> 3) ; $i ++ )
{
$data = 0;
@ -238,7 +238,7 @@ if($newidx > 255)
"This program is now broken!!!\n\n\n";
}
printf OUT "static PRUint32 gGenCatPat[$newidx] = {\n";
printf OUT "static const PRUint32 gGenCatPat[$newidx] = {\n";
for($i = 0 ; $i < $newidx; $i++)
{
printf OUT " %s, // $i \n", $patarray[$i] ;