Changeset 11 for abuse


Ignore:
Timestamp:
Nov 10, 2005, 5:28:36 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • fixed 64 bit issues here and there.
Location:
abuse/trunk/src
Files:
3 edited

Legend:

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

    r2 r11  
    11#ifndef __LISP_HPP_
    22#define __LISP_HPP_
     3
     4#include <stdint.h>
    35
    46#include "lisp_opt.hpp"
     
    3537       L_FIXED_POINT, L_COLLECTED_OBJECT };
    3638
    37 typedef long ltype;    // make sure structures aren't packed differently on various compiler
     39typedef uint64_t ltype;    // make sure structures aren't packed differently on various compiler
    3840                       // and sure that word, etc are word alligned
    3941
     
    8385  ltype type;
    8486#ifndef NO_LIBS
    85   long alist,blist;      // id for cached blocks
     87  intptr_t alist,blist;      // id for cached blocks
    8688#else
    8789  void *arg_list,*block_list;
     
    104106{
    105107  ltype type;
    106   short pad;
    107   unsigned short ch;
     108  int16_t pad;
     109  uint16_t ch;
    108110} ;
    109111
     
    118120{
    119121  ltype type;
    120   long x;
     122  int32_t x;
    121123} ;
    122124
     
    156158
    157159void push_onto_list(void *object, void *&list);
    158 lisp_symbol *add_c_object(void *symbol, short number);
     160lisp_symbol *add_c_object(void *symbol, int16_t number);
    159161lisp_symbol *add_c_function(char *name, short min_args, short max_args, short number);
    160162lisp_symbol *add_c_bool_fun(char *name, short min_args, short max_args, short number);
     
    167169lisp_number *new_lisp_number(long num);
    168170lisp_pointer *new_lisp_pointer(void *addr);
    169 lisp_character *new_lisp_character(unsigned short ch);
     171lisp_character *new_lisp_character(uint16_t ch);
    170172lisp_string *new_lisp_string(char *string);
    171173lisp_string *new_lisp_string(char *string, int length);
    172 lisp_string *new_lisp_string(long length);
    173 lisp_fixed_point *new_lisp_fixed_point(long x);
    174 lisp_object_var *new_lisp_object_var(short number);
    175 lisp_1d_array   *new_lisp_1d_array(unsigned short size, void *rest);
     174lisp_string *new_lisp_string(int length);
     175lisp_fixed_point *new_lisp_fixed_point(int32_t x);
     176lisp_object_var *new_lisp_object_var(int16_t number);
     177lisp_1d_array   *new_lisp_1d_array(int size, void *rest);
    176178lisp_sys_function *new_lisp_sys_function(int min_args, int max_args, int fun_number);
    177179lisp_sys_function *new_lisp_c_function(int min_args, int max_args, int fun_number);
     
    181183lisp_user_function *new_lisp_user_function(void *arg_list, void *block_list);
    182184#else
    183 lisp_user_function *new_lisp_user_function(long arg_list, long block_list);
     185lisp_user_function *new_lisp_user_function(intptr_t arg_list, intptr_t block_list);
    184186#endif
    185187
  • abuse/trunk/src/lisp.cpp

    r4 r11  
    213213}
    214214
    215 lisp_1d_array *new_lisp_1d_array(ushort size, void *rest)
     215lisp_1d_array *new_lisp_1d_array(int size, void *rest)
    216216{
    217217  p_ref r11(rest);
     
    262262}
    263263
    264 lisp_fixed_point *new_lisp_fixed_point(long x)
     264lisp_fixed_point *new_lisp_fixed_point(int32_t x)
    265265{
    266266  lisp_fixed_point *p=(lisp_fixed_point *)lmalloc(sizeof(lisp_fixed_point),current_space);
     
    271271
    272272
    273 lisp_object_var *new_lisp_object_var(short number)
     273lisp_object_var *new_lisp_object_var(int16_t number)
    274274{
    275275  lisp_object_var *p=(lisp_object_var *)lmalloc(sizeof(lisp_object_var),current_space);
     
    289289}
    290290
    291 struct lisp_character *new_lisp_character(unsigned short ch)
     291struct lisp_character *new_lisp_character(uint16_t ch)
    292292{
    293293  lisp_character *c=(lisp_character *)lmalloc(sizeof(lisp_character),current_space);
     
    299299struct lisp_string *new_lisp_string(char *string)
    300300{
    301   long size=sizeof(lisp_string)+strlen(string)+1;
     301  int size=sizeof(lisp_string)+strlen(string)+1;
    302302  if (size<8) size=8;
    303303
     
    311311struct lisp_string *new_lisp_string(char *string, int length)
    312312{
    313   long size=sizeof(lisp_string)+length+1;
     313  int size=sizeof(lisp_string)+length+1;
    314314  if (size<8) size=8;
    315315  lisp_string *s=(lisp_string *)lmalloc(size,current_space);
     
    321321}
    322322
    323 struct lisp_string *new_lisp_string(long length)
    324 {
    325   long size=sizeof(lisp_string)+length;
     323struct lisp_string *new_lisp_string(int length)
     324{
     325  int size=sizeof(lisp_string)+length;
    326326  if (size<8) size=8;
    327327  lisp_string *s=(lisp_string *)lmalloc(size,current_space);
     
    343343}
    344344#else
    345 lisp_user_function *new_lisp_user_function(long arg_list, long block_list)
     345lisp_user_function *new_lisp_user_function(intptr_t arg_list, intptr_t block_list)
    346346{
    347347  int sp=current_space;
     
    560560}
    561561
    562 unsigned short lcharacter_value(void *c)
     562uint16_t lcharacter_value(void *c)
    563563{
    564564#ifdef TYPE_CHECKING
     
    10031003}
    10041004
    1005 lisp_symbol *add_c_object(void *symbol, short number)
     1005lisp_symbol *add_c_object(void *symbol, int16_t number)
    10061006{
    10071007  need_perm_space("add_c_object");
     
    14081408                                } else
    14091409                                {
    1410                                   unsigned short ch=((lisp_character *)i)->ch;
     1410                                  uint16_t ch=((lisp_character *)i)->ch;
    14111411                                  dprintf("#\\");
    14121412                                  switch (ch)
     
    21822182
    21832183#ifndef NO_LIBS
    2184       long a=cash.reg_lisp_block(lcar(lcdr(arg_list)));
    2185       long b=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);
    21862186      lisp_user_function *ufun=new_lisp_user_function(a,b);
    21872187#else
     
    23982398                                {
    23992399                                        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" );
    24012401                                        sprintf( gammapath, "%sgamma.lsp", get_save_filename_prefix() );
    24022402                                        fp = new jFILE( gammapath, "rb" );
     
    29612961  for (;f_arg;f_arg=CDR(f_arg))
    29622962  {
    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);
    29642965  }
    29652966
  • abuse/trunk/src/sdlport/sound.cpp

    r4 r11  
    112112        // Check for the sfx directory, disable sound if we can't find it.
    113113        datadir = get_filename_prefix();
    114         sfxdir = (char *)jmalloc( strlen( datadir ) + 6, "sfxdir" );
     114        sfxdir = (char *)jmalloc( strlen( datadir ) + 5 + 1, "sfxdir" );
    115115        sprintf( sfxdir, "%s/sfx/", datadir );
    116116        if( (fd = fopen( sfxdir,"r" )) == NULL )
Note: See TracChangeset for help on using the changeset viewer.