Ignore:
Timestamp:
Mar 2, 2008, 1:58:48 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Fix argument types in lisp_cos(), lisp_sin() and lisp_atan() to avoid overflows. Closes #1 #2 #3.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/include/lisp.hpp

    r39 r43  
    2121
    2222#define FIXED_TRIG_SIZE 360               // 360 degrees stored in table
    23 extern long sin_table[FIXED_TRIG_SIZE];   // this should be filled in by external module
     23extern int32_t sin_table[FIXED_TRIG_SIZE];   // this should be filled in by external module
    2424#define TBS 1662                          // atan table granularity
    25 extern unsigned short atan_table[TBS];
     25extern uint16_t atan_table[TBS];
    2626#define NILP(x) (x==NULL)
    2727#define DEFINEDP(x) (x!=l_undefined)
     
    197197extern int space_size[4];
    198198void *nth(int num, void *list);
    199 long lisp_atan2(long dy, long dx);
    200 long lisp_sin(long x);
    201 long lisp_cos(long x);
     199int32_t lisp_atan2(int32_t dy, int32_t dx);
     200int32_t lisp_sin(int32_t x);
     201int32_t lisp_cos(int32_t x);
    202202void restore_heap(void *val, int heap);
    203203void *mark_heap(int heap);
Note: See TracChangeset for help on using the changeset viewer.