bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C99-ism


From: Eric Blake
Subject: Re: C99-ism
Date: Mon, 05 Oct 2009 18:43:52 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Reuben Thomas on 10/5/2009 1:13 PM:
> Line 516 of hash.c (current git), there's a declaration of "float
> epsilon" after we've already had some statements.

Thanks.  That was from me, in commig f414a500, so I'm fixing it as follows.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrKkscACgkQ84KuGfSFAYDMhQCgl4MWI18PyQZ5pj5U5vrjfnuL
ILUAoM6lbJK4dKDXreXJcssZ1uLFxLHB
=+sL4
-----END PGP SIGNATURE-----
>From ad82c2fb130fbf3bfd3f7f9aa60e99a19ff9d396 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 5 Oct 2009 13:52:28 -0600
Subject: [PATCH] hash: allow C89 compilation

* lib/hash.c (check_tuning): Move declaration before statement.
Reported by Reuben Thomas.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog  |    6 ++++++
 lib/hash.c |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5fbcc25..e3b25c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-05  Eric Blake  <address@hidden>
+
+       hash: allow C89 compilation
+       * lib/hash.c (check_tuning): Move declaration before statement.
+       Reported by Reuben Thomas.
+
 2009-10-05  Karl Berry  <address@hidden>

        * doc/gnulib.texi: @include execvpe.texi, missing for several days.
diff --git a/lib/hash.c b/lib/hash.c
index cc6ebb3..3ab7136 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -505,6 +505,7 @@ static bool
 check_tuning (Hash_table *table)
 {
   const Hash_tuning *tuning = table->tuning;
+  float epsilon;
   if (tuning == &default_tuning)
     return true;

@@ -513,7 +514,7 @@ check_tuning (Hash_table *table)
      fail to grow or shrink as they should.  The smallest allocation
      is 11 (due to next_prime's algorithm), so an epsilon of 0.1
      should be good enough.  */
-  float epsilon = 0.1f;
+  epsilon = 0.1f;

   if (epsilon < tuning->growth_threshold
       && tuning->growth_threshold < 1 - epsilon
-- 
1.6.5.rc1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]