Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/m4/lib fix compilation.



details:   https://anonhg.NetBSD.org/src/rev/8047a53fc5d8
branches:  trunk
changeset: 748548:8047a53fc5d8
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 26 21:14:18 2009 +0000

description:
fix compilation.

diffstat:

 usr.bin/m4/lib/ohash_do.c   |  4 ++--
 usr.bin/m4/lib/ohash_enum.c |  2 +-
 usr.bin/m4/lib/strtonum.c   |  9 ++++++++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diffs (58 lines):

diff -r d80f8a9f9f9b -r 8047a53fc5d8 usr.bin/m4/lib/ohash_do.c
--- a/usr.bin/m4/lib/ohash_do.c Mon Oct 26 21:12:47 2009 +0000
+++ b/usr.bin/m4/lib/ohash_do.c Mon Oct 26 21:14:18 2009 +0000
@@ -68,7 +68,7 @@
 void *
 ohash_remove(struct ohash *h, unsigned int i)
 {
-       void            *result = (void *)h->t[i].p;
+       void            *result = __UNCONST(h->t[i].p);
 
        if (result == NULL || result == DELETED)
                return NULL;
@@ -89,7 +89,7 @@
        if (h->t[i].p == DELETED)
                return NULL;
        else
-               return (void *)h->t[i].p;
+               return __UNCONST(h->t[i].p);
 }
 
 void *
diff -r d80f8a9f9f9b -r 8047a53fc5d8 usr.bin/m4/lib/ohash_enum.c
--- a/usr.bin/m4/lib/ohash_enum.c       Mon Oct 26 21:12:47 2009 +0000
+++ b/usr.bin/m4/lib/ohash_enum.c       Mon Oct 26 21:14:18 2009 +0000
@@ -31,6 +31,6 @@
 {
        for (; *pos < h->size; (*pos)++) 
                if (h->t[*pos].p != DELETED && h->t[*pos].p != NULL) 
-                       return (void *)h->t[(*pos)++].p;
+                       return __UNCONST(h->t[(*pos)++].p);
        return NULL;
 }
diff -r d80f8a9f9f9b -r 8047a53fc5d8 usr.bin/m4/lib/strtonum.c
--- a/usr.bin/m4/lib/strtonum.c Mon Oct 26 21:12:47 2009 +0000
+++ b/usr.bin/m4/lib/strtonum.c Mon Oct 26 21:14:18 2009 +0000
@@ -16,7 +16,11 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
-
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: strtonum.c,v 1.2 2009/10/26 21:14:18 christos Exp $");
 #include <errno.h>
 #include <limits.h>
 #include <stdlib.h>
@@ -27,6 +31,9 @@
 
 long long
 strtonum(const char *numstr, long long minval, long long maxval,
+    const char **errstrp);
+long long
+strtonum(const char *numstr, long long minval, long long maxval,
     const char **errstrp)
 {
        long long ll = 0;



Home | Main Index | Thread Index | Old Index