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

Commitbe2de3b

Browse files
committed
The patch solves this problem, I hope...
Christopher Kings-Lynne wrote:> I'm still getting ltree failures on 64bit freebsd:>> sed 's,MODULE_PATHNAME,$libdir/ltree,g' ltree.sql.in >ltree.sql> gcc -pipe -O -g -Wall -Wmissing-prototypes -Wmissing-declarations -fpic -DPI> C -DLOWER_NODE -I. -I../../src/include -c -o ltree_io.o ltree_io.c -MMD> ltree_io.c: In function `ltree_in':> ltree_io.c:57: warning: int format, different type arg (arg 3)> ltree_io.c:63: warning: int format, different type arg (arg 4)> ltree_io.c:68: warning: int format, different type arg (arg 3)Teodor Sigaev
1 parent0d916a4 commitbe2de3b

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

‎contrib/ltree/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,6 @@ crc32_sz(char *buf, int size)
105105
len=0;
106106
nr=size;
107107
for (len+=nr,p=buf;nr--;++p)
108-
_CRC32_(crc,TOLOWER(*p));
108+
_CRC32_(crc,TOLOWER((unsignedint)*p));
109109
return ~crc;
110110
}

‎contrib/ltree/ltree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ typedef struct {
8383
#ifndefabs
8484
#defineabs(a) ((a) < (0) ? -(a) : (a))
8585
#endif
86-
#defineISALNUM(x)( isalnum(x) || (x) == '_' )
86+
#defineISALNUM(x)( isalnum((unsigned int)(x)) || (x) == '_' )
8787

8888
/* full text query */
8989

‎contrib/ltree/ltree_io.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PG_FUNCTION_INFO_V1(lquery_out);
1818
Datumlquery_out(PG_FUNCTION_ARGS);
1919

2020

21-
#defineUNCHAR elog(ERROR,"Syntax error in position %d near '%c'", ptr-buf, *ptr)
21+
#defineUNCHAR elog(ERROR,"Syntax error in position %d near '%c'",(int)(ptr-buf), *ptr)
2222

2323
typedefstruct {
2424
char*start;
@@ -60,7 +60,7 @@ ltree_in(PG_FUNCTION_ARGS) {
6060
lptr->len=ptr-lptr->start;
6161
if (lptr->len>255 )
6262
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
63-
lptr->len,lptr->start-buf);
63+
lptr->len,(int)(lptr->start-buf));
6464
totallen+=MAXALIGN(lptr->len+LEVEL_HDRSIZE);
6565
lptr++;
6666
state=LTPRS_WAITNAME;
@@ -75,7 +75,7 @@ ltree_in(PG_FUNCTION_ARGS) {
7575
lptr->len=ptr-lptr->start;
7676
if (lptr->len>255 )
7777
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
78-
lptr->len,lptr->start-buf);
78+
lptr->len,(int)(lptr->start-buf));
7979
totallen+=MAXALIGN(lptr->len+LEVEL_HDRSIZE);
8080
lptr++;
8181
}elseif ( ! (state==LTPRS_WAITNAME&&lptr==list) )
@@ -214,7 +214,7 @@ lquery_in(PG_FUNCTION_ARGS) {
214214
( (lptr->flag&LVAR_ANYEND ) ?1 :0 );
215215
if (lptr->len>255 )
216216
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
217-
lptr->len,lptr->start-buf);
217+
lptr->len,(int)(lptr->start-buf));
218218
state=LQPRS_WAITVAR;
219219
}elseif (*ptr=='.' ) {
220220
lptr->len=ptr-lptr->start-
@@ -223,7 +223,7 @@ lquery_in(PG_FUNCTION_ARGS) {
223223
( (lptr->flag&LVAR_ANYEND ) ?1 :0 );
224224
if (lptr->len>255 )
225225
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
226-
lptr->len,lptr->start-buf);
226+
lptr->len,(int)(lptr->start-buf));
227227
state=LQPRS_WAITLEVEL;
228228
curqlevel=NEXTLEV(curqlevel);
229229
}elseif (ISALNUM(*ptr) ) {
@@ -244,13 +244,13 @@ lquery_in(PG_FUNCTION_ARGS) {
244244
}elseif (state==LQPRS_WAITFNUM ) {
245245
if (*ptr==',' ) {
246246
state=LQPRS_WAITSNUM;
247-
}elseif (isdigit(*ptr) ) {
247+
}elseif (isdigit((unsignedint)*ptr) ) {
248248
curqlevel->low=atoi(ptr );
249249
state=LQPRS_WAITND;
250250
}else
251251
UNCHAR;
252252
}elseif (state==LQPRS_WAITSNUM ) {
253-
if (isdigit(*ptr) ) {
253+
if (isdigit((unsignedint)*ptr) ) {
254254
curqlevel->high=atoi(ptr );
255255
state=LQPRS_WAITCLOSE;
256256
}elseif (*ptr=='}' ) {
@@ -261,15 +261,15 @@ lquery_in(PG_FUNCTION_ARGS) {
261261
}elseif (state==LQPRS_WAITCLOSE ) {
262262
if (*ptr=='}' )
263263
state=LQPRS_WAITEND;
264-
elseif ( !isdigit(*ptr) )
264+
elseif ( !isdigit((unsignedint)*ptr) )
265265
UNCHAR;
266266
}elseif (state==LQPRS_WAITND ) {
267267
if (*ptr=='}' ) {
268268
curqlevel->high=curqlevel->low;
269269
state=LQPRS_WAITEND;
270270
}elseif (*ptr==',' )
271271
state=LQPRS_WAITSNUM;
272-
elseif ( !isdigit(*ptr) )
272+
elseif ( !isdigit((unsignedint)*ptr) )
273273
UNCHAR;
274274
}elseif (state==LQPRS_WAITEND ) {
275275
if (*ptr=='.' ) {
@@ -293,7 +293,7 @@ lquery_in(PG_FUNCTION_ARGS) {
293293
elog(ERROR,"Unexpected end of line");
294294
if (lptr->len>255 )
295295
elog(ERROR,"Name of level is too long (%d, must be < 256) in position %d",
296-
lptr->len,lptr->start-buf);
296+
lptr->len,(int)(lptr->start-buf));
297297
}elseif (state==LQPRS_WAITOPEN ) {
298298
curqlevel->high=0xffff;
299299
}elseif (state!=LQPRS_WAITEND )

‎contrib/ltree/ltxtquery_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, uint1
7676
*strval=state->buf;
7777
*lenval=1;
7878
*flag=0;
79-
}elseif ( !isspace(*(state->buf)) )
79+
}elseif ( !isspace((unsignedint)*(state->buf)) )
8080
elog(ERROR,"Operand syntax error");
8181
break;
8282
caseINOPERAND:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp