From: John L. <jr...@us...> - 2007-06-26 03:22:49
|
Update of /cvsroot/wxlua/wxLua/modules/lua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15715/wxLua/modules/lua/src Modified Files: lcode.c ldebug.c ltable.c lvm.c Log Message: Added more classes Updated lua 5.1.2 with patches 1-6 Made wxluasudoku a little faster Index: ltable.c =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/lua/src/ltable.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ltable.c 29 Mar 2006 05:48:11 -0000 1.2 --- ltable.c 26 Jun 2007 03:22:05 -0000 1.3 *************** *** 49,53 **** #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) ! #define hashstr(t,str) hashpow2(t, (str)->tsv.hash) #define hashboolean(t,p) hashpow2(t, p) --- 49,53 ---- #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) ! #define hashstr(t,str) hashpow2(t, (str)->tsv.hash) #define hashboolean(t,p) hashpow2(t, p) *************** *** 85,90 **** unsigned int a[numints]; int i; ! n += 1; /* normalize number (avoid -0) */ ! lua_assert(sizeof(a) <= sizeof(n)); memcpy(a, &n, sizeof(a)); for (i = 1; i < numints; i++) a[0] += a[i]; --- 85,90 ---- unsigned int a[numints]; int i; ! if (luai_numeq(n, 0)) /* avoid problems with -0 */ ! return gnode(t, 0); memcpy(a, &n, sizeof(a)); for (i = 1; i < numints; i++) a[0] += a[i]; *************** *** 303,307 **** setarrayvector(L, t, nasize); /* create new hash part with appropriate size */ ! setnodevector(L, t, nhsize); if (nasize < oldasize) { /* array part must shrink? */ t->sizearray = nasize; --- 303,307 ---- setarrayvector(L, t, nasize); /* create new hash part with appropriate size */ ! setnodevector(L, t, nhsize); if (nasize < oldasize) { /* array part must shrink? */ t->sizearray = nasize; *************** *** 391,399 **** /* ! ** inserts a new key into a hash table; first, check whether key's main ! ** position is free. If not, check whether colliding node is in its main ! ** position or not: if it is not, move colliding node to an empty place and ! ** put new key in its main position; otherwise (colliding node is in its main ! ** position), new key goes to an empty position. */ static TValue *newkey (lua_State *L, Table *t, const TValue *key) { --- 391,399 ---- /* ! ** inserts a new key into a hash table; first, check whether key's main ! ** position is free. If not, check whether colliding node is in its main ! ** position or not: if it is not, move colliding node to an empty place and ! ** put new key in its main position; otherwise (colliding node is in its main ! ** position), new key goes to an empty position. */ static TValue *newkey (lua_State *L, Table *t, const TValue *key) { Index: lvm.c =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/lua/src/lvm.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lvm.c 25 Apr 2007 02:52:20 -0000 1.4 --- lvm.c 26 Jun 2007 03:22:05 -0000 1.5 *************** *** 62,70 **** const Instruction *oldpc = L->savedpc; L->savedpc = pc; ! if (mask > LUA_MASKLINE) { /* instruction-hook set? */ ! if (L->hookcount == 0) { ! resethookcount(L); ! luaD_callhook(L, LUA_HOOKCOUNT, -1); ! } } if (mask & LUA_MASKLINE) { --- 62,68 ---- const Instruction *oldpc = L->savedpc; L->savedpc = pc; ! if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { ! resethookcount(L); ! luaD_callhook(L, LUA_HOOKCOUNT, -1); } if (mask & LUA_MASKLINE) { *************** *** 128,132 **** return; } ! t = tm; /* else repeat with `tm' */ } luaG_runerror(L, "loop in gettable"); --- 126,130 ---- return; } ! t = tm; /* else repeat with `tm' */ } luaG_runerror(L, "loop in gettable"); *************** *** 155,159 **** return; } ! t = tm; /* else repeat with `tm' */ } luaG_runerror(L, "loop in settable"); --- 153,157 ---- return; } ! t = tm; /* else repeat with `tm' */ } luaG_runerror(L, "loop in settable"); Index: ldebug.c =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/lua/src/ldebug.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ldebug.c 22 Sep 2006 19:39:59 -0000 1.3 --- ldebug.c 26 Jun 2007 03:22:05 -0000 1.4 *************** *** 564,569 **** void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { ! if (ttisstring(p1)) p1 = p2; ! lua_assert(!ttisstring(p1)); luaG_typeerror(L, p1, "concatenate"); } --- 564,569 ---- void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { ! if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; ! lua_assert(!ttisstring(p1) && !ttisnumber(p1)); luaG_typeerror(L, p1, "concatenate"); } Index: lcode.c =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/lua/src/lcode.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** lcode.c 25 Apr 2007 02:52:20 -0000 1.5 --- lcode.c 26 Jun 2007 03:22:05 -0000 1.6 *************** *** 700,704 **** switch (op) { case OPR_MINUS: { ! if (e->k == VK) luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ codearith(fs, OP_UNM, e, &e2); --- 700,704 ---- switch (op) { case OPR_MINUS: { ! if (!isnumeral(e)) luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ codearith(fs, OP_UNM, e, &e2); |