diff options
author | Neil Conway | 2007-01-26 17:45:42 +0000 |
---|---|---|
committer | Neil Conway | 2007-01-26 17:45:42 +0000 |
commit | 8ff2bccee31a7be12f653bc533b3e76c052534f8 (patch) | |
tree | f56dcf47c08037f04974372492ce5a660d303472 /contrib/tsearch2 | |
parent | 8924c568202122075ae666e8815bc2960496754c (diff) |
Squelch some VC++ compiler warnings. Mark float literals with the "f"
suffix, to distinguish them from doubles. Make some function declarations
and definitions use the "const" qualifier for arguments consistently.
Ignore warning 4102 ("unreferenced label"), because such warnings
are always emitted by bison-generated code. Patch from Magnus Hagander.
Diffstat (limited to 'contrib/tsearch2')
-rw-r--r-- | contrib/tsearch2/rank.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/tsearch2/rank.c b/contrib/tsearch2/rank.c index f5de5c7746f..36fc2594009 100644 --- a/contrib/tsearch2/rank.c +++ b/contrib/tsearch2/rank.c @@ -37,7 +37,7 @@ Datum rank_cd_def(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(get_covers); Datum get_covers(PG_FUNCTION_ARGS); -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) ] ) @@ -59,7 +59,7 @@ static float4 word_distance(int4 w) { if (w > 100) - return 1e-30; + return (float4)1e-30; return 1.0 / (1.005 + 0.05 * exp(((float4) w) / 1.5 - 2)); } @@ -331,7 +331,7 @@ calc_rank(float *w, tsvector * t, QUERYTYPE * q, int4 method) calc_rank_and(w, t, q) : calc_rank_or(w, t, q); if (res < 0) - res = 1e-20; + res = (float)1e-20; if ((method & RANK_NORM_LOGLENGTH) && t->size > 0) res /= log((double) (cnt_length(t) + 1)) / log(2.0); |