Skip to content

Commit 565dc5d

Browse files
committed
Fix integer types to use definition from c.h. Per bug report by Patrick Boulay <patrick.boulay@medrium.com>
1 parent 2d83e7c commit 565dc5d

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
#define MAXNORMLEN 256
1212

1313
#define STRNCASECMP(x,y) (strncasecmp(x,y,strlen(y)))
14-
#define GETWCHAR(W,L,N,T) ( ((u_int8_t*)(W))[ ((T)=='p') ? (N) : ( (L) - 1 - (N) ) ] )
14+
#define GETWCHAR(W,L,N,T) ( ((uint8*)(W))[ ((T)=='p') ? (N) : ( (L) - 1 - (N) ) ] )
1515
#define GETCHAR(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
return 0;
@@ -207,7 +207,7 @@ FindWord(IspellDict * Conf, const char *word, int affixflag, char compoundonly)
207207
node=StopMiddle->node;
208208
level++;
209209
break;
210-
} else if ( StopMiddle->val < ((u_int8_t*)(word))[level] ) {
210+
} else if ( 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, int low, int high, int level, int type) {
504504
int i;
505505
int nchar=0;
506-
u_int8_t lastchar='\0';
506+
uint8 lastchar='\0';
507507
AffixNode *rs;
508508
AffixNodeData *data;
509509
int lownew=low;
@@ -588,7 +588,7 @@ NISortAffixes(IspellDict * Conf)
588588
static AffixNodeData*
589589
FinfAffixes(AffixNode *node, const char *word, int wrdlen, int *level, int type) {
590590
AffixNodeData *StopLow, *StopHigh, *StopMiddle;
591-
u_int8_t symbol;
591+
uint8 symbol;
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-
} else if ( StopMiddle->val < ((u_int8_t*)(word))[level] ) {
810+
} else if ( 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
struct SPNode;
99

1010

1111
typedef struct {
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
typedef struct SPNode {
21-
u_int32_t length;
21+
uint32 length;
2222
SPNodeData data[1];
2323
} SPNode;
2424

25-
#define SPNHRDSZ (sizeof(u_int32_t))
25+
#define SPNHRDSZ (sizeof(uint32))
2626

2727

2828
typedef struct spell_struct
@@ -57,19 +57,19 @@ typedef struct aff_struct
5757
struct AffixNode;
5858

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

6767
typedef struct AffixNode {
68-
u_int32_t length;
68+
uint32 length;
6969
AffixNodeData data[1];
7070
} AffixNode;
7171

72-
#define ANHRDSZ (sizeof(u_int32_t))
72+
#define ANHRDSZ (sizeof(uint32))
7373

7474
typedef struct Tree_struct
7575
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy