1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Whack btree_gist code around until it has some small hope of building

on non-gcc compilers.
This commit is contained in:
Tom Lane
2004-08-21 00:09:10 +00:00
parent bf9d9bd2f3
commit 86d78021a4
3 changed files with 41 additions and 41 deletions

View File

@ -65,13 +65,15 @@ static bytea *
gbt_text_xfrm ( bytea * leaf )
{
bytea * out = leaf;
int32 ilen = VARSIZE (leaf) - VARHDRSZ;
int32 olen ;
char sin[ilen+1];
char * sou = NULL;
memcpy ( (void*)&sin[0], (void*) VARDATA(leaf) ,ilen );
char * sin;
char * sou;
sin = palloc(ilen + 1);
memcpy (sin, (void*) VARDATA(leaf) ,ilen );
sin[ilen] = '\0';
olen = strxfrm ( NULL, &sin[0], 0 ) + 1;
sou = palloc ( olen );
olen = strxfrm ( sou , &sin[0] , olen );
@ -80,7 +82,9 @@ gbt_text_xfrm ( bytea * leaf )
out->vl_len = olen+1;
memcpy( (void*) VARDATA(out), sou, olen-VARHDRSZ );
((char*)out)[olen] = '\0';
pfree(sou);
pfree(sin);
return out;
}