1111#define MAXNORMLEN 256
1212
1313#define STRNCASECMP (x ,y )pg_strncasecmp(x, y, strlen(y))
14- #define GETWCHAR (W ,L ,N ,T ) ( ((uint8*)(W))[ ((T)=='p' ) ? (N) : ( (L) - 1 - (N) ) ] )
14+ #define GETWCHAR (W ,L ,N ,T ) ( ((uint8*)(W))[ ((T)==FF_PREFIX ) ? (N) : ( (L) - 1 - (N) ) ] )
1515#define GETCHAR (A ,N ,T ) GETWCHAR( (A)->repl, (A)->replen, N, T )
1616
1717
@@ -103,7 +103,7 @@ cmpaffix(const void *s1, const void *s2)
103103return -1 ;
104104if (((const AFFIX * )s1 )-> type > ((const AFFIX * )s2 )-> type )
105105return 1 ;
106- if (((const AFFIX * )s1 )-> type == 'p' )
106+ if (((const AFFIX * )s1 )-> type == FF_PREFIX )
107107return (strcmp (((const AFFIX * )s1 )-> repl , ((const AFFIX * )s2 )-> repl ));
108108else
109109return (strbcmp (((const AFFIX * )s1 )-> repl , ((const AFFIX * )s2 )-> repl ));
@@ -620,7 +620,7 @@ NISortAffixes(IspellDict * Conf)
620620
621621for (i = 0 ;i < Conf -> naffixes ;i ++ ) {
622622Affix = & (((AFFIX * )Conf -> Affix )[i ]);
623- if (Affix -> type == 's' ) {
623+ if (Affix -> type == FF_SUFFIX ) {
624624if (firstsuffix < 0 )firstsuffix = i ;
625625if (Affix -> flagflags & FF_COMPOUNDONLYAFX ) {
626626if ( !ptr -> affix || strbncmp ((ptr - 1 )-> affix ,Affix -> repl , (ptr - 1 )-> len ) ) {
@@ -635,8 +635,8 @@ NISortAffixes(IspellDict * Conf)
635635ptr -> affix = NULL ;
636636Conf -> CompoundAffix = (CMPDAffix * )realloc (Conf -> CompoundAffix ,sizeof (CMPDAffix )* (ptr - Conf -> CompoundAffix + 1 ) );
637637
638- Conf -> Prefix = mkANode (Conf ,0 ,firstsuffix ,0 ,'p' );
639- Conf -> Suffix = mkANode (Conf ,firstsuffix ,Conf -> naffixes ,0 ,'s' );
638+ Conf -> Prefix = mkANode (Conf ,0 ,firstsuffix ,0 ,FF_PREFIX );
639+ Conf -> Suffix = mkANode (Conf ,firstsuffix ,Conf -> naffixes ,0 ,FF_SUFFIX );
640640mkVoidAffix (Conf ,1 ,firstsuffix );
641641mkVoidAffix (Conf ,0 ,firstsuffix );
642642}
@@ -773,7 +773,7 @@ NormalizeSubWord(IspellDict * Conf, char *word, char flag) {
773773pnode = Conf -> Prefix ;
774774plevel = 0 ;
775775while (pnode ) {
776- prefix = FinfAffixes (pnode ,word ,wrdlen ,& plevel ,'p' );
776+ prefix = FinfAffixes (pnode ,word ,wrdlen ,& plevel ,FF_PREFIX );
777777if (!prefix )break ;
778778for (j = 0 ;j < prefix -> naff ;j ++ ) {
779779if (CheckAffix (word ,wrdlen ,prefix -> aff [j ],flag ,newword ) ) {
@@ -792,7 +792,7 @@ NormalizeSubWord(IspellDict * Conf, char *word, char flag) {
792792/* Find all other NORMAL forms of the 'word' (check suffix and then prefix)*/
793793while (snode ) {
794794/* find possible suffix */
795- suffix = FinfAffixes (snode ,word ,wrdlen ,& slevel ,'s' );
795+ suffix = FinfAffixes (snode ,word ,wrdlen ,& slevel ,FF_SUFFIX );
796796if (!suffix )break ;
797797/* foreach suffix check affix */
798798for (i = 0 ;i < suffix -> naff ;i ++ ) {
@@ -809,7 +809,7 @@ NormalizeSubWord(IspellDict * Conf, char *word, char flag) {
809809plevel = 0 ;
810810swrdlen = strlen (newword );
811811while (pnode ) {
812- prefix = FinfAffixes (pnode ,newword ,swrdlen ,& plevel ,'p' );
812+ prefix = FinfAffixes (pnode ,newword ,swrdlen ,& plevel ,FF_PREFIX );
813813if (!prefix )break ;
814814for (j = 0 ;j < prefix -> naff ;j ++ ) {
815815if (CheckAffix (newword ,swrdlen ,prefix -> aff [j ],flag ,pnewword ) ) {
@@ -894,7 +894,7 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word,
894894StopLow = node -> data ;
895895StopHigh = node -> data + node -> length ;
896896while (StopLow < StopHigh ) {
897- StopMiddle = StopLow + (StopHigh - StopLow )/ 2 ;
897+ StopMiddle = StopLow + (( StopHigh - StopLow )>> 1 ) ;
898898if (StopMiddle -> val == ((uint8 * )(word ))[level ] ) {
899899break ;
900900}else if (StopMiddle -> val < ((uint8 * )(word ))[level ] ) {