summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2016-06-27 10:15:08 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2016-06-27 10:15:08 -0300
commit09c9fa36eac9d9f8f16d03a36f8b777670c5a6e4 (patch)
tree68d4ed9ade46cd1f1d36ebabea9a9d7cb7194402
parentdcb2998aa67224f79a2c949443e16d92fac2d3b8 (diff)
downloadlua-github-09c9fa36eac9d9f8f16d03a36f8b777670c5a6e4.tar.gz
small corrections for C++ compliance
-rw-r--r--lobject.c4
-rw-r--r--lstrlib.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lobject.c b/lobject.c
index 6c72144a..2ecca865 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.c,v 2.110 2016/05/02 14:00:32 roberto Exp roberto $
+** $Id: lobject.c,v 2.111 2016/05/20 14:07:48 roberto Exp roberto $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@@ -280,7 +280,7 @@ static const char *l_str2d (const char *s, lua_Number *result) {
endptr = l_str2dloc(s, result, mode); /* try to convert */
if (endptr == NULL) { /* failed? may be a different locale */
char buff[L_MAXLENNUM + 1];
- char *pdot = strchr(s, '.');
+ const char *pdot = strchr(s, '.');
if (strlen(s) > L_MAXLENNUM || pdot == NULL)
return NULL; /* string too long or no dot; fail */
strcpy(buff, s); /* copy string to buffer */
diff --git a/lstrlib.c b/lstrlib.c
index a18b6299..8d3f305c 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.250 2016/05/18 18:19:51 roberto Exp roberto $
+** $Id: lstrlib.c,v 1.251 2016/05/20 14:13:21 roberto Exp roberto $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -933,7 +933,7 @@ static void addquoted (luaL_Buffer *b, const char *s, size_t len) {
static void checkdp (char *buff, int nb) {
if (memchr(buff, '.', nb) == NULL) { /* no dot? */
char point = lua_getlocaledecpoint(); /* try locale point */
- char *ppoint = memchr(buff, point, nb);
+ char *ppoint = (char *)memchr(buff, point, nb);
if (ppoint) *ppoint = '.'; /* change it to a dot */
}
}