Changeset 11
- Timestamp:
- Nov 10, 2005, 5:28:36 PM (17 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/include/lisp.hpp
r2 r11 1 1 #ifndef __LISP_HPP_ 2 2 #define __LISP_HPP_ 3 4 #include <stdint.h> 3 5 4 6 #include "lisp_opt.hpp" … … 35 37 L_FIXED_POINT, L_COLLECTED_OBJECT }; 36 38 37 typedef longltype; // make sure structures aren't packed differently on various compiler39 typedef uint64_t ltype; // make sure structures aren't packed differently on various compiler 38 40 // and sure that word, etc are word alligned 39 41 … … 83 85 ltype type; 84 86 #ifndef NO_LIBS 85 longalist,blist; // id for cached blocks87 intptr_t alist,blist; // id for cached blocks 86 88 #else 87 89 void *arg_list,*block_list; … … 104 106 { 105 107 ltype type; 106 short pad;107 u nsigned short ch;108 int16_t pad; 109 uint16_t ch; 108 110 } ; 109 111 … … 118 120 { 119 121 ltype type; 120 longx;122 int32_t x; 121 123 } ; 122 124 … … 156 158 157 159 void push_onto_list(void *object, void *&list); 158 lisp_symbol *add_c_object(void *symbol, short number);160 lisp_symbol *add_c_object(void *symbol, int16_t number); 159 161 lisp_symbol *add_c_function(char *name, short min_args, short max_args, short number); 160 162 lisp_symbol *add_c_bool_fun(char *name, short min_args, short max_args, short number); … … 167 169 lisp_number *new_lisp_number(long num); 168 170 lisp_pointer *new_lisp_pointer(void *addr); 169 lisp_character *new_lisp_character(u nsigned short ch);171 lisp_character *new_lisp_character(uint16_t ch); 170 172 lisp_string *new_lisp_string(char *string); 171 173 lisp_string *new_lisp_string(char *string, int length); 172 lisp_string *new_lisp_string( longlength);173 lisp_fixed_point *new_lisp_fixed_point( longx);174 lisp_object_var *new_lisp_object_var( short number);175 lisp_1d_array *new_lisp_1d_array( unsigned short size, void *rest);174 lisp_string *new_lisp_string(int length); 175 lisp_fixed_point *new_lisp_fixed_point(int32_t x); 176 lisp_object_var *new_lisp_object_var(int16_t number); 177 lisp_1d_array *new_lisp_1d_array(int size, void *rest); 176 178 lisp_sys_function *new_lisp_sys_function(int min_args, int max_args, int fun_number); 177 179 lisp_sys_function *new_lisp_c_function(int min_args, int max_args, int fun_number); … … 181 183 lisp_user_function *new_lisp_user_function(void *arg_list, void *block_list); 182 184 #else 183 lisp_user_function *new_lisp_user_function( long arg_list, longblock_list);185 lisp_user_function *new_lisp_user_function(intptr_t arg_list, intptr_t block_list); 184 186 #endif 185 187 -
abuse/trunk/src/lisp.cpp
r4 r11 213 213 } 214 214 215 lisp_1d_array *new_lisp_1d_array( ushort size, void *rest)215 lisp_1d_array *new_lisp_1d_array(int size, void *rest) 216 216 { 217 217 p_ref r11(rest); … … 262 262 } 263 263 264 lisp_fixed_point *new_lisp_fixed_point( longx)264 lisp_fixed_point *new_lisp_fixed_point(int32_t x) 265 265 { 266 266 lisp_fixed_point *p=(lisp_fixed_point *)lmalloc(sizeof(lisp_fixed_point),current_space); … … 271 271 272 272 273 lisp_object_var *new_lisp_object_var( short number)273 lisp_object_var *new_lisp_object_var(int16_t number) 274 274 { 275 275 lisp_object_var *p=(lisp_object_var *)lmalloc(sizeof(lisp_object_var),current_space); … … 289 289 } 290 290 291 struct lisp_character *new_lisp_character(u nsigned short ch)291 struct lisp_character *new_lisp_character(uint16_t ch) 292 292 { 293 293 lisp_character *c=(lisp_character *)lmalloc(sizeof(lisp_character),current_space); … … 299 299 struct lisp_string *new_lisp_string(char *string) 300 300 { 301 longsize=sizeof(lisp_string)+strlen(string)+1;301 int size=sizeof(lisp_string)+strlen(string)+1; 302 302 if (size<8) size=8; 303 303 … … 311 311 struct lisp_string *new_lisp_string(char *string, int length) 312 312 { 313 longsize=sizeof(lisp_string)+length+1;313 int size=sizeof(lisp_string)+length+1; 314 314 if (size<8) size=8; 315 315 lisp_string *s=(lisp_string *)lmalloc(size,current_space); … … 321 321 } 322 322 323 struct lisp_string *new_lisp_string( longlength)324 { 325 longsize=sizeof(lisp_string)+length;323 struct lisp_string *new_lisp_string(int length) 324 { 325 int size=sizeof(lisp_string)+length; 326 326 if (size<8) size=8; 327 327 lisp_string *s=(lisp_string *)lmalloc(size,current_space); … … 343 343 } 344 344 #else 345 lisp_user_function *new_lisp_user_function( long arg_list, longblock_list)345 lisp_user_function *new_lisp_user_function(intptr_t arg_list, intptr_t block_list) 346 346 { 347 347 int sp=current_space; … … 560 560 } 561 561 562 u nsigned short lcharacter_value(void *c)562 uint16_t lcharacter_value(void *c) 563 563 { 564 564 #ifdef TYPE_CHECKING … … 1003 1003 } 1004 1004 1005 lisp_symbol *add_c_object(void *symbol, short number)1005 lisp_symbol *add_c_object(void *symbol, int16_t number) 1006 1006 { 1007 1007 need_perm_space("add_c_object"); … … 1408 1408 } else 1409 1409 { 1410 u nsigned short ch=((lisp_character *)i)->ch;1410 uint16_t ch=((lisp_character *)i)->ch; 1411 1411 dprintf("#\\"); 1412 1412 switch (ch) … … 2182 2182 2183 2183 #ifndef NO_LIBS 2184 longa=cash.reg_lisp_block(lcar(lcdr(arg_list)));2185 longb=cash.reg_lisp_block(block_list);2184 intptr_t a=cash.reg_lisp_block(lcar(lcdr(arg_list))); 2185 intptr_t b=cash.reg_lisp_block(block_list); 2186 2186 lisp_user_function *ufun=new_lisp_user_function(a,b); 2187 2187 #else … … 2398 2398 { 2399 2399 char *gammapath; 2400 gammapath = (char *)jmalloc( strlen( get_save_filename_prefix() ) + 10, "gammapath" );2400 gammapath = (char *)jmalloc( strlen( get_save_filename_prefix() ) + 9 + 1, "gammapath" ); 2401 2401 sprintf( gammapath, "%sgamma.lsp", get_save_filename_prefix() ); 2402 2402 fp = new jFILE( gammapath, "rb" ); … … 2961 2961 for (;f_arg;f_arg=CDR(f_arg)) 2962 2962 { 2963 l_user_stack.push(((lisp_symbol *)CAR(f_arg))->value); 2963 lisp_symbol *s = (lisp_symbol *)CAR(f_arg); 2964 l_user_stack.push(s->value); 2964 2965 } 2965 2966 -
abuse/trunk/src/sdlport/sound.cpp
r4 r11 112 112 // Check for the sfx directory, disable sound if we can't find it. 113 113 datadir = get_filename_prefix(); 114 sfxdir = (char *)jmalloc( strlen( datadir ) + 6, "sfxdir" );114 sfxdir = (char *)jmalloc( strlen( datadir ) + 5 + 1, "sfxdir" ); 115 115 sprintf( sfxdir, "%s/sfx/", datadir ); 116 116 if( (fd = fopen( sfxdir,"r" )) == NULL )
Note: See TracChangeset
for help on using the changeset viewer.