Module Name: src
Committed By: lneto
Date: Mon Dec 2 04:39:10 UTC 2013
Modified Files:
src/lib/libc/stdlib: Makefile.inc
src/sys/lib/libkern: Makefile.libkern libkern.h
src/sys/modules/lua: Makefile luaconf.h
Added Files:
src/common/lib/libc/stdlib: strtoimax.c
Removed Files:
src/lib/libc/stdlib: strtoimax.c
Log Message:
changed lua_Number to int64_t
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/common/lib/libc/stdlib/strtoimax.c
cvs rdiff -u -r1.79 -r1.80 src/lib/libc/stdlib/Makefile.inc
cvs rdiff -u -r1.8 -r0 src/lib/libc/stdlib/strtoimax.c
cvs rdiff -u -r1.26 -r1.27 src/sys/lib/libkern/Makefile.libkern
cvs rdiff -u -r1.108 -r1.109 src/sys/lib/libkern/libkern.h
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/lua/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/lua/luaconf.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/stdlib/Makefile.inc
diff -u src/lib/libc/stdlib/Makefile.inc:1.79 src/lib/libc/stdlib/Makefile.inc:1.80
--- src/lib/libc/stdlib/Makefile.inc:1.79 Fri Apr 26 18:29:55 2013
+++ src/lib/libc/stdlib/Makefile.inc Mon Dec 2 04:39:10 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.79 2013/04/26 18:29:55 christos Exp $
+# $NetBSD: Makefile.inc,v 1.80 2013/12/02 04:39:10 lneto Exp $
# from: @(#)Makefile.inc 8.3 (Berkeley) 2/4/95
# stdlib sources
@@ -30,7 +30,6 @@ SRCS+= jemalloc.c
SRCS+= malloc.c
.endif
-CPPFLAGS.strtoimax.c+= -I${LIBCDIR}/../../common/lib/libc/stdlib
CPPFLAGS.strtol.c+= -I${LIBCDIR}/../../common/lib/libc/stdlib
CPPFLAGS.strtoq.c+= -I${LIBCDIR}/../../common/lib/libc/stdlib
CPPFLAGS.strtouq.c+= -I${LIBCDIR}/../../common/lib/libc/stdlib
Index: src/sys/lib/libkern/Makefile.libkern
diff -u src/sys/lib/libkern/Makefile.libkern:1.26 src/sys/lib/libkern/Makefile.libkern:1.27
--- src/sys/lib/libkern/Makefile.libkern:1.26 Tue Jul 23 14:52:07 2013
+++ src/sys/lib/libkern/Makefile.libkern Mon Dec 2 04:39:10 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.libkern,v 1.26 2013/07/23 14:52:07 skrll Exp $
+# $NetBSD: Makefile.libkern,v 1.27 2013/12/02 04:39:10 lneto Exp $
#
# Variable definitions for libkern.
@@ -80,7 +80,7 @@ SRCS+= memset.c
.endif
SRCS+= popcount32.c popcount64.c
-SRCS+= strtoul.c strtoll.c strtoull.c strtoumax.c
+SRCS+= strtoul.c strtoll.c strtoull.c strtoimax.c strtoumax.c
SRCS+= scanc.c skpc.c
SRCS+= random.c
Index: src/sys/lib/libkern/libkern.h
diff -u src/sys/lib/libkern/libkern.h:1.108 src/sys/lib/libkern/libkern.h:1.109
--- src/sys/lib/libkern/libkern.h:1.108 Wed Aug 28 16:20:38 2013
+++ src/sys/lib/libkern/libkern.h Mon Dec 2 04:39:10 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: libkern.h,v 1.108 2013/08/28 16:20:38 riastradh Exp $ */
+/* $NetBSD: libkern.h,v 1.109 2013/12/02 04:39:10 lneto Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -334,6 +334,7 @@ int strncasecmp(const char *, const cha
u_long strtoul(const char *, char **, int);
long long strtoll(const char *, char **, int);
unsigned long long strtoull(const char *, char **, int);
+intmax_t strtoimax(const char *, char **, int);
uintmax_t strtoumax(const char *, char **, int);
int snprintb(char *, size_t, const char *, uint64_t);
int snprintb_m(char *, size_t, const char *, uint64_t, size_t);
Index: src/sys/modules/lua/Makefile
diff -u src/sys/modules/lua/Makefile:1.2 src/sys/modules/lua/Makefile:1.3
--- src/sys/modules/lua/Makefile:1.2 Thu Oct 31 16:50:14 2013
+++ src/sys/modules/lua/Makefile Mon Dec 2 04:39:10 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2013/10/31 16:50:14 mbalmer Exp $
+# $NetBSD: Makefile,v 1.3 2013/12/02 04:39:10 lneto Exp $
.include "../Makefile.inc"
@@ -44,6 +44,7 @@ SRCS+= strcspn.c \
CFLAGS+= -include ${.CURDIR}/luaconf.h
-CPPFLAGS+= -I${S}/../external/mit/lua/dist/src
+CPPFLAGS+= -I${S}/../external/mit/lua/dist/src \
+ -I${S}/sys
.include <bsd.kmodule.mk>
Index: src/sys/modules/lua/luaconf.h
diff -u src/sys/modules/lua/luaconf.h:1.1 src/sys/modules/lua/luaconf.h:1.2
--- src/sys/modules/lua/luaconf.h:1.1 Wed Oct 16 19:44:57 2013
+++ src/sys/modules/lua/luaconf.h Mon Dec 2 04:39:10 2013
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.1 2013/10/16 19:44:57 mbalmer Exp $
+** $Id: luaconf.h,v 1.2 2013/12/02 04:39:10 lneto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -505,8 +505,7 @@
*/
#ifdef _KERNEL
-#define LUA_NUMBER long long
-
+#define LUA_NUMBER int64_t
#else
#define LUA_NUMBER_DOUBLE
#define LUA_NUMBER double
@@ -528,9 +527,9 @@
*/
#ifdef _KERNEL
-#define LUA_NUMBER_SCAN "%lld"
-#define LUA_NUMBER_FMT "%lld"
-#define lua_str2number(s,p) strtoll((s), (p), 10)
+#define LUA_NUMBER_SCAN "%" SCNd64
+#define LUA_NUMBER_FMT "%" PRId64
+#define lua_str2number(s,p) ((int64_t) strtoimax((s), (p), 10))
#else
#define LUA_NUMBER_SCAN "%lf"
#define LUA_NUMBER_FMT "%.14g"
Added files:
Index: src/common/lib/libc/stdlib/strtoimax.c
diff -u /dev/null src/common/lib/libc/stdlib/strtoimax.c:1.1
--- /dev/null Mon Dec 2 04:39:10 2013
+++ src/common/lib/libc/stdlib/strtoimax.c Mon Dec 2 04:39:10 2013
@@ -0,0 +1,68 @@
+/* $DragonFly: src/lib/libc/stdlib/strtoimax.c,v 1.2 2008/08/19 15:50:24 joerg Exp $ */
+
+/*-
+ * Copyright (c) 2005 The DragonFly Project. All rights reserved.
+ * Copyright (c) 2003 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: strtoimax.c,v 1.1 2013/12/02 04:39:10 lneto Exp $");
+
+#ifdef _LIBC
+#include "namespace.h"
+#endif
+
+#if defined(_KERNEL)
+#include <sys/param.h>
+#include <lib/libkern/libkern.h>
+#elif defined(_STANDALONE)
+#include <sys/param.h>
+#include <lib/libkern/libkern.h>
+#include <lib/libsa/stand.h>
+#else
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdlib.h>
+#endif
+
+#define _FUNCNAME strtoimax
+#define __INT intmax_t
+#define __INT_MIN INTMAX_MIN
+#define __INT_MAX INTMAX_MAX
+
+#include "_strtol.h"
+
+#ifdef _LIBC
+__weak_alias(_strtoimax, strtoimax)
+__weak_alias(_strtoimax_l, strtoimax_l)
+#endif