Browse Source

'luaO_arith' -> 'luaO_numarith'

pull/9/head
Roberto Ierusalimschy 12 years ago
parent
commit
00744a2729
  1. 4
      lcode.c
  2. 4
      lobject.c
  3. 4
      lobject.h

4
lcode.c

@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 2.65 2013/04/25 19:35:19 roberto Exp $
** $Id: lcode.c,v 2.66 2013/04/26 13:07:53 roberto Exp roberto $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@ -734,7 +734,7 @@ static int constfolding (OpCode op, expdesc *e1, expdesc *e2) {
if (!isnumeral(e1) || !isnumeral(e2)) return 0;
if ((op == OP_DIV || op == OP_IDIV || op == OP_MOD) && e2->u.nval == 0)
return 0; /* do not attempt to divide by 0 */
r = luaO_arith(op - OP_ADD + LUA_OPADD, e1->u.nval, e2->u.nval);
r = luaO_numarith(op - OP_ADD + LUA_OPADD, e1->u.nval, e2->u.nval);
e1->u.nval = r;
return 1;
}

4
lobject.c

@ -1,5 +1,5 @@
/*
** $Id: lobject.c,v 2.59 2013/04/16 18:46:28 roberto Exp roberto $
** $Id: lobject.c,v 2.60 2013/04/25 13:53:13 roberto Exp roberto $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@ -70,7 +70,7 @@ int luaO_ceillog2 (unsigned int x) {
}
lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2) {
lua_Number luaO_numarith (int op, lua_Number v1, lua_Number v2) {
switch (op) {
case LUA_OPADD: return luai_numadd(NULL, v1, v2);
case LUA_OPSUB: return luai_numsub(NULL, v1, v2);

4
lobject.h

@ -1,5 +1,5 @@
/*
** $Id: lobject.h,v 2.73 2013/04/15 15:44:46 roberto Exp roberto $
** $Id: lobject.h,v 2.74 2013/04/16 18:46:28 roberto Exp roberto $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@ -496,7 +496,7 @@ LUAI_DDEC const TValue luaO_nilobject_;
LUAI_FUNC int luaO_int2fb (unsigned int x);
LUAI_FUNC int luaO_fb2int (int x);
LUAI_FUNC int luaO_ceillog2 (unsigned int x);
LUAI_FUNC lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2);
LUAI_FUNC lua_Number luaO_numarith (int op, lua_Number v1, lua_Number v2);
LUAI_FUNC int luaO_str2d (const char *s, size_t len, lua_Number *result);
LUAI_FUNC int luaO_str2int (const char *s, lua_Integer *result);
LUAI_FUNC int luaO_hexavalue (int c);

Loading…
Cancel
Save