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 *
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;
}
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;
}
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 *
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;
}
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 *