Changeset 182

Show
Ignore:
Timestamp:
03/15/06 23:17:36 (3 years ago)
Author:
goodea
Message:

remove more floating point

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/common.mk

    r165 r182  
    4040        $(foreach ldir,$(LIBDIRS),-L$(ldir)) \ 
    4141        $(LIBARGS) \ 
     42        -Wl,-Map=$(PROJECT)_$(HALNAME).map \ 
     43        -Wl,--cref \ 
    4244        -Wl,-whole-archive \ 
    4345        -lhal-$(HALNAME) \ 
     
    6264clean: 
    6365        $(RM) *.hex 
     66        $(RM) *.map 
    6467        $(RM) $(PROJECT)_$(HALNAME) 
    6568        $(RM) $(PROJECT)_$(HALNAME).exe 
  • trunk/lib/lua51/Makefile

    r143 r182  
    66           lparser.c  lstrlib.c  ltm.c      lundump.c  print.c \ 
    77           lbaselib.c  ldebug.c  lfunc.c  liolib.c  lmem.c      lopcodes.c \ 
    8            lstate.c   ltable.c   lvm.c 
     8           lstate.c   ltable.c   lvm.c    lpow.c 
    99 
    1010 
     
    1313           lstate.h   ltm.h      lualib.h   lzio.h \ 
    1414           lcode.h    lfunc.h   llimits.h  lopcodes.h  lstring.h  \ 
    15            luaconf.h  lundump.h 
     15           luaconf.h  lundump.h  lpow.h 
    1616 
    1717 
  • trunk/lib/lua51/luaconf.h

    r173 r182  
    489489*/ 
    490490 
    491 #define LUA_NUMBER_DOUBLE 
    492 #define LUA_NUMBER      double 
     491/*#define LUA_NUMBER_DOUBLE */ 
     492#define LUA_NUMBER      long 
    493493 
    494494/* 
     
    496496@* over a number. 
    497497*/ 
    498 #define LUAI_UACNUMBER  double 
     498#define LUAI_UACNUMBER  long 
    499499 
    500500 
     
    506506@@ lua_str2number converts a string to a number. 
    507507*/ 
    508 #define LUA_NUMBER_SCAN         "%lf
    509 #define LUA_NUMBER_FMT          "%.14g
     508#define LUA_NUMBER_SCAN         "%ld
     509#define LUA_NUMBER_FMT          "%ld
    510510#define lua_number2str(s,n)     sprintf((s), LUA_NUMBER_FMT, (n)) 
    511511#define LUAI_MAXNUMBER2STR      32 /* 16 digits, sign, point, and \0 */ 
    512 #define lua_str2number(s,p)     strtod((s), (p)
     512#define lua_str2number(s,p)     strtol((s), (p), 10
    513513 
    514514 
     
    518518#if defined(LUA_CORE) 
    519519#include <math.h> 
     520#include "lpow.h" 
    520521#define luai_numadd(a,b)        ((a)+(b)) 
    521522#define luai_numsub(a,b)        ((a)-(b)) 
    522523#define luai_nummul(a,b)        ((a)*(b)) 
    523524#define luai_numdiv(a,b)        ((a)/(b)) 
    524 #define luai_nummod(a,b)        ((a) - floor((a)/(b))*(b)) 
    525 #define luai_numpow(a,b)        (pow(a,b)) 
     525#define luai_nummod(a,b)        ((a)%(b)) 
     526#define luai_numpow(a,b)        (lpow(a,b)) 
    526527#define luai_numunm(a)          (-(a)) 
    527528#define luai_numeq(a,b)         ((a)==(b)) 
    528529#define luai_numlt(a,b)         ((a)<(b)) 
    529530#define luai_numle(a,b)         ((a)<=(b)) 
    530 #define luai_numisnan(a)        (!luai_numeq((a), (a))
     531#define luai_numisnan(a)        (0
    531532#endif 
    532533