aboutsummaryrefslogtreecommitdiff
path: root/lobject.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-03-28 16:14:47 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-03-28 16:14:47 -0300
commite723c75c02a48d0c766f1f30f7a321f7fdb239dc (patch)
treeaa3f11828e25ccf2dc02d077e59ee12a4313a3bd /lobject.c
parentb436ed58a3416c2e1936bdce880ac09925401a87 (diff)
downloadlua-e723c75c02a48d0c766f1f30f7a321f7fdb239dc.tar.gz
lua-e723c75c02a48d0c766f1f30f7a321f7fdb239dc.tar.bz2
lua-e723c75c02a48d0c766f1f30f7a321f7fdb239dc.zip
details (avoid 'lint' warnings)
Diffstat (limited to 'lobject.c')
-rw-r--r--lobject.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lobject.c b/lobject.c
index 60d1f3d9..3b9bde60 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.101 2014/12/26 14:43:45 roberto Exp roberto $ 2** $Id: lobject.c,v 2.102 2015/02/05 17:15:33 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*/
@@ -150,13 +150,13 @@ void luaO_arith (lua_State *L, int op, const TValue *p1, const TValue *p2,
150 } 150 }
151 /* could not perform raw operation; try metamethod */ 151 /* could not perform raw operation; try metamethod */
152 lua_assert(L != NULL); /* should not fail when folding (compile time) */ 152 lua_assert(L != NULL); /* should not fail when folding (compile time) */
153 luaT_trybinTM(L, p1, p2, res, cast(TMS, op - LUA_OPADD + TM_ADD)); 153 luaT_trybinTM(L, p1, p2, res, cast(TMS, (op - LUA_OPADD) + TM_ADD));
154} 154}
155 155
156 156
157int luaO_hexavalue (int c) { 157int luaO_hexavalue (int c) {
158 if (lisdigit(c)) return c - '0'; 158 if (lisdigit(c)) return c - '0';
159 else return ltolower(c) - 'a' + 10; 159 else return (ltolower(c) - 'a') + 10;
160} 160}
161 161
162 162
@@ -243,7 +243,7 @@ static const char *l_str2d (const char *s, lua_Number *result) {
243 *result = lua_strx2number(s, &endptr); 243 *result = lua_strx2number(s, &endptr);
244 else 244 else
245 *result = lua_str2number(s, &endptr); 245 *result = lua_str2number(s, &endptr);
246 if (endptr == s) return 0; /* nothing recognized */ 246 if (endptr == s) return NULL; /* nothing recognized */
247 while (lisspace(cast_uchar(*endptr))) endptr++; 247 while (lisspace(cast_uchar(*endptr))) endptr++;
248 return (*endptr == '\0' ? endptr : NULL); /* OK if no trailing characters */ 248 return (*endptr == '\0' ? endptr : NULL); /* OK if no trailing characters */
249} 249}
@@ -289,7 +289,7 @@ size_t luaO_str2num (const char *s, TValue *o) {
289 } 289 }
290 else 290 else
291 return 0; /* conversion failed */ 291 return 0; /* conversion failed */
292 return (e - s + 1); /* success; return string size */ 292 return (e - s) + 1; /* success; return string size */
293} 293}
294 294
295 295