1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-17 06:41:24 +03:00

Fix various comparing functions

This commit is contained in:
Teodor Sigaev 2005-03-31 15:12:08 +00:00
parent 12fa5c57ac
commit 7d19650a79
5 changed files with 12 additions and 6 deletions

View File

@ -88,7 +88,9 @@ reset_dict(void)
static int
comparedict(const void *a, const void *b)
{
return ((DictInfo *) a)->dict_id - ((DictInfo *) b)->dict_id;
if ( ((DictInfo *) a)->dict_id == ((DictInfo *) b)->dict_id )
return 0;
return ( ((DictInfo *) a)->dict_id < ((DictInfo *) b)->dict_id ) ? -1 : 1;
}
DictInfo *

View File

@ -386,7 +386,7 @@ static int
compareDocR(const void *a, const void *b)
{
if (((DocRepresentation *) a)->pos == ((DocRepresentation *) b)->pos)
return 1;
return 0;
return (((DocRepresentation *) a)->pos > ((DocRepresentation *) b)->pos) ? 1 : -1;
}
@ -652,7 +652,7 @@ static int
compareDocWord(const void *a, const void *b)
{
if (((DocWord *) a)->pos == ((DocWord *) b)->pos)
return 1;
return 0;
return (((DocWord *) a)->pos > ((DocWord *) b)->pos) ? 1 : -1;
}

View File

@ -181,7 +181,9 @@ reset_cfg(void)
static int
comparecfg(const void *a, const void *b)
{
return ((TSCfgInfo *) a)->id - ((TSCfgInfo *) b)->id;
if ( ((TSCfgInfo *) a)->id == ((TSCfgInfo *) b)->id )
return 0;
return ( ((TSCfgInfo *) a)->id < ((TSCfgInfo *) b)->id ) ? -1 : 1;
}
TSCfgInfo *

View File

@ -51,7 +51,7 @@ static int
comparePos(const void *a, const void *b)
{
if (((WordEntryPos *) a)->pos == ((WordEntryPos *) b)->pos)
return 1;
return 0;
return (((WordEntryPos *) a)->pos > ((WordEntryPos *) b)->pos) ? 1 : -1;
}

View File

@ -87,7 +87,9 @@ reset_prs(void)
static int
compareprs(const void *a, const void *b)
{
return ((WParserInfo *) a)->prs_id - ((WParserInfo *) b)->prs_id;
if ( ((WParserInfo *) a)->prs_id == ((WParserInfo *) b)->prs_id )
return 0;
return ( ((WParserInfo *) a)->prs_id < ((WParserInfo *) b)->prs_id ) ? -1 : 1;
}
WParserInfo *