Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit565dc5d

Browse files
committed
Fix integer types to use definition from c.h. Per bug report by Patrick Boulay <patrick.boulay@medrium.com>
1 parent2d83e7c commit565dc5d

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

‎contrib/tsearch2/ispell/spell.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#defineMAXNORMLEN 256
1212

1313
#defineSTRNCASECMP(x,y)(strncasecmp(x,y,strlen(y)))
14-
#defineGETWCHAR(W,L,N,T) ( ((u_int8_t*)(W))[ ((T)=='p') ? (N) : ( (L) - 1 - (N) ) ] )
14+
#defineGETWCHAR(W,L,N,T) ( ((uint8*)(W))[ ((T)=='p') ? (N) : ( (L) - 1 - (N) ) ] )
1515
#defineGETCHAR(A,N,T) GETWCHAR( (A)->repl, (A)->replen, N, T )
1616

1717

@@ -197,7 +197,7 @@ FindWord(IspellDict * Conf, const char *word, int affixflag, char compoundonly)
197197
StopHigh=node->data+node->length;
198198
while (StopLow<StopHigh) {
199199
StopMiddle=StopLow+ (StopHigh-StopLow) /2;
200-
if (StopMiddle->val== ((u_int8_t*)(word))[level] ) {
200+
if (StopMiddle->val== ((uint8*)(word))[level] ) {
201201
if (wrdlen==level+1&&StopMiddle->isword ) {
202202
if (compoundonly&& !StopMiddle->compoundallow )
203203
return0;
@@ -207,7 +207,7 @@ FindWord(IspellDict * Conf, const char *word, int affixflag, char compoundonly)
207207
node=StopMiddle->node;
208208
level++;
209209
break;
210-
}elseif (StopMiddle->val< ((u_int8_t*)(word))[level] ) {
210+
}elseif (StopMiddle->val< ((uint8*)(word))[level] ) {
211211
StopLow=StopMiddle+1;
212212
}else {
213213
StopHigh=StopMiddle;
@@ -431,7 +431,7 @@ mkSPNode(IspellDict *Conf, int low, int high, int level) {
431431
}
432432
lastchar=Conf->Spell[i].word[level];
433433
}
434-
data->val=((u_int8_t*)(Conf->Spell[i].word))[level];
434+
data->val=((uint8*)(Conf->Spell[i].word))[level];
435435
if (Conf->Spell[i].p.d.len==level+1 ) {
436436
if (data->isword&&data->affix!=Conf->Spell[i].p.d.affix) {
437437
/*
@@ -503,7 +503,7 @@ static AffixNode*
503503
mkANode(IspellDict*Conf,intlow,inthigh,intlevel,inttype) {
504504
inti;
505505
intnchar=0;
506-
u_int8_tlastchar='\0';
506+
uint8lastchar='\0';
507507
AffixNode*rs;
508508
AffixNodeData*data;
509509
intlownew=low;
@@ -588,7 +588,7 @@ NISortAffixes(IspellDict * Conf)
588588
staticAffixNodeData*
589589
FinfAffixes(AffixNode*node,constchar*word,intwrdlen,int*level,inttype) {
590590
AffixNodeData*StopLow,*StopHigh,*StopMiddle;
591-
u_int8_tsymbol;
591+
uint8symbol;
592592

593593
while(node&&*level<wrdlen) {
594594
StopLow=node->data;
@@ -805,9 +805,9 @@ SplitToVariants( IspellDict * Conf, SPNode *snode, SplitVar * orig, char *word,
805805
StopHigh=node->data+node->length;
806806
while (StopLow<StopHigh) {
807807
StopMiddle=StopLow+ (StopHigh-StopLow) /2;
808-
if (StopMiddle->val== ((u_int8_t*)(word))[level] ) {
808+
if (StopMiddle->val== ((uint8*)(word))[level] ) {
809809
break;
810-
}elseif (StopMiddle->val< ((u_int8_t*)(word))[level] ) {
810+
}elseif (StopMiddle->val< ((uint8*)(word))[level] ) {
811811
StopLow=StopMiddle+1;
812812
}else {
813813
StopHigh=StopMiddle;

‎contrib/tsearch2/ispell/spell.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
#include<sys/types.h>
55
#include<regex.h>
6-
6+
#include"c.h"
77

88
structSPNode;
99

1010

1111
typedefstruct {
12-
u_int32_t
12+
uint32
1313
val:8,
1414
isword:1,
1515
compoundallow:1,
@@ -18,11 +18,11 @@ typedef struct {
1818
}SPNodeData;
1919

2020
typedefstructSPNode {
21-
u_int32_tlength;
21+
uint32length;
2222
SPNodeDatadata[1];
2323
}SPNode;
2424

25-
#defineSPNHRDSZ(sizeof(u_int32_t))
25+
#defineSPNHRDSZ(sizeof(uint32))
2626

2727

2828
typedefstructspell_struct
@@ -57,19 +57,19 @@ typedef struct aff_struct
5757
structAffixNode;
5858

5959
typedefstruct {
60-
u_int32_t
60+
uint32
6161
val:8,
6262
naff:24;
6363
AFFIX**aff;
6464
structAffixNode*node;
6565
}AffixNodeData;
6666

6767
typedefstructAffixNode {
68-
u_int32_tlength;
68+
uint32length;
6969
AffixNodeDatadata[1];
7070
}AffixNode;
7171

72-
#defineANHRDSZ (sizeof(u_int32_t))
72+
#defineANHRDSZ (sizeof(uint32))
7373

7474
typedefstructTree_struct
7575
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp