зеркало из https://github.com/mozilla/pjs.git
fix state table error (generated by ../tools/*.pl, and wrong integer packacking macro, and do cast for char to unsigend char
This commit is contained in:
Родитель
4c9e3b13b7
Коммит
9c781f73de
|
@ -60,7 +60,7 @@ PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
|
|||
|
||||
|
||||
static PRUint32 ISO2022JP_st [ 2] = {
|
||||
PCK4BITS(eStart,eError,eItsMe,eError,eError,eError,eItsMe,eItsMe),//00-07
|
||||
PCK4BITS(eStart,eItsMe,eError,eError,eError,eError,eItsMe,eItsMe),//00-07
|
||||
PCK4BITS(eItsMe,eStart,eStart,eStart,eStart,eStart,eStart,eStart) //08-0f
|
||||
};
|
||||
|
||||
|
|
|
@ -53,13 +53,15 @@ typedef struct nsPkgInt {
|
|||
} nsPkgInt;
|
||||
|
||||
|
||||
#define PCK16BITS(a,b) (((a) << 16) | (b))
|
||||
#define PCK8BITS(a,b,c,d) PCK16BITS( (((a) << 8) | (b)), \
|
||||
(((c) << 8) | (d)) )
|
||||
#define PCK4BITS(a,b,c,d,e,f,g,h) PCK8BITS( (((a) << 4) | (b)), \
|
||||
(((c) << 4) | (d)), \
|
||||
(((e) << 4) | (f)), \
|
||||
(((g) << 4) | (h)) )
|
||||
#define PCK16BITS(a,b) (((b) << 16) | (a))
|
||||
|
||||
#define PCK8BITS(a,b,c,d) PCK16BITS( (((b) << 8) | (a)), \
|
||||
(((d) << 8) | (c)))
|
||||
|
||||
#define PCK4BITS(a,b,c,d,e,f,g,h) PCK8BITS( (((b) << 4) | (a)), \
|
||||
(((d) << 4) | (c)), \
|
||||
(((f) << 4) | (e)), \
|
||||
(((h) << 4) | (g)) )
|
||||
|
||||
#define GETFROMPCK(i, c) \
|
||||
(((((c).data)[(i)>>(c).idxsft])>>(((i)&(c).sftmsk)<<(c).bitsft))&(c).unitmsk)
|
||||
|
|
|
@ -62,7 +62,7 @@ PCK4BITS(5,5,5,5,5,0,0,0) // f8 - ff
|
|||
static PRUint32 SJIS_st [ 3] = {
|
||||
PCK4BITS(eError,eStart,eStart, 3,eError, 3,eError,eError),//00-07
|
||||
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//08-0f
|
||||
PCK4BITS(eItsMe,eItsMe,eError,eError,eStart,eError,eStart,eStart) //10-17
|
||||
PCK4BITS(eItsMe,eItsMe,eError,eError,eStart,eStart,eError,eStart) //10-17
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ typedef struct nsVerifier {
|
|||
nsPkgInt states;
|
||||
} nsVerifier;
|
||||
|
||||
#define GETCLASS(v,c) GETFROMPCK((c), (v)->cclass)
|
||||
#define GETCLASS(v,c) GETFROMPCK(((unsigned char)(c)), (v)->cclass)
|
||||
#define GETNEXTSTATE(v,c,s) \
|
||||
GETFROMPCK((s)*((v)->stFactor)+GETCLASS((v),(c)), ((v)->states))
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче