IMPROVES-i6 wrapper sequal(a,b,shold) : sequal_full(...)
This commit is contained in:
14
lib11sht.c
14
lib11sht.c
@@ -36,7 +36,17 @@ int fequal(float a, float b, float delta)
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int sequal(char *a, char *b, float thr, float *ratio, char *s1, char *s2)
|
||||
/* Simple wrapper: most callers don't need the ratio or normalized buffers.
|
||||
* Symmetric with fequal(a, b, delta). */
|
||||
int sequal(char *a, char *b, float shold)
|
||||
{
|
||||
float ratio;
|
||||
char s1[LEVN_SBUFF], s2[LEVN_SBUFF];
|
||||
return sequal_full(a, b, shold, &ratio, s1, s2);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int sequal_full(char *a, char *b, float shold, float *ratio, char *s1, char *s2)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -67,7 +77,7 @@ int sequal(char *a, char *b, float thr, float *ratio, char *s1, char *s2)
|
||||
return 0;
|
||||
}
|
||||
*ratio = shit11(s1, s2);
|
||||
if(*ratio > thr)
|
||||
if(*ratio > shold)
|
||||
return 0;
|
||||
return (i < 0)? -1 : 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user