Commit 565dc5d1 authored by Teodor Sigaev's avatar Teodor Sigaev

Fix integer types to use definition from c.h. Per bug report by Patrick Boulay...

Fix integer types to use definition from c.h. Per bug report by Patrick Boulay <patrick.boulay@medrium.com>
parent 2d83e7c7
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define MAXNORMLEN 256 #define MAXNORMLEN 256
#define STRNCASECMP(x,y) (strncasecmp(x,y,strlen(y))) #define STRNCASECMP(x,y) (strncasecmp(x,y,strlen(y)))
#define GETWCHAR(W,L,N,T) ( ((u_int8_t*)(W))[ ((T)=='p') ? (N) : ( (L) - 1 - (N) ) ] ) #define GETWCHAR(W,L,N,T) ( ((uint8*)(W))[ ((T)=='p') ? (N) : ( (L) - 1 - (N) ) ] )
#define GETCHAR(A,N,T) GETWCHAR( (A)->repl, (A)->replen, N, T ) #define GETCHAR(A,N,T) GETWCHAR( (A)->repl, (A)->replen, N, T )
...@@ -197,7 +197,7 @@ FindWord(IspellDict * Conf, const char *word, int affixflag, char compoundonly) ...@@ -197,7 +197,7 @@ FindWord(IspellDict * Conf, const char *word, int affixflag, char compoundonly)
StopHigh = node->data+node->length; StopHigh = node->data+node->length;
while (StopLow < StopHigh) { while (StopLow < StopHigh) {
StopMiddle = StopLow + (StopHigh - StopLow) / 2; StopMiddle = StopLow + (StopHigh - StopLow) / 2;
if ( StopMiddle->val == ((u_int8_t*)(word))[level] ) { if ( StopMiddle->val == ((uint8*)(word))[level] ) {
if ( wrdlen==level+1 && StopMiddle->isword ) { if ( wrdlen==level+1 && StopMiddle->isword ) {
if ( compoundonly && !StopMiddle->compoundallow ) if ( compoundonly && !StopMiddle->compoundallow )
return 0; return 0;
...@@ -207,7 +207,7 @@ FindWord(IspellDict * Conf, const char *word, int affixflag, char compoundonly) ...@@ -207,7 +207,7 @@ FindWord(IspellDict * Conf, const char *word, int affixflag, char compoundonly)
node=StopMiddle->node; node=StopMiddle->node;
level++; level++;
break; break;
} else if ( StopMiddle->val < ((u_int8_t*)(word))[level] ) { } else if ( StopMiddle->val < ((uint8*)(word))[level] ) {
StopLow = StopMiddle + 1; StopLow = StopMiddle + 1;
} else { } else {
StopHigh = StopMiddle; StopHigh = StopMiddle;
...@@ -431,7 +431,7 @@ mkSPNode(IspellDict *Conf, int low, int high, int level) { ...@@ -431,7 +431,7 @@ mkSPNode(IspellDict *Conf, int low, int high, int level) {
} }
lastchar=Conf->Spell[i].word[level]; lastchar=Conf->Spell[i].word[level];
} }
data->val=((u_int8_t*)(Conf->Spell[i].word))[level]; data->val=((uint8*)(Conf->Spell[i].word))[level];
if ( Conf->Spell[i].p.d.len == level+1 ) { if ( Conf->Spell[i].p.d.len == level+1 ) {
if ( data->isword && data->affix!=Conf->Spell[i].p.d.affix) { if ( data->isword && data->affix!=Conf->Spell[i].p.d.affix) {
/* /*
...@@ -503,7 +503,7 @@ static AffixNode* ...@@ -503,7 +503,7 @@ static AffixNode*
mkANode(IspellDict *Conf, int low, int high, int level, int type) { mkANode(IspellDict *Conf, int low, int high, int level, int type) {
int i; int i;
int nchar=0; int nchar=0;
u_int8_t lastchar='\0'; uint8 lastchar='\0';
AffixNode *rs; AffixNode *rs;
AffixNodeData *data; AffixNodeData *data;
int lownew=low; int lownew=low;
...@@ -588,7 +588,7 @@ NISortAffixes(IspellDict * Conf) ...@@ -588,7 +588,7 @@ NISortAffixes(IspellDict * Conf)
static AffixNodeData* static AffixNodeData*
FinfAffixes(AffixNode *node, const char *word, int wrdlen, int *level, int type) { FinfAffixes(AffixNode *node, const char *word, int wrdlen, int *level, int type) {
AffixNodeData *StopLow, *StopHigh, *StopMiddle; AffixNodeData *StopLow, *StopHigh, *StopMiddle;
u_int8_t symbol; uint8 symbol;
while( node && *level<wrdlen) { while( node && *level<wrdlen) {
StopLow = node->data; StopLow = node->data;
...@@ -805,9 +805,9 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word, ...@@ -805,9 +805,9 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word,
StopHigh = node->data+node->length; StopHigh = node->data+node->length;
while (StopLow < StopHigh) { while (StopLow < StopHigh) {
StopMiddle = StopLow + (StopHigh - StopLow) / 2; StopMiddle = StopLow + (StopHigh - StopLow) / 2;
if ( StopMiddle->val == ((u_int8_t*)(word))[level] ) { if ( StopMiddle->val == ((uint8*)(word))[level] ) {
break; break;
} else if ( StopMiddle->val < ((u_int8_t*)(word))[level] ) { } else if ( StopMiddle->val < ((uint8*)(word))[level] ) {
StopLow = StopMiddle + 1; StopLow = StopMiddle + 1;
} else { } else {
StopHigh = StopMiddle; StopHigh = StopMiddle;
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
#include <sys/types.h> #include <sys/types.h>
#include <regex.h> #include <regex.h>
#include "c.h"
struct SPNode; struct SPNode;
typedef struct { typedef struct {
u_int32_t uint32
val:8, val:8,
isword:1, isword:1,
compoundallow:1, compoundallow:1,
...@@ -18,11 +18,11 @@ typedef struct { ...@@ -18,11 +18,11 @@ typedef struct {
} SPNodeData; } SPNodeData;
typedef struct SPNode { typedef struct SPNode {
u_int32_t length; uint32 length;
SPNodeData data[1]; SPNodeData data[1];
} SPNode; } SPNode;
#define SPNHRDSZ (sizeof(u_int32_t)) #define SPNHRDSZ (sizeof(uint32))
typedef struct spell_struct typedef struct spell_struct
...@@ -57,7 +57,7 @@ typedef struct aff_struct ...@@ -57,7 +57,7 @@ typedef struct aff_struct
struct AffixNode; struct AffixNode;
typedef struct { typedef struct {
u_int32_t uint32
val:8, val:8,
naff:24; naff:24;
AFFIX **aff; AFFIX **aff;
...@@ -65,11 +65,11 @@ typedef struct { ...@@ -65,11 +65,11 @@ typedef struct {
} AffixNodeData; } AffixNodeData;
typedef struct AffixNode { typedef struct AffixNode {
u_int32_t length; uint32 length;
AffixNodeData data[1]; AffixNodeData data[1];
} AffixNode; } AffixNode;
#define ANHRDSZ (sizeof(u_int32_t)) #define ANHRDSZ (sizeof(uint32))
typedef struct Tree_struct typedef struct Tree_struct
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment