mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
Fix various comparing functions
This commit is contained in:
parent
01ebb55c06
commit
da2010f40b
5 changed files with 12 additions and 6 deletions
|
|
@ -92,7 +92,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 *
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
@ -654,7 +654,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,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 *
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,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 *
|
||||
|
|
|
|||
Loading…
Reference in a new issue