mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Fix msvc warnings, patch by Hannes Eder <Hannes@HannesEder.net>
This commit is contained in:
parent
282d2a03dd
commit
bab16af807
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsrank.c,v 1.7 2007/09/13 06:54:35 teodor Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsrank.c,v 1.8 2007/09/20 18:10:57 teodor Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -21,7 +21,7 @@
|
||||
#include "miscadmin.h"
|
||||
|
||||
|
||||
static float weights[] = {0.1, 0.2, 0.4, 1.0};
|
||||
static float weights[] = {0.1f, 0.2f, 0.4f, 1.0f};
|
||||
|
||||
#define wpos(wep) ( w[ WEP_GETWEIGHT(wep) ] )
|
||||
|
||||
@ -43,7 +43,7 @@ static float4
|
||||
word_distance(int4 w)
|
||||
{
|
||||
if (w > 100)
|
||||
return 1e-30;
|
||||
return 1e-30f;
|
||||
|
||||
return 1.0 / (1.005 + 0.05 * exp(((float4) w) / 1.5 - 2));
|
||||
}
|
||||
@ -336,7 +336,7 @@ calc_rank(float *w, TSVector t, TSQuery q, int4 method)
|
||||
calc_rank_and(w, t, q) : calc_rank_or(w, t, q);
|
||||
|
||||
if (res < 0)
|
||||
res = 1e-20;
|
||||
res = 1e-20f;
|
||||
|
||||
if ((method & RANK_NORM_LOGLENGTH) && t->size > 0)
|
||||
res /= log((double) (cnt_length(t) + 1)) / log(2.0);
|
||||
|
Loading…
Reference in New Issue
Block a user