7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.9 1997/05/22 00:07:15 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.10 1997/06/11 05:20:05 vadim Exp $
11
11
*
12
12
* NOTES
13
13
* These functions are stored in pg_amproc. For each operator class
@@ -98,7 +98,7 @@ btabstimecmp(AbsoluteTime a, AbsoluteTime b)
98
98
int32
99
99
btcharcmp (char a , char b )
100
100
{
101
- return ((int32 ) (a - b ));
101
+ return ((int32 ) (( uint8 ) a - ( uint8 ) b ));
102
102
}
103
103
104
104
int32
@@ -135,9 +135,9 @@ int32
135
135
bttextcmp (struct varlena * a , struct varlena * b )
136
136
{
137
137
int res ;
138
+ unsigned char * ap , * bp ;
138
139
139
140
#ifdef USE_LOCALE
140
- unsigned char * ap , * bp ;
141
141
int la = VARSIZE (a ) - VARHDRSZ ;
142
142
int lb = VARSIZE (b ) - VARHDRSZ ;
143
143
@@ -155,7 +155,6 @@ bttextcmp(struct varlena *a, struct varlena *b)
155
155
pfree (bp );
156
156
157
157
#else
158
- char * ap , * bp ;
159
158
int len = VARSIZE (a );
160
159
161
160
/* len is the length of the shorter of the two strings */
@@ -164,8 +163,8 @@ bttextcmp(struct varlena *a, struct varlena *b)
164
163
165
164
len -= VARHDRSZ ;
166
165
167
- ap = VARDATA (a );
168
- bp = VARDATA (b );
166
+ ap = ( unsigned char * ) VARDATA (a );
167
+ bp = ( unsigned char * ) VARDATA (b );
169
168
170
169
/*
171
170
* If the two strings differ in the first len bytes, or if they're
0 commit comments