diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-06-27 10:15:08 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-06-27 10:15:08 -0300 |
| commit | 09c9fa36eac9d9f8f16d03a36f8b777670c5a6e4 (patch) | |
| tree | 68d4ed9ade46cd1f1d36ebabea9a9d7cb7194402 | |
| parent | dcb2998aa67224f79a2c949443e16d92fac2d3b8 (diff) | |
| download | lua-09c9fa36eac9d9f8f16d03a36f8b777670c5a6e4.tar.gz lua-09c9fa36eac9d9f8f16d03a36f8b777670c5a6e4.tar.bz2 lua-09c9fa36eac9d9f8f16d03a36f8b777670c5a6e4.zip | |
small corrections for C++ compliance
| -rw-r--r-- | lobject.c | 4 | ||||
| -rw-r--r-- | lstrlib.c | 4 |
2 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.c,v 2.110 2016/05/02 14:00:32 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.111 2016/05/20 14:07:48 roberto Exp roberto $ |
| 3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -280,7 +280,7 @@ static const char *l_str2d (const char *s, lua_Number *result) { | |||
| 280 | endptr = l_str2dloc(s, result, mode); /* try to convert */ | 280 | endptr = l_str2dloc(s, result, mode); /* try to convert */ |
| 281 | if (endptr == NULL) { /* failed? may be a different locale */ | 281 | if (endptr == NULL) { /* failed? may be a different locale */ |
| 282 | char buff[L_MAXLENNUM + 1]; | 282 | char buff[L_MAXLENNUM + 1]; |
| 283 | char *pdot = strchr(s, '.'); | 283 | const char *pdot = strchr(s, '.'); |
| 284 | if (strlen(s) > L_MAXLENNUM || pdot == NULL) | 284 | if (strlen(s) > L_MAXLENNUM || pdot == NULL) |
| 285 | return NULL; /* string too long or no dot; fail */ | 285 | return NULL; /* string too long or no dot; fail */ |
| 286 | strcpy(buff, s); /* copy string to buffer */ | 286 | strcpy(buff, s); /* copy string to buffer */ |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstrlib.c,v 1.250 2016/05/18 18:19:51 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.251 2016/05/20 14:13:21 roberto Exp roberto $ |
| 3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -933,7 +933,7 @@ static void addquoted (luaL_Buffer *b, const char *s, size_t len) { | |||
| 933 | static void checkdp (char *buff, int nb) { | 933 | static void checkdp (char *buff, int nb) { |
| 934 | if (memchr(buff, '.', nb) == NULL) { /* no dot? */ | 934 | if (memchr(buff, '.', nb) == NULL) { /* no dot? */ |
| 935 | char point = lua_getlocaledecpoint(); /* try locale point */ | 935 | char point = lua_getlocaledecpoint(); /* try locale point */ |
| 936 | char *ppoint = memchr(buff, point, nb); | 936 | char *ppoint = (char *)memchr(buff, point, nb); |
| 937 | if (ppoint) *ppoint = '.'; /* change it to a dot */ | 937 | if (ppoint) *ppoint = '.'; /* change it to a dot */ |
| 938 | } | 938 | } |
| 939 | } | 939 | } |
