Changeset 492


Ignore:
Timestamp:
Apr 17, 2011, 10:28:52 AM (6 years ago)
Author:
sam
Message:

lisp: rename core classes to slightly shorter names (LispObject? -> LObject).

Location:
abuse/trunk/src
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/ant.cpp

    r491 r492  
    113113    PtrRef r1(call_list);
    114114    push_onto_list(new_lisp_pointer(b),call_list);
    115     push_onto_list(LispNumber::Create(angle),call_list);
    116     push_onto_list(LispNumber::Create(firey),call_list);
    117     push_onto_list(LispNumber::Create(firex),call_list);
    118     push_onto_list(LispNumber::Create(o->aitype()),call_list);
     115    push_onto_list(LNumber::Create(angle),call_list);
     116    push_onto_list(LNumber::Create(firey),call_list);
     117    push_onto_list(LNumber::Create(firex),call_list);
     118    push_onto_list(LNumber::Create(o->aitype()),call_list);
    119119    push_onto_list(new_lisp_pointer(o),call_list);
    120     eval_user_fun((LispSymbol *)l_fire_object,call_list);
     120    eval_user_fun((LSymbol *)l_fire_object,call_list);
    121121    o->set_state((character_state)S_weapon_fire);
    122122  }
  • abuse/trunk/src/cache.cpp

    r491 r492  
    384384
    385385    void *call_with=NULL;
    386     push_onto_list(LispNumber::Create(type),call_with);
    387 
    388     void *CacheList=eval_function((LispSymbol *)cache_fun,call_with);
     386    push_onto_list(LNumber::Create(type),call_with);
     387
     388    void *CacheList=eval_function((LSymbol *)cache_fun,call_with);
    389389    PtrRef r1(CacheList);
    390390
  • abuse/trunk/src/chars.cpp

    r491 r492  
    110110    int sp=current_space;
    111111    current_space=PERM_SPACE;
    112     ((LispSymbol *)symbol)->SetNumber(num);
     112    ((LSymbol *)symbol)->SetNumber(num);
    113113    current_space=sp;
    114114  }
     
    119119    lbreak("symbol has been assigned value %d, but value already in use by state %s\n"
    120120       "use a different symbol for this state\n",
    121        lstring_value(((LispSymbol *)seq_syms[num])->GetName()));
     121       lstring_value(((LSymbol *)seq_syms[num])->GetName()));
    122122    exit(0);
    123123  } else if (num>=ts)
     
    173173    return 0;
    174174  }
    175   return LispNumber::Create(current_object->lvars[t->var_index[number]]);
     175  return LNumber::Create(current_object->lvars[t->var_index[number]]);
    176176}
    177177
     
    202202  /* First see if the variable has been defined for another object
    203203     if so report a conflict if any occur */
    204   LispSymbol *s=(LispSymbol *)symbol;
     204  LSymbol *s=(LSymbol *)symbol;
    205205  if (DEFINEDP(s->value) && (item_type(s->value)!=L_OBJECT_VAR))
    206206  {
     
    210210  } else if (DEFINEDP(s->value))
    211211  {
    212     int index=((LispObjectVar *)s->value)->number;
     212    int index=((LObjectVar *)s->value)->number;
    213213    if (index<tiv)
    214214    {
     
    219219           "  with index %d, but %s has a var listed '%s' with same index\n"
    220220           "  try moving definition of %s before previously declared object",
    221            lstring_value(((LispSymbol *)name)->GetName()),
    222            lstring_value(((LispSymbol *)symbol)->GetName()),
     221           lstring_value(((LSymbol *)name)->GetName()),
     222           lstring_value(((LSymbol *)symbol)->GetName()),
    223223           index,
    224            lstring_value(((LispSymbol *)name)->GetName()),
    225            lstring_value(((LispSymbol *)vars[index])->GetName()),
    226            lstring_value(((LispSymbol *)name)->GetName())
     224           lstring_value(((LSymbol *)name)->GetName()),
     225           lstring_value(((LSymbol *)vars[index])->GetName()),
     226           lstring_value(((LSymbol *)name)->GetName())
    227227           );
    228228    exit(0);
     
    285285  }
    286286  for (i=0;i<tiv;i++)
    287     if (!strcmp(lstring_value(((LispSymbol *)vars[i])->GetName()),name))
     287    if (!strcmp(lstring_value(((LSymbol *)vars[i])->GetName()),name))
    288288      return 1;
    289289  return 0;
     
    301301  tiv=0;
    302302
    303   LispSymbol *l_abil =   LispSymbol::FindOrCreate("abilities");
    304   LispSymbol *l_funs =   LispSymbol::FindOrCreate("funs");
    305   LispSymbol *l_states = LispSymbol::FindOrCreate("states");
    306   LispSymbol *l_flags =  LispSymbol::FindOrCreate("flags");
    307   LispSymbol *l_range =  LispSymbol::FindOrCreate("range");
    308   LispSymbol *l_draw_range = LispSymbol::FindOrCreate("draw_range");
    309   LispSymbol *l_fields = LispSymbol::FindOrCreate("fields");
    310   LispSymbol *l_logo =   LispSymbol::FindOrCreate("logo");
    311   LispSymbol *l_vars =   LispSymbol::FindOrCreate("vars");
     303  LSymbol *l_abil =   LSymbol::FindOrCreate("abilities");
     304  LSymbol *l_funs =   LSymbol::FindOrCreate("funs");
     305  LSymbol *l_states = LSymbol::FindOrCreate("states");
     306  LSymbol *l_flags =  LSymbol::FindOrCreate("flags");
     307  LSymbol *l_range =  LSymbol::FindOrCreate("range");
     308  LSymbol *l_draw_range = LSymbol::FindOrCreate("draw_range");
     309  LSymbol *l_fields = LSymbol::FindOrCreate("fields");
     310  LSymbol *l_logo =   LSymbol::FindOrCreate("logo");
     311  LSymbol *l_vars =   LSymbol::FindOrCreate("vars");
    312312
    313313  memset(fun_table,0,sizeof(fun_table));     // destory all hopes of fun
     
    336336      for (i=0;i<TOTAL_ABILITIES;i++)
    337337      {
    338     Cell *ab=assoc(LispSymbol::FindOrCreate(ability_names[i]),l);
     338    Cell *ab=assoc(LSymbol::FindOrCreate(ability_names[i]),l);
    339339    PtrRef r5(ab);
    340340    if (!NILP(ab))
     
    347347      for (i=0;i<TOTAL_OFUNS;i++)
    348348      {
    349     Cell *ab=assoc(LispSymbol::FindOrCreate(ofun_names[i]),l);
     349    Cell *ab=assoc(LSymbol::FindOrCreate(ofun_names[i]),l);
    350350    PtrRef r5(ab);
    351351    if (!NILP(ab) && lcar(lcdr(ab)))
     
    358358      for (i=0;i<TOTAL_CFLAGS;i++)
    359359      {
    360     Cell *ab=assoc(LispSymbol::FindOrCreate(cflag_names[i]),l);
     360    Cell *ab=assoc(LSymbol::FindOrCreate(cflag_names[i]),l);
    361361    PtrRef r5(ab);
    362362    if (!NILP(ab) && eval(lcar(lcdr(ab))))
     
    440440  if (!seq[stopped])
    441441    lbreak("object (%s) has no stopped state, please define one!\n",
    442        lstring_value(((LispSymbol *)name)->GetName()));
     442       lstring_value(((LSymbol *)name)->GetName()));
    443443
    444444/*  char *fn=lstring_value(lcar(desc));
  • abuse/trunk/src/clisp.cpp

    r491 r492  
    3939
    4040// the following are references to lisp symbols
    41 LispSymbol *l_chat_input, *l_post_render;
    42 
    43 LispSymbol *l_difficulty, *l_easy, *l_hard, *l_medium, *l_extreme,
     41LSymbol *l_chat_input, *l_post_render;
     42
     43LSymbol *l_difficulty, *l_easy, *l_hard, *l_medium, *l_extreme,
    4444    *l_max_hp, *l_max_power,
    4545    *l_empty_cache;
    4646
    47 // FIXME: port these to LispSymbol
     47// FIXME: port these to LSymbol
    4848void *l_main_menu, *l_logo,*l_state_art,*l_abilities,*l_state_sfx,
    4949     *l_song_list,*l_filename,*l_sfx_directory,*l_default_font,
     
    103103                                             // to irnterface with c
    104104{
    105   l_easy = LispSymbol::FindOrCreate("easy");
    106   l_medium = LispSymbol::FindOrCreate("medium");
    107   l_hard = LispSymbol::FindOrCreate("hard");
    108   l_extreme = LispSymbol::FindOrCreate("extreme");
    109 
    110   l_logo = LispSymbol::FindOrCreate("logo");
    111   l_morph = LispSymbol::FindOrCreate("morph");
    112 
    113   l_pushx = LispSymbol::FindOrCreate("pushx");
    114   l_pushy = LispSymbol::FindOrCreate("pushy");
    115 
    116   l_dist = LispSymbol::FindOrCreate("dist");
    117   l_state_art = LispSymbol::FindOrCreate("state_art");
    118   l_abilities = LispSymbol::FindOrCreate("abilities");
    119   l_default_abilities = LispSymbol::FindOrCreate("default_abilities");
    120   l_state_sfx = LispSymbol::FindOrCreate("state_sfx");
    121   l_filename = LispSymbol::FindOrCreate("filename");
    122   l_sfx_directory = LispSymbol::FindOrCreate("sfx_directory");
    123   l_default_font = LispSymbol::FindOrCreate("default_font");
    124   l_console_font = LispSymbol::FindOrCreate("console_font");
    125   l_default_ai_function = LispSymbol::FindOrCreate("default_ai");
    126   l_tile_files = LispSymbol::FindOrCreate("tile_files");
    127   l_empty_cache = LispSymbol::FindOrCreate("empty_cache");
    128   l_range = LispSymbol::FindOrCreate("range");
    129   l_difficulty = LispSymbol::FindOrCreate("difficulty");
    130   l_death_handler = LispSymbol::FindOrCreate("death_handler");
    131   l_title_screen = LispSymbol::FindOrCreate("title_screen");
    132   l_fields = LispSymbol::FindOrCreate("fields");
    133   l_FIRE = LispSymbol::FindOrCreate("FIRE");
    134   l_fire_object = LispSymbol::FindOrCreate("fire_object");
    135   l_cop_dead_parts = LispSymbol::FindOrCreate("cop_dead_parts");
     105  l_easy = LSymbol::FindOrCreate("easy");
     106  l_medium = LSymbol::FindOrCreate("medium");
     107  l_hard = LSymbol::FindOrCreate("hard");
     108  l_extreme = LSymbol::FindOrCreate("extreme");
     109
     110  l_logo = LSymbol::FindOrCreate("logo");
     111  l_morph = LSymbol::FindOrCreate("morph");
     112
     113  l_pushx = LSymbol::FindOrCreate("pushx");
     114  l_pushy = LSymbol::FindOrCreate("pushy");
     115
     116  l_dist = LSymbol::FindOrCreate("dist");
     117  l_state_art = LSymbol::FindOrCreate("state_art");
     118  l_abilities = LSymbol::FindOrCreate("abilities");
     119  l_default_abilities = LSymbol::FindOrCreate("default_abilities");
     120  l_state_sfx = LSymbol::FindOrCreate("state_sfx");
     121  l_filename = LSymbol::FindOrCreate("filename");
     122  l_sfx_directory = LSymbol::FindOrCreate("sfx_directory");
     123  l_default_font = LSymbol::FindOrCreate("default_font");
     124  l_console_font = LSymbol::FindOrCreate("console_font");
     125  l_default_ai_function = LSymbol::FindOrCreate("default_ai");
     126  l_tile_files = LSymbol::FindOrCreate("tile_files");
     127  l_empty_cache = LSymbol::FindOrCreate("empty_cache");
     128  l_range = LSymbol::FindOrCreate("range");
     129  l_difficulty = LSymbol::FindOrCreate("difficulty");
     130  l_death_handler = LSymbol::FindOrCreate("death_handler");
     131  l_title_screen = LSymbol::FindOrCreate("title_screen");
     132  l_fields = LSymbol::FindOrCreate("fields");
     133  l_FIRE = LSymbol::FindOrCreate("FIRE");
     134  l_fire_object = LSymbol::FindOrCreate("fire_object");
     135  l_cop_dead_parts = LSymbol::FindOrCreate("cop_dead_parts");
    136136  l_difficulty->SetValue(l_hard);
    137   l_restart_player = LispSymbol::FindOrCreate("restart_player");
    138   l_help_screens = LispSymbol::FindOrCreate("help_screens");
    139   l_save_order = LispSymbol::FindOrCreate("save_order");
    140   l_next_song = LispSymbol::FindOrCreate("next_song");
    141   l_player_draw = LispSymbol::FindOrCreate("player_draw");
    142   l_sneaky_draw = LispSymbol::FindOrCreate("sneaky_draw");
    143   l_keep_backup = LispSymbol::FindOrCreate("keep_backup");
    144   l_level_loaded = LispSymbol::FindOrCreate("level_loaded");
    145 
    146   l_draw_fast = LispSymbol::FindOrCreate("draw_fast");
    147   l_player_tints = LispSymbol::FindOrCreate("player_tints");
    148 
    149   l_max_hp = LispSymbol::FindOrCreate("max_hp");
     137  l_restart_player = LSymbol::FindOrCreate("restart_player");
     138  l_help_screens = LSymbol::FindOrCreate("help_screens");
     139  l_save_order = LSymbol::FindOrCreate("save_order");
     140  l_next_song = LSymbol::FindOrCreate("next_song");
     141  l_player_draw = LSymbol::FindOrCreate("player_draw");
     142  l_sneaky_draw = LSymbol::FindOrCreate("sneaky_draw");
     143  l_keep_backup = LSymbol::FindOrCreate("keep_backup");
     144  l_level_loaded = LSymbol::FindOrCreate("level_loaded");
     145
     146  l_draw_fast = LSymbol::FindOrCreate("draw_fast");
     147  l_player_tints = LSymbol::FindOrCreate("player_tints");
     148
     149  l_max_hp = LSymbol::FindOrCreate("max_hp");
    150150  l_max_hp->SetNumber(200);
    151   l_max_power = LispSymbol::FindOrCreate("max_power");
    152   l_main_menu = LispSymbol::FindOrCreate("main_menu");
     151  l_max_power = LSymbol::FindOrCreate("max_power");
     152  l_main_menu = LSymbol::FindOrCreate("main_menu");
    153153  l_max_power->SetNumber(999);
    154154
    155   LispSymbol::FindOrCreate("run_state")->SetNumber(RUN_STATE);
    156   LispSymbol::FindOrCreate("pause_state")->SetNumber(PAUSE_STATE);
    157   LispSymbol::FindOrCreate("menu_state")->SetNumber(MENU_STATE);
    158   LispSymbol::FindOrCreate("scene_state")->SetNumber(SCENE_STATE);
    159 
    160   l_statbar_ammo_x = LispSymbol::FindOrCreate("statbar_ammo_x");
    161   l_statbar_ammo_y = LispSymbol::FindOrCreate("statbar_ammo_y");
    162   l_statbar_ammo_w = LispSymbol::FindOrCreate("statbar_ammo_w");
    163   l_statbar_ammo_h = LispSymbol::FindOrCreate("statbar_ammo_h");
    164   l_statbar_ammo_bg_color = LispSymbol::FindOrCreate("statbar_ammo_bg_color");
    165 
    166   l_statbar_health_x = LispSymbol::FindOrCreate("statbar_health_x");
    167   l_statbar_health_y = LispSymbol::FindOrCreate("statbar_health_y");
    168   l_statbar_health_w = LispSymbol::FindOrCreate("statbar_health_w");
    169   l_statbar_health_h = LispSymbol::FindOrCreate("statbar_health_h");
    170   l_statbar_health_bg_color = LispSymbol::FindOrCreate("statbar_health_bg_color");
    171 
    172   l_statbar_logo_x = LispSymbol::FindOrCreate("statbar_logo_x");
    173   l_statbar_logo_y = LispSymbol::FindOrCreate("statbar_logo_y");
    174   l_object = LispSymbol::FindOrCreate("object");
    175   l_tile = LispSymbol::FindOrCreate("tile");
    176   l_cdc_logo = LispSymbol::FindOrCreate("logo");
    177 
    178   l_switch_to_powerful = LispSymbol::FindOrCreate("switch_to_powerful");
    179   l_mouse_can_switch = LispSymbol::FindOrCreate("mouse_can_switch");
    180   l_ask_save_slot = LispSymbol::FindOrCreate("ask_save_slot");
    181 
    182   l_level_load_start = LispSymbol::FindOrCreate("level_load_start");
    183   l_level_load_end = LispSymbol::FindOrCreate("level_load_end");
    184   l_get_local_input = LispSymbol::FindOrCreate("get_local_input");
    185   l_chat_input = LispSymbol::FindOrCreate("chat_input");
    186   l_player_text_color = LispSymbol::FindOrCreate("player_text_color");
     155  LSymbol::FindOrCreate("run_state")->SetNumber(RUN_STATE);
     156  LSymbol::FindOrCreate("pause_state")->SetNumber(PAUSE_STATE);
     157  LSymbol::FindOrCreate("menu_state")->SetNumber(MENU_STATE);
     158  LSymbol::FindOrCreate("scene_state")->SetNumber(SCENE_STATE);
     159
     160  l_statbar_ammo_x = LSymbol::FindOrCreate("statbar_ammo_x");
     161  l_statbar_ammo_y = LSymbol::FindOrCreate("statbar_ammo_y");
     162  l_statbar_ammo_w = LSymbol::FindOrCreate("statbar_ammo_w");
     163  l_statbar_ammo_h = LSymbol::FindOrCreate("statbar_ammo_h");
     164  l_statbar_ammo_bg_color = LSymbol::FindOrCreate("statbar_ammo_bg_color");
     165
     166  l_statbar_health_x = LSymbol::FindOrCreate("statbar_health_x");
     167  l_statbar_health_y = LSymbol::FindOrCreate("statbar_health_y");
     168  l_statbar_health_w = LSymbol::FindOrCreate("statbar_health_w");
     169  l_statbar_health_h = LSymbol::FindOrCreate("statbar_health_h");
     170  l_statbar_health_bg_color = LSymbol::FindOrCreate("statbar_health_bg_color");
     171
     172  l_statbar_logo_x = LSymbol::FindOrCreate("statbar_logo_x");
     173  l_statbar_logo_y = LSymbol::FindOrCreate("statbar_logo_y");
     174  l_object = LSymbol::FindOrCreate("object");
     175  l_tile = LSymbol::FindOrCreate("tile");
     176  l_cdc_logo = LSymbol::FindOrCreate("logo");
     177
     178  l_switch_to_powerful = LSymbol::FindOrCreate("switch_to_powerful");
     179  l_mouse_can_switch = LSymbol::FindOrCreate("mouse_can_switch");
     180  l_ask_save_slot = LSymbol::FindOrCreate("ask_save_slot");
     181
     182  l_level_load_start = LSymbol::FindOrCreate("level_load_start");
     183  l_level_load_end = LSymbol::FindOrCreate("level_load_end");
     184  l_get_local_input = LSymbol::FindOrCreate("get_local_input");
     185  l_chat_input = LSymbol::FindOrCreate("chat_input");
     186  l_player_text_color = LSymbol::FindOrCreate("player_text_color");
    187187
    188188  int i;
    189189  for (i=0;i<MAX_STATE;i++)
    190     LispSymbol::FindOrCreate(state_names[i])->SetNumber(i);
     190    LSymbol::FindOrCreate(state_names[i])->SetNumber(i);
    191191  for (i=0;i<TOTAL_ABILITIES;i++)
    192     LispSymbol::FindOrCreate(ability_names[i])->SetNumber(i);
     192    LSymbol::FindOrCreate(ability_names[i])->SetNumber(i);
    193193  for (i=0;i<TOTAL_CFLAGS;i++)
    194     LispSymbol::FindOrCreate(cflag_names[i])->SetNumber(i);
    195 
    196   l_song_list = LispSymbol::FindOrCreate("song_list");
    197   l_post_render = LispSymbol::FindOrCreate("post_render");
     194    LSymbol::FindOrCreate(cflag_names[i])->SetNumber(i);
     195
     196  l_song_list = LSymbol::FindOrCreate("song_list");
     197  l_post_render = LSymbol::FindOrCreate("post_render");
    198198
    199199  add_c_function("distx",0,0,                   1);
     
    581581    exit(0);
    582582      }
    583       return eval_function((LispSymbol *)ai,NULL);
     583      return eval_function((LSymbol *)ai,NULL);
    584584    } break;
    585585    case 1 :
     
    709709      void *f=figures[current_object->otype]->get_fun(OFUN_USER_FUN);
    710710      if (!f) return NULL;
    711       return eval_function((LispSymbol *)f,args);
     711      return eval_function((LSymbol *)f,args);
    712712    } break;
    713713    case 17 :
     
    725725    } break;
    726726    case 18 :
    727     { return LispString::Create(object_names[current_object->otype]); } break;
     727    { return LString::Create(object_names[current_object->otype]); } break;
    728728    case 19 :
    729729    { return current_object->float_tick(); } break;
     
    758758    case 23 :         // def_character
    759759    {
    760       LispSymbol *sym=(LispSymbol *)lcar(args);
     760      LSymbol *sym=(LSymbol *)lcar(args);
    761761      if (item_type(sym)!=L_SYMBOL)
    762762      {
     
    782782      figures[total_objects]=new character_type(CDR(args),sym);
    783783      total_objects++;
    784       return LispNumber::Create(total_objects-1);
     784      return LNumber::Create(total_objects-1);
    785785    } break;
    786786    case 24 :
     
    792792      current_level->foreground_intersect(x1,y1,x2,y2);
    793793      void *ret=NULL;
    794       push_onto_list(LispNumber::Create(y2),ret);
    795       push_onto_list(LispNumber::Create(x2),ret);
     794      push_onto_list(LNumber::Create(y2),ret);
     795      push_onto_list(LNumber::Create(x2),ret);
    796796      return ret;
    797797    } break;
     
    799799    {
    800800#ifdef __linux__
    801       return LispSymbol::FindOrCreate("LINUX");
     801      return LSymbol::FindOrCreate("LINUX");
    802802#endif
    803803#ifdef __sgi
    804       return LispSymbol::FindOrCreate("IRIX");
     804      return LSymbol::FindOrCreate("IRIX");
    805805#endif
    806806#ifdef __WIN32
    807       return LispSymbol::FindOrCreate("WIN32");
     807      return LSymbol::FindOrCreate("WIN32");
    808808#endif
    809809    } break;
    810810    case 26 :
    811811    {
    812       return LispString::Create(current_level->name());
     812      return LString::Create(current_level->name());
    813813    } break;
    814814    case 27 : return ant_ai(); break;
     
    855855      char nm[50];
    856856      last_savegame_name(nm);
    857       return LispString::Create(nm);
     857      return LString::Create(nm);
    858858    } break;
    859859    case 45 :
     
    863863//      get_savegame_name(nm);
    864864      the_game->reset_keymap();
    865       return LispString::Create(nm);
     865      return LString::Create(nm);
    866866    } break;
    867867    case 46 :
    868868    {
    869       return LispString::Create(start_argv[lnumber_value(eval(CAR(args)))]);
     869      return LString::Create(start_argv[lnumber_value(eval(CAR(args)))]);
    870870    } break;
    871871    case 47 :
     
    878878      void *ret=NULL;
    879879      PtrRef r1(ret);
    880       push_onto_list(LispNumber::Create(b3),ret);
    881       push_onto_list(LispNumber::Create(b2),ret);
    882       push_onto_list(LispNumber::Create(b1),ret);
    883       push_onto_list(LispNumber::Create(yv),ret);
    884       push_onto_list(LispNumber::Create(xv),ret);
     880      push_onto_list(LNumber::Create(b3),ret);
     881      push_onto_list(LNumber::Create(b2),ret);
     882      push_onto_list(LNumber::Create(b1),ret);
     883      push_onto_list(LNumber::Create(yv),ret);
     884      push_onto_list(LNumber::Create(xv),ret);
    885885      return ret;
    886886    } break;
     
    890890      {
    891891    PtrRef r1(ret);
    892     push_onto_list(LispNumber::Create((last_demo_mbut&4)==4),ret);
    893     push_onto_list(LispNumber::Create((last_demo_mbut&2)==2),ret);
    894     push_onto_list(LispNumber::Create((last_demo_mbut&1)==1),ret);
    895     push_onto_list(LispNumber::Create(last_demo_my),ret);
    896     push_onto_list(LispNumber::Create(last_demo_mx),ret);
     892    push_onto_list(LNumber::Create((last_demo_mbut&4)==4),ret);
     893    push_onto_list(LNumber::Create((last_demo_mbut&2)==2),ret);
     894    push_onto_list(LNumber::Create((last_demo_mbut&1)==1),ret);
     895    push_onto_list(LNumber::Create(last_demo_my),ret);
     896    push_onto_list(LNumber::Create(last_demo_mx),ret);
    897897      }
    898898      return ret;
     
    908908      {
    909909    PtrRef r1(ret);
    910     push_onto_list(LispNumber::Create(ry),ret);
    911     push_onto_list(LispNumber::Create(rx),ret);
     910    push_onto_list(LNumber::Create(ry),ret);
     911    push_onto_list(LNumber::Create(rx),ret);
    912912      }
    913913      return ret;
     
    923923      {
    924924    PtrRef r1(ret);
    925     push_onto_list(LispNumber::Create(ry),ret);
    926     push_onto_list(LispNumber::Create(rx),ret);
     925    push_onto_list(LNumber::Create(ry),ret);
     926    push_onto_list(LNumber::Create(rx),ret);
    927927      }
    928928      return ret;
     
    935935        lbreak("object is not a player, cannot return name");
    936936      else
    937         return LispString::Create(c->name);
     937        return LString::Create(c->name);
    938938    } break;
    939939    case 54 :
     
    941941      char cd[150];
    942942      getcwd(cd,100);
    943       return LispString::Create(cd);
     943      return LString::Create(cd);
    944944    } break;
    945945    case 55 :
     
    964964    *tp=0;
    965965      }
    966       return LispString::Create(tmp);
     966      return LString::Create(tmp);
    967967    } break;
    968968    case 58 :
     
    976976    PtrRef r1(fl),r2(dl);
    977977   
    978     for (i=tfiles-1;i>=0;i--) { push_onto_list(LispString::Create(files[i]),fl); free(files[i]); }
     978    for (i=tfiles-1;i>=0;i--) { push_onto_list(LString::Create(files[i]),fl); free(files[i]); }
    979979    free(files);
    980980
    981     for (i=tdirs-1;i>=0;i--) { push_onto_list(LispString::Create(dirs[i]),dl); free(dirs[i]); }
     981    for (i=tdirs-1;i>=0;i--) { push_onto_list(LString::Create(dirs[i]),dl); free(dirs[i]); }
    982982    free(dirs);
    983983   
     
    10121012        {
    10131013          sprintf(name2,"%s%04ld.pcx",name,i);
    1014           push_onto_list(LispString::Create(name2),ret);
     1014          push_onto_list(LString::Create(name2),ret);
    10151015        }
    10161016      } else
     
    10191019        {
    10201020          sprintf(name2,"%s%04ld.pcx",name,i);
    1021           push_onto_list(LispString::Create(name2),ret);
     1021          push_onto_list(LString::Create(name2),ret);
    10221022        }
    10231023      }
     
    13551355    case 133 :  // def_sound
    13561356    {
    1357       LispSymbol *sym=NULL;
     1357      LSymbol *sym=NULL;
    13581358      if (CDR(args))
    13591359      {
    1360     sym=(LispSymbol *)lcar(args);
     1360    sym=(LSymbol *)lcar(args);
    13611361    if (item_type(sym)!=L_SYMBOL)
    13621362    {
     
    22642264    current_object=v->focus;
    22652265
    2266     eval_function((LispSymbol *)l_restart_player,NULL);
     2266    eval_function((LSymbol *)l_restart_player,NULL);
    22672267    v->reset_player();
    22682268    v->focus->set_aistate(0);
  • abuse/trunk/src/clisp.h

    r484 r492  
    1414
    1515// variables for the status bar
    16 extern LispSymbol *l_chat_input, *l_post_render;
     16extern LSymbol *l_chat_input, *l_post_render;
    1717
    18 // FIXME: port these to LispSymbol
     18// FIXME: port these to LSymbol
    1919extern void *l_statbar_ammo_x,*l_statbar_ammo_y,
    2020            *l_statbar_ammo_w,*l_statbar_ammo_h,
     
    4242
    4343/******************************** Lisp objects **********************************/
    44 extern LispSymbol *l_difficulty, *l_easy, *l_hard, *l_medium, *l_extreme,
     44extern LSymbol *l_difficulty, *l_easy, *l_hard, *l_medium, *l_extreme,
    4545    *l_max_hp, *l_max_power,
    4646    *l_empty_cache;
    4747
    48 // FIXME: port these to LispSymbol
     48// FIXME: port these to LSymbol
    4949extern void *l_main_menu,
    5050     *l_logo,*l_state_art,*l_default_abilities,*l_abilities,
  • abuse/trunk/src/compiled.cpp

    r484 r492  
    4242static int32_t c_state(char const *name)
    4343{
    44   void *sym = LispSymbol::Find(name);
     44  void *sym = LSymbol::Find(name);
    4545  if (sym)
    4646  {
    47     if (item_type(((LispSymbol *)sym)->value)!=L_NUMBER)
     47    if (item_type(((LSymbol *)sym)->value)!=L_NUMBER)
    4848      compile_error=1;
    4949    else
    50       return lnumber_value(((LispSymbol *)sym)->value);
     50      return lnumber_value(((LSymbol *)sym)->value);
    5151  } else compile_error=1;
    5252  return 0;
     
    122122  S_DELETE_SND=  c_state("DEL_OBJECT_SND");
    123123
    124   void *b = LispSymbol::FindOrCreate("bad_guy_list");
     124  void *b = LSymbol::FindOrCreate("bad_guy_list");
    125125  if (b && DEFINEDP(symbol_value(b)))
    126126  {
     
    138138  }
    139139
    140   void *v = LispSymbol::FindOrCreate("last_save_game")->GetValue();
     140  void *v = LSymbol::FindOrCreate("last_save_game")->GetValue();
    141141  if (DEFINEDP(v))
    142142    last_save_game_number=lnumber_value(v);
  • abuse/trunk/src/configuration.cpp

    r484 r492  
    3636    char tmp[40];
    3737    sprintf( tmp, "player%d", player );
    38     LispSymbol *f = LispSymbol::Find(tmp);
     38    LSymbol *f = LSymbol::Find(tmp);
    3939    if( !NILP(f) && DEFINEDP(f->GetValue()))
    4040    {
    4141        void *what = f->GetValue();
    42         if(what == LispSymbol::FindOrCreate("keyboard"))
     42        if(what == LSymbol::FindOrCreate("keyboard"))
    4343            return 1;
    44         else if(what == LispSymbol::FindOrCreate("joystick"))
     44        else if(what == LSymbol::FindOrCreate("joystick"))
    4545            return 2;
    4646    }
  • abuse/trunk/src/cop.cpp

    r491 r492  
    228228  PtrRef r1(list);
    229229  push_onto_list(new_lisp_pointer(target),list);
    230   push_onto_list(LispNumber::Create(angle),list);
    231   push_onto_list(LispNumber::Create(y2),list);
    232   push_onto_list(LispNumber::Create(x2),list);
    233   push_onto_list(LispNumber::Create(type),list);
     230  push_onto_list(LNumber::Create(angle),list);
     231  push_onto_list(LNumber::Create(y2),list);
     232  push_onto_list(LNumber::Create(x2),list);
     233  push_onto_list(LNumber::Create(type),list);
    234234  push_onto_list(new_lisp_pointer(o->get_object(0)),list);
    235   eval_function((LispSymbol *)l_fire_object,list);
     235  eval_function((LSymbol *)l_fire_object,list);
    236236  o->lvars[top_just_fired]=1;
    237237  other->lvars[just_fired]=1;
     
    260260    o->lvars[fire_delay1]=3;
    261261    if (player_fire_weapon(o,SHOTGUN,NULL,o->lvars[point_angle],small_fire_off))
    262           ret=LispNumber::Create(-1);
    263     else ret=LispNumber::Create(0);
     262          ret=LNumber::Create(-1);
     263    else ret=LNumber::Create(0);
    264264      } else
    265265      {
    266266    o->lvars[fire_delay1]=5;                  // no ammo, set large fire delay for next shot
    267267    player_fire_weapon(o,SHOTGUN,NULL,o->lvars[point_angle],small_fire_off);
    268     ret=LispNumber::Create(0);
     268    ret=LNumber::Create(0);
    269269      }
    270     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     270    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    271271  }
    272272  return ret;
     
    303303    if (player_fire_weapon(o,ammo_type(o->otype),NULL,o->lvars[point_angle],
    304304                   o->otype==DFRIS ? large_fire_off : small_fire_off ))   
    305           ret=LispNumber::Create(-1);
    306     else ret=LispNumber::Create(0);
    307       } else ret=LispNumber::Create(0);
    308     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     305          ret=LNumber::Create(-1);
     306    else ret=LNumber::Create(0);
     307      } else ret=LNumber::Create(0);
     308    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    309309  }
    310310  return ret;
     
    329329    o->lvars[fire_delay1]=2;
    330330    if (player_fire_weapon(o,PLASMA,NULL,o->lvars[point_angle],small_fire_off))   
    331           ret=LispNumber::Create(-1);
    332     else ret=LispNumber::Create(0);
    333       } else ret=LispNumber::Create(0);
    334     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     331          ret=LNumber::Create(-1);
     332    else ret=LNumber::Create(0);
     333      } else ret=LNumber::Create(0);
     334    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    335335  }
    336336  return ret;
     
    354354    if (player_fire_weapon(o,LSABER,NULL,o->lvars[point_angle]+(current_level->tick_counter()&7)-8,
    355355                   small_fire_off))
    356           ret=LispNumber::Create(-1);
    357     else ret=LispNumber::Create(0);
    358       } else ret=LispNumber::Create(0);
    359     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     356          ret=LNumber::Create(-1);
     357    else ret=LNumber::Create(0);
     358      } else ret=LNumber::Create(0);
     359    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    360360  }
    361361  return ret;
     
    403403    }
    404404    if (player_fire_weapon(o,ROCKET,target,o->lvars[point_angle],large_fire_off))   
    405           ret=LispNumber::Create(-1);
    406     else ret=LispNumber::Create(0);
    407 
    408       } else ret=LispNumber::Create(0);
    409     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     405          ret=LNumber::Create(-1);
     406    else ret=LNumber::Create(0);
     407
     408      } else ret=LNumber::Create(0);
     409    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    410410  }
    411411  return ret;
     
    658658      view *v=o->controller();
    659659
    660       push_onto_list(LispNumber::Create(v->weapon_total(v->current_weapon)),args);
     660      push_onto_list(LNumber::Create(v->weapon_total(v->current_weapon)),args);
    661661      push_onto_list(l_FIRE,args);
    662662
    663663      current_object=top;
    664       void *ret=eval_function((LispSymbol *)figures[top->otype]->get_fun(OFUN_USER_FUN),args);   
     664      void *ret=eval_function((LSymbol *)figures[top->otype]->get_fun(OFUN_USER_FUN),args);   
    665665      current_object=o;
    666666      v->add_ammo(v->current_weapon,lnumber_value(ret));   
     
    672672      {
    673673        // call the user function to reset the player
    674     eval_function((LispSymbol *)l_restart_player,NULL);
     674    eval_function((LSymbol *)l_restart_player,NULL);
    675675    o->controller()->reset_player();
    676676    o->set_aistate(0);
     
    681681  }
    682682
    683   return LispNumber::Create(ret);
     683  return LNumber::Create(ret);
    684684}
    685685
     
    727727    if (o->lvars[just_fired_var])
    728728    {
    729       o->draw_double_tint(lnumber_value(((LispArray *)((LispSymbol *)l_player_tints)->GetValue())->Get(num)), S_bright_tint);
     729      o->draw_double_tint(lnumber_value(((LArray *)((LSymbol *)l_player_tints)->GetValue())->Get(num)), S_bright_tint);
    730730      o->lvars[just_fired_var]=0;
    731731    } else
    732       o->draw_tint(lnumber_value(((LispArray *)((LispSymbol *)l_player_tints)->GetValue())->Get(num)));
     732      o->draw_tint(lnumber_value(((LArray *)((LSymbol *)l_player_tints)->GetValue())->Get(num)));
    733733  }
    734734  return NULL;
     
    755755      PtrRef r1(ret);
    756756
    757       push_onto_list(LispNumber::Create(bot->get_tint()),ret);
     757      push_onto_list(LNumber::Create(bot->get_tint()),ret);
    758758
    759759      if (bot->lvars[special_power]==SNEAKY_POWER)
     
    766766      o->draw_predator();
    767767      } else
    768         eval_function((LispSymbol *)l_player_draw,ret);
     768        eval_function((LSymbol *)l_player_draw,ret);
    769769
    770770      o->y=oldy;
     
    829829      case FAST_POWER :
    830830      {
    831     eval_function((LispSymbol *)l_draw_fast,NULL);
     831    eval_function((LSymbol *)l_draw_fast,NULL);
    832832    int old_state=o->state;
    833833    switch (o->state)
     
    10211021    for (i=0;i<tp;i++)
    10221022    {
    1023       int color=lnumber_value(((LispArray *)((LispSymbol *)l_player_text_color)->GetValue())->Get(sorted_players[i]->get_tint()));
     1023      int color=lnumber_value(((LArray *)((LSymbol *)l_player_text_color)->GetValue())->Get(sorted_players[i]->get_tint()));
    10241024      sprintf(msg,"%3ld %s",(long)sorted_players[i]->kills,sorted_players[i]->name);
    10251025      if (sorted_players[i]==local)
     
    10621062  {
    10631063    enum { NAME_LEN=18 } ;
    1064     int color=lnumber_value(((LispArray *)((LispSymbol *)l_player_text_color)->GetValue())->Get(v->get_tint()));
     1064    int color=lnumber_value(((LArray *)((LSymbol *)l_player_text_color)->GetValue())->Get(v->get_tint()));
    10651065    char max_name[NAME_LEN];
    10661066    strncpy(max_name,v->name,NAME_LEN-1);
  • abuse/trunk/src/demo.h

    r484 r492  
    1616class demo_manager
    1717{
    18   LispSymbol *initial_difficulty;
     18  LSymbol *initial_difficulty;
    1919  bFILE *record_file;
    2020  int skip_next;
  • abuse/trunk/src/dev.cpp

    r484 r492  
    4242char const *symbol_str(char const *name)
    4343{
    44   LispSymbol *sym = LispSymbol::FindOrCreate(name);
     44  LSymbol *sym = LSymbol::FindOrCreate(name);
    4545  if (sym->GetValue() && item_type(sym->GetValue())==L_STRING)
    4646    return lstring_value(sym->GetValue());
     
    6767
    6868  // check again to see if the symbol is there
    69   sym = LispSymbol::FindOrCreate(name);
     69  sym = LSymbol::FindOrCreate(name);
    7070  if (sym->GetValue() && item_type(sym->GetValue())==L_STRING)
    7171    return lstring_value(sym->GetValue());
     
    7373
    7474  // check to see if there is a missing symbol definition
    75   sym = LispSymbol::FindOrCreate("missing_sym");
     75  sym = LSymbol::FindOrCreate("missing_sym");
    7676  if (sym->GetValue() && item_type(sym->GetValue())==L_STRING)
    7777    return lstring_value(sym->GetValue());
  • abuse/trunk/src/director.cpp

    r484 r492  
    126126  pan_time=frame_time=text_time=NULL;
    127127  int done=0;
    128   LispSymbol *pan_symbol = LispSymbol::FindOrCreate("pan"),
    129              *text_symbol = LispSymbol::FindOrCreate("text");
     128  LSymbol *pan_symbol = LSymbol::FindOrCreate("pan"),
     129             *text_symbol = LSymbol::FindOrCreate("text");
    130130
    131131  JCFont *font=wm->font();
  • abuse/trunk/src/endgame.cpp

    r491 r492  
    153153
    154154
    155   int explo_snd = lnumber_value(LispSymbol::FindOrCreate("P_EXPLODE_SND")->GetValue());
    156   int space_snd = lnumber_value(LispSymbol::FindOrCreate("SPACE_SND")->GetValue());
    157   int zip_snd = lnumber_value(LispSymbol::FindOrCreate("SHIP_ZIP_SND")->GetValue());
     155  int explo_snd = lnumber_value(LSymbol::FindOrCreate("P_EXPLODE_SND")->GetValue());
     156  int space_snd = lnumber_value(LSymbol::FindOrCreate("SPACE_SND")->GetValue());
     157  int zip_snd = lnumber_value(LSymbol::FindOrCreate("SHIP_ZIP_SND")->GetValue());
    158158
    159159
     
    370370    cmap[i]=pal->find_closest(i*256/32,i*256/32,i*256/32);
    371371
    372   void *end_plot = LispSymbol::FindOrCreate("plot_end")->GetValue();
     372  void *end_plot = LSymbol::FindOrCreate("plot_end")->GetValue();
    373373
    374374
     
    427427  image *im=cache.img(cache.reg("art/endgame.spe","tbc",SPEC_IMAGE,1));
    428428
    429   void *to_be = LispSymbol::FindOrCreate("to_be_continued")->GetValue();
     429  void *to_be = LSymbol::FindOrCreate("to_be_continued")->GetValue();
    430430  PtrRef r1(to_be);
    431431
    432   void *mid_plot = LispSymbol::FindOrCreate("plot_middle")->GetValue();
     432  void *mid_plot = LSymbol::FindOrCreate("plot_middle")->GetValue();
    433433  PtrRef r2(mid_plot);
    434434
     
    485485  int dx=(xres+1)/2-320/2,dy=(yres+1)/2-200/2;
    486486
    487   void *end_plot = LispSymbol::FindOrCreate("plot_end")->GetValue();
     487  void *end_plot = LSymbol::FindOrCreate("plot_end")->GetValue();
    488488  PtrRef r2(end_plot);
    489489
  • abuse/trunk/src/game.cpp

    r491 r492  
    12321232    }
    12331233
    1234     void *logo_snd = LispSymbol::FindOrCreate("LOGO_SND")->GetValue();
     1234    void *logo_snd = LSymbol::FindOrCreate("LOGO_SND")->GetValue();
    12351235
    12361236    if(DEFINEDP(logo_snd) && (sound_avail & SFX_INITIALIZED))
     
    12491249    milli_wait(400);
    12501250
    1251     void *space_snd = LispSymbol::FindOrCreate("SPACE_SND")->GetValue();
     1251    void *space_snd = LSymbol::FindOrCreate("SPACE_SND")->GetValue();
    12521252
    12531253    fade_out(32);
     
    12551255
    12561256    int i;
    1257     char *str = lstring_value(eval(LispSymbol::FindOrCreate("plot_start")));
     1257    char *str = lstring_value(eval(LSymbol::FindOrCreate("plot_start")));
    12581258
    12591259    bFILE *fp = open_file("art/smoke.spe", "rb");
     
    23442344    int sp = current_space;
    23452345    current_space = PERM_SPACE;
    2346     eval_function((LispSymbol *)l_next_song, NULL);
     2346    eval_function((LSymbol *)l_next_song, NULL);
    23472347    current_space = sp;
    23482348      } */
     
    26372637    if(!(main_net_cfg && main_net_cfg->restart_state()))
    26382638    {
    2639       LispSymbol *end_msg = LispSymbol::FindOrCreate("end_msg");
     2639      LSymbol *end_msg = LSymbol::FindOrCreate("end_msg");
    26402640      if(DEFINEDP(end_msg->GetValue()))
    26412641      printf("%s\n", lstring_value(end_msg->GetValue()));
  • abuse/trunk/src/gamma.cpp

    r484 r492  
    5757static char const *lang_string(char const *symbol)
    5858{
    59     LispSymbol *v = LispSymbol::Find(symbol);
     59    LSymbol *v = LSymbol::Find(symbol);
    6060    if (!v || !DEFINEDP(v->GetValue()))
    6161        return "Language symbol missing!";
     
    6969
    7070    // see if user has already done this routine
    71     LispSymbol *gs = LispSymbol::Find("darkest_gray");
     71    LSymbol *gs = LSymbol::Find("darkest_gray");
    7272
    7373    if(old_pal)
     
    182182                int sp = current_space;
    183183                current_space = PERM_SPACE;
    184                 LispSymbol::FindOrCreate("darkest_gray")->SetNumber(dg);
     184                LSymbol::FindOrCreate("darkest_gray")->SetNumber(dg);
    185185
    186186                current_space = sp;
  • abuse/trunk/src/lcache.cpp

    r491 r492  
    2727    for (;b && item_type(b)==L_CONS_CELL;b=CDR(b))
    2828    {
    29       t+=sizeof(LispList);
     29      t+=sizeof(LList);
    3030    }
    3131    if (b) t+=block_size(b);
     
    3434    ret=t;
    3535    } else if (type== L_NUMBER)
    36     { ret=sizeof(LispNumber); }
     36    { ret=sizeof(LNumber); }
    3737    else if (type==L_CHARACTER)
    38     { ret=sizeof(LispChar); }
     38    { ret=sizeof(LChar); }
    3939    else if (type==L_STRING)
    4040    {
    41       ret=sizeof(LispString)+strlen(lstring_value(level))+1;
     41      ret=sizeof(LString)+strlen(lstring_value(level))+1;
    4242      if (ret<8)
    4343        ret=8;
    4444    }
    4545    else if (type==L_POINTER)
    46     { ret=sizeof(LispPointer); }
     46    { ret=sizeof(LPointer); }
    4747    else ret=0;
    4848  }
     
    103103  {
    104104    case L_NUMBER :
    105     { return LispNumber::Create(fp->read_uint32()); } break;
     105    { return LNumber::Create(fp->read_uint32()); } break;
    106106    case L_CHARACTER :
    107107    { return new_lisp_character(fp->read_uint16()); } break;
    108108    case L_STRING :
    109109    { long l=fp->read_uint32();
    110       LispString *s = LispString::Create(l);
     110      LString *s = LString::Create(l);
    111111      fp->read(lstring_value(s),l);
    112112      return s;
     
    121121      {
    122122    long x=abs(t);
    123     LispList *last=NULL,*first=NULL;
     123    LList *last=NULL,*first=NULL;
    124124    while (x)
    125125    {
    126       LispList *c = LispList::Create();
     126      LList *c = LList::Create();
    127127      if (first)
    128128        last->cdr=c;
     
    131131      x--;
    132132    }
    133     last->cdr = (t < 0) ? (LispObject *)load_block(fp) : NULL;
     133    last->cdr = (t < 0) ? (LObject *)load_block(fp) : NULL;
    134134
    135     for (last=first,x=0;x<abs(t);x++,last=(LispList *)last->cdr)
    136       last->car = (LispObject *)load_block(fp);
     135    for (last=first,x=0;x<abs(t);x++,last=(LList *)last->cdr)
     136      last->car = (LObject *)load_block(fp);
    137137    return first;
    138138      }
  • abuse/trunk/src/level.cpp

    r491 r492  
    10801080      {
    10811081        if (figures[new_type]->seq[k] &&
    1082            !strcmp(lstring_value(((LispSymbol *)figures[new_type]->seq_syms[k])->GetName()),old_name))
     1082           !strcmp(lstring_value(((LSymbol *)figures[new_type]->seq_syms[k])->GetName()),old_name))
    10831083        *(s_remap[i]+j)=k;
    10841084      }
     
    11191119          if (figures[new_type]->vars[k])
    11201120          {
    1121         if (!strcmp(lstring_value(((LispSymbol *)figures[new_type]->vars[k])->GetName()),old_name))
     1121        if (!strcmp(lstring_value(((LSymbol *)figures[new_type]->vars[k])->GetName()),old_name))
    11221122          *(v_remap[i]+j)=figures[new_type]->var_index[k];
    11231123          }
     
    15101510    void *arg_list=NULL;
    15111511    PtrRef r1(arg_list);
    1512     push_onto_list(LispString::Create(n),arg_list);
    1513     eval_function((LispSymbol *)l_level_loaded,arg_list);
     1512    push_onto_list(LString::Create(n),arg_list);
     1513    eval_function((LSymbol *)l_level_loaded,arg_list);
    15141514
    15151515    current_space=sp;
     
    15601560    for (;j<figures[i]->ts;j++)
    15611561      if (figures[i]->seq[j])
    1562         size+=1+strlen(lstring_value(((LispSymbol *)figures[i]->seq_syms[j])->GetName()))+1;
     1562        size+=1+strlen(lstring_value(((LSymbol *)figures[i]->seq_syms[j])->GetName()))+1;
    15631563  }
    15641564  sd.add_by_hand(new spec_entry(SPEC_DATA_ARRAY,"describe_states",NULL,size,0));
     
    15731573    for (;j<figures[i]->tiv;j++)
    15741574      if (figures[i]->vars[j])
    1575         size+=1+strlen(lstring_value(((LispSymbol *)figures[i]->vars[j])->GetName()))+1;
     1575        size+=1+strlen(lstring_value(((LSymbol *)figures[i]->vars[j])->GetName()))+1;
    15761576  }
    15771577  sd.add_by_hand(new spec_entry(SPEC_DATA_ARRAY,"describe_lvars",NULL,size,0));
     
    18271827  } else
    18281828  {
    1829     LispSymbol *fun = LispSymbol::FindOrCreate("set_player_defaults");
     1829    LSymbol *fun = LSymbol::FindOrCreate("set_player_defaults");
    18301830    if (DEFINEDP(fun->GetFunction()))
    18311831    {
     
    18871887      if (figures[i]->seq[j])
    18881888      {
    1889     char *state_name=lstring_value(((LispSymbol *)figures[i]->seq_syms[j])->GetName());
     1889    char *state_name=lstring_value(((LSymbol *)figures[i]->seq_syms[j])->GetName());
    18901890    fp->write_uint8(strlen(state_name)+1);
    18911891    fp->write(state_name,strlen(state_name)+1);
     
    19061906        if (figures[i]->vars[j] && figures[i]->var_index[j]==x)
    19071907    {
    1908       char *var_name=lstring_value(((LispSymbol *)figures[i]->vars[j])->GetName());
     1908      char *var_name=lstring_value(((LSymbol *)figures[i]->vars[j])->GetName());
    19091909      fp->write_uint8(strlen(var_name)+1);
    19101910      fp->write(var_name,strlen(var_name)+1);
  • abuse/trunk/src/lisp/lisp.cpp

    r491 r492  
    4141
    4242bFILE *current_print_file=NULL;
    43 LispSymbol *lsym_root=NULL;
     43LSymbol *lsym_root=NULL;
    4444long ltotal_syms=0;
    4545
     
    220220}
    221221
    222 LispArray *LispArray::Create(int size, void *rest)
     222LArray *LArray::Create(int size, void *rest)
    223223{
    224224  PtrRef r11(rest);
    225   size_t s = sizeof(LispArray)
    226            + ((size < 1 ? 1 : size) - 1) * sizeof(LispObject *);
    227   LispArray *p = (LispArray *)lmalloc(s, current_space);
     225  size_t s = sizeof(LArray)
     226           + ((size < 1 ? 1 : size) - 1) * sizeof(LObject *);
     227  LArray *p = (LArray *)lmalloc(s, current_space);
    228228  p->type = L_1D_ARRAY;
    229229  p->size = size;
    230   LispObject **data = p->GetData();
    231   memset(data, 0, size * sizeof(LispObject *));
     230  LObject **data = p->GetData();
     231  memset(data, 0, size * sizeof(LObject *));
    232232  PtrRef r1(p);
    233233
     
    247247          exit(0);
    248248        }
    249         data[i] = (LispObject *)CAR(x);
     249        data[i] = (LObject *)CAR(x);
    250250      }
    251251      if (x)
     
    261261      data = p->GetData();
    262262      for (int i=0;i<size;i++)
    263         data[i] = (LispObject *)x;
     263        data[i] = (LObject *)x;
    264264    }
    265265    else
     
    274274}
    275275
    276 LispFixedPoint *new_lisp_fixed_point(int32_t x)
    277 {
    278   LispFixedPoint *p=(LispFixedPoint *)lmalloc(sizeof(LispFixedPoint), current_space);
     276LFixedPoint *new_lisp_fixed_point(int32_t x)
     277{
     278  LFixedPoint *p=(LFixedPoint *)lmalloc(sizeof(LFixedPoint), current_space);
    279279  p->type=L_FIXED_POINT;
    280280  p->x=x;
     
    283283
    284284
    285 LispObjectVar *new_lisp_object_var(int16_t number)
    286 {
    287   LispObjectVar *p=(LispObjectVar *)lmalloc(sizeof(LispObjectVar), current_space);
     285LObjectVar *new_lisp_object_var(int16_t number)
     286{
     287  LObjectVar *p=(LObjectVar *)lmalloc(sizeof(LObjectVar), current_space);
    288288  p->type=L_OBJECT_VAR;
    289289  p->number=number;
     
    292292
    293293
    294 struct LispPointer *new_lisp_pointer(void *addr)
     294struct LPointer *new_lisp_pointer(void *addr)
    295295{
    296296  if (addr==NULL) return NULL;
    297   LispPointer *p=(LispPointer *)lmalloc(sizeof(LispPointer), current_space);
     297  LPointer *p=(LPointer *)lmalloc(sizeof(LPointer), current_space);
    298298  p->type=L_POINTER;
    299299  p->addr=addr;
     
    301301}
    302302
    303 struct LispChar *new_lisp_character(uint16_t ch)
    304 {
    305   LispChar *c=(LispChar *)lmalloc(sizeof(LispChar), current_space);
     303struct LChar *new_lisp_character(uint16_t ch)
     304{
     305  LChar *c=(LChar *)lmalloc(sizeof(LChar), current_space);
    306306  c->type=L_CHARACTER;
    307307  c->ch=ch;
     
    309309}
    310310
    311 struct LispString *LispString::Create(char const *string)
    312 {
    313     size_t size = sizeof(LispString) + strlen(string);
    314     if (size < sizeof(LispRedirect))
    315         size = sizeof(LispRedirect);
    316 
    317     LispString *s = (LispString *)lmalloc(size, current_space);
     311struct LString *LString::Create(char const *string)
     312{
     313    size_t size = sizeof(LString) + strlen(string);
     314    if (size < sizeof(LRedirect))
     315        size = sizeof(LRedirect);
     316
     317    LString *s = (LString *)lmalloc(size, current_space);
    318318    s->type = L_STRING;
    319319    strcpy(s->str, string);
     
    321321}
    322322
    323 struct LispString *LispString::Create(char const *string, int length)
    324 {
    325     size_t size = sizeof(LispString) + length;
    326     if (size < sizeof(LispRedirect))
    327         size = sizeof(LispRedirect);
    328 
    329     LispString *s = (LispString *)lmalloc(size, current_space);
     323struct LString *LString::Create(char const *string, int length)
     324{
     325    size_t size = sizeof(LString) + length;
     326    if (size < sizeof(LRedirect))
     327        size = sizeof(LRedirect);
     328
     329    LString *s = (LString *)lmalloc(size, current_space);
    330330    s->type = L_STRING;
    331331    memcpy(s->str, string, length);
     
    334334}
    335335
    336 struct LispString *LispString::Create(int length)
    337 {
    338     size_t size = sizeof(LispString) + length - 1;
    339     if (size < sizeof(LispRedirect))
    340         size = sizeof(LispRedirect);
    341 
    342     LispString *s = (LispString *)lmalloc(size, current_space);
     336struct LString *LString::Create(int length)
     337{
     338    size_t size = sizeof(LString) + length - 1;
     339    if (size < sizeof(LRedirect))
     340        size = sizeof(LRedirect);
     341
     342    LString *s = (LString *)lmalloc(size, current_space);
    343343    s->type = L_STRING;
    344344    s->str[0] = '\0';
     
    347347
    348348#ifdef NO_LIBS
    349 LispUserFunction *new_lisp_user_function(void *arg_list, void *block_list)
     349LUserFunction *new_lisp_user_function(void *arg_list, void *block_list)
    350350{
    351351  PtrRef r1(arg_list), r2(block_list);
    352   LispUserFunction *lu=(LispUserFunction *)lmalloc(sizeof(LispUserFunction), current_space);
     352  LUserFunction *lu=(LUserFunction *)lmalloc(sizeof(LUserFunction), current_space);
    353353  lu->type=L_USER_FUNCTION;
    354354  lu->arg_list=arg_list;
     
    357357}
    358358#else
    359 LispUserFunction *new_lisp_user_function(intptr_t arg_list, intptr_t block_list)
     359LUserFunction *new_lisp_user_function(intptr_t arg_list, intptr_t block_list)
    360360{
    361361  int sp=current_space;
     
    363363    current_space=PERM_SPACE;       // make sure all functions get defined in permanant space
    364364
    365   LispUserFunction *lu=(LispUserFunction *)lmalloc(sizeof(LispUserFunction), current_space);
     365  LUserFunction *lu=(LUserFunction *)lmalloc(sizeof(LUserFunction), current_space);
    366366  lu->type=L_USER_FUNCTION;
    367367  lu->alist=arg_list;
     
    375375
    376376
    377 LispSysFunction *new_lisp_sys_function(int min_args, int max_args, int fun_number)
     377LSysFunction *new_lisp_sys_function(int min_args, int max_args, int fun_number)
    378378{
    379379  // sys functions should reside in permanant space
    380   LispSysFunction *ls=(LispSysFunction *)lmalloc(sizeof(LispSysFunction),
     380  LSysFunction *ls=(LSysFunction *)lmalloc(sizeof(LSysFunction),
    381381                             current_space==GC_SPACE ? GC_SPACE : PERM_SPACE);
    382382  ls->type=L_SYS_FUNCTION;
     
    387387}
    388388
    389 LispSysFunction *new_lisp_c_function(int min_args, int max_args, int fun_number)
     389LSysFunction *new_lisp_c_function(int min_args, int max_args, int fun_number)
    390390{
    391391  // sys functions should reside in permanant space
    392   LispSysFunction *ls=(LispSysFunction *)lmalloc(sizeof(LispSysFunction),
     392  LSysFunction *ls=(LSysFunction *)lmalloc(sizeof(LSysFunction),
    393393                             current_space==GC_SPACE ? GC_SPACE : PERM_SPACE);
    394394  ls->type=L_C_FUNCTION;
     
    399399}
    400400
    401 LispSysFunction *new_lisp_c_bool(int min_args, int max_args, int fun_number)
     401LSysFunction *new_lisp_c_bool(int min_args, int max_args, int fun_number)
    402402{
    403403  // sys functions should reside in permanant space
    404   LispSysFunction *ls=(LispSysFunction *)lmalloc(sizeof(LispSysFunction),
     404  LSysFunction *ls=(LSysFunction *)lmalloc(sizeof(LSysFunction),
    405405                             current_space==GC_SPACE ? GC_SPACE : PERM_SPACE);
    406406  ls->type=L_C_BOOL;
     
    411411}
    412412
    413 LispSysFunction *new_user_lisp_function(int min_args, int max_args, int fun_number)
     413LSysFunction *new_user_lisp_function(int min_args, int max_args, int fun_number)
    414414{
    415415  // sys functions should reside in permanant space
    416   LispSysFunction *ls=(LispSysFunction *)lmalloc(sizeof(LispSysFunction),
     416  LSysFunction *ls=(LSysFunction *)lmalloc(sizeof(LSysFunction),
    417417                             current_space==GC_SPACE ? GC_SPACE : PERM_SPACE);
    418418  ls->type=L_L_FUNCTION;
     
    423423}
    424424
    425 LispNumber *new_lisp_node(long num)
    426 {
    427   LispNumber *n=(LispNumber *)lmalloc(sizeof(LispNumber), current_space);
     425LNumber *new_lisp_node(long num)
     426{
     427  LNumber *n=(LNumber *)lmalloc(sizeof(LNumber), current_space);
    428428  n->type=L_NUMBER;
    429429  n->num=num;
     
    431431}
    432432
    433 LispSymbol *new_lisp_symbol(char *name)
    434 {
    435   LispSymbol *s=(LispSymbol *)lmalloc(sizeof(LispSymbol), current_space);
     433LSymbol *new_lisp_symbol(char *name)
     434{
     435  LSymbol *s=(LSymbol *)lmalloc(sizeof(LSymbol), current_space);
    436436  s->type=L_SYMBOL;
    437   s->name=LispString::Create(name);
     437  s->name=LString::Create(name);
    438438  s->value=l_undefined;
    439439  s->function=l_undefined;
     
    444444}
    445445
    446 LispNumber *LispNumber::Create(long num)
    447 {
    448     LispNumber *s = (LispNumber *)lmalloc(sizeof(LispNumber), current_space);
     446LNumber *LNumber::Create(long num)
     447{
     448    LNumber *s = (LNumber *)lmalloc(sizeof(LNumber), current_space);
    449449    s->type = L_NUMBER;
    450450    s->num = num;
     
    452452}
    453453
    454 LispList *LispList::Create()
    455 {
    456     LispList *c = (LispList *)lmalloc(sizeof(LispList), current_space);
     454LList *LList::Create()
     455{
     456    LList *c = (LList *)lmalloc(sizeof(LList), current_space);
    457457    c->type = L_CONS_CELL;
    458458    c->car = NULL;
     
    508508  }
    509509#endif
    510   return ((LispPointer *)lpointer)->addr;
     510  return ((LPointer *)lpointer)->addr;
    511511}
    512512
     
    516516  {
    517517    case L_NUMBER :
    518       return ((LispNumber *)lnumber)->num;
     518      return ((LNumber *)lnumber)->num;
    519519    case L_FIXED_POINT :
    520       return (((LispFixedPoint *)lnumber)->x)>>16;
     520      return (((LFixedPoint *)lnumber)->x)>>16;
    521521    case L_STRING :
    522522      return (uint8_t)*lstring_value(lnumber);
     
    533533}
    534534
    535 char *LispString::GetString()
     535char *LString::GetString()
    536536{
    537537#ifdef TYPE_CHECKING
     
    557557  if (!c) return NULL;
    558558  else if (item_type(c)==(ltype)L_CONS_CELL)
    559     return ((LispList *)c)->cdr;
     559    return ((LList *)c)->cdr;
    560560  else
    561561    return NULL;
     
    566566  if (!c) return NULL;
    567567  else if (item_type(c)==(ltype)L_CONS_CELL)
    568     return ((LispList *)c)->car;
     568    return ((LList *)c)->car;
    569569  else return NULL;
    570570}
     
    580580  }
    581581#endif
    582   return ((LispChar *)c)->ch;
     582  return ((LChar *)c)->ch;
    583583}
    584584
     
    588588  {
    589589    case L_NUMBER :
    590       return ((LispNumber *)c)->num<<16; break;
     590      return ((LNumber *)c)->num<<16; break;
    591591    case L_FIXED_POINT :
    592       return (((LispFixedPoint *)c)->x); break;
     592      return (((LFixedPoint *)c)->x); break;
    593593    default :
    594594    {
     
    609609    if (t1!=t2) return NULL;
    610610    else if (t1==L_NUMBER)
    611     { if (((LispNumber *)n1)->num==((LispNumber *)n2)->num)
     611    { if (((LNumber *)n1)->num==((LNumber *)n2)->num)
    612612        return true_symbol;
    613613      else return NULL;
    614614    } else if (t1==L_CHARACTER)
    615615    {
    616       if (((LispChar *)n1)->ch==((LispChar *)n2)->ch)
     616      if (((LChar *)n1)->ch==((LChar *)n2)->ch)
    617617        return true_symbol;
    618618      else return NULL;
     
    626626}
    627627
    628 LispObject *LispArray::Get(long x)
     628LObject *LArray::Get(long x)
    629629{
    630630#ifdef TYPE_CHECKING
     
    784784
    785785/*
    786 LispSymbol *find_symbol(char const *name)
    787 {
    788   LispList *cs;
    789   for (cs=(LispList *)symbol_list;cs;cs=(LispList *)CDR(cs))
    790   {
    791     if (!strcmp( ((char *)((LispSymbol *)cs->car)->name)+sizeof(LispString), name))
    792       return (LispSymbol *)(cs->car);
     786LSymbol *find_symbol(char const *name)
     787{
     788  LList *cs;
     789  for (cs=(LList *)symbol_list;cs;cs=(LList *)CDR(cs))
     790  {
     791    if (!strcmp( ((char *)((LSymbol *)cs->car)->name)+sizeof(LString), name))
     792      return (LSymbol *)(cs->car);
    793793  }
    794794  return NULL;
     
    796796
    797797
    798 LispSymbol *make_find_symbol(char const *name)    // find a symbol, if it doesn't exsist it is created
    799 {
    800   LispSymbol *s=find_symbol(name);
     798LSymbol *make_find_symbol(char const *name)    // find a symbol, if it doesn't exsist it is created
     799{
     800  LSymbol *s=find_symbol(name);
    801801  if (s) return s;
    802802  else
     
    805805    if (current_space!=GC_SPACE)
    806806      current_space=PERM_SPACE;       // make sure all symbols get defined in permanant space
    807     LispList *cs;
    808     cs=LispList::Create();
     807    LList *cs;
     808    cs=LList::Create();
    809809    s=new_lisp_symbol(name);
    810810    cs->car=s;
     
    818818*/
    819819
    820 LispSymbol *LispSymbol::Find(char const *name)
    821 {
    822     LispSymbol *p = lsym_root;
     820LSymbol *LSymbol::Find(char const *name)
     821{
     822    LSymbol *p = lsym_root;
    823823    while (p)
    824824    {
     
    831831}
    832832
    833 LispSymbol *LispSymbol::FindOrCreate(char const *name)
    834 {
    835     LispSymbol *p = lsym_root;
    836     LispSymbol **parent = &lsym_root;
     833LSymbol *LSymbol::FindOrCreate(char const *name)
     834{
     835    LSymbol *p = lsym_root;
     836    LSymbol **parent = &lsym_root;
    837837    while (p)
    838838    {
     
    849849       current_space = PERM_SPACE;
    850850
    851     p = (LispSymbol *)malloc(sizeof(LispSymbol));
     851    p = (LSymbol *)malloc(sizeof(LSymbol));
    852852    p->type = L_SYMBOL;
    853     p->name = LispString::Create(name);
     853    p->name = LString::Create(name);
    854854
    855855    // If constant, set the value to ourself
     
    867867}
    868868
    869 void ldelete_syms(LispSymbol *root)
     869void ldelete_syms(LSymbol *root)
    870870{
    871871  if (root)
     
    887887      if (lisp_eq(CAR(CAR(list)), item))
    888888        return lcar(list);
    889       list=(LispList *)(CDR(list));
     889      list=(LList *)(CDR(list));
    890890    }
    891891  }
     
    893893}
    894894
    895 size_t LispList::GetLength()
     895size_t LList::GetLength()
    896896{
    897897    size_t ret = 0;
     
    906906#endif
    907907
    908     for (LispObject *p = this; p; p = CDR(p))
     908    for (LObject *p = this; p; p = CDR(p))
    909909        ret++;
    910910    return ret;
     
    917917
    918918  void *ret=NULL;
    919   size_t l1 = ((LispList *)list1)->GetLength();
    920   size_t l2 = ((LispList *)list2)->GetLength();
     919  size_t l1 = ((LList *)list1)->GetLength();
     920  size_t l2 = ((LList *)list2)->GetLength();
    921921
    922922  if (l1!=l2)
     
    929929  if (l1!=0)
    930930  {
    931     LispList *first = NULL, *last = NULL, *cur = NULL;
    932     LispObject *tmp;
     931    LList *first = NULL, *last = NULL, *cur = NULL;
     932    LObject *tmp;
    933933    PtrRef r1(first), r2(last), r3(cur);
    934934    while (list1)
    935935    {
    936       cur = LispList::Create();
     936      cur = LList::Create();
    937937      if (!first)
    938938        first = cur;
     
    941941      last = cur;
    942942
    943       LispList *cell = LispList::Create();
    944       tmp = (LispObject *)lcar(list1);
     943      LList *cell = LList::Create();
     944      tmp = (LObject *)lcar(list1);
    945945      cell->car = tmp;
    946       tmp = (LispObject *)lcar(list2);
     946      tmp = (LObject *)lcar(list2);
    947947      cell->cdr = tmp;
    948948      cur->car = cell;
    949949
    950       list1 = ((LispList *)list1)->cdr;
    951       list2 = ((LispList *)list2)->cdr;
    952     }
    953     cur->cdr = (LispObject *)list3;
     950      list1 = ((LList *)list1)->cdr;
     951      list2 = ((LList *)list2)->cdr;
     952    }
     953    cur->cdr = (LObject *)list3;
    954954    ret=first;
    955955  } else ret=NULL;
     
    957957}
    958958
    959 void LispSymbol::SetFunction(LispObject *fun)
     959void LSymbol::SetFunction(LObject *fun)
    960960{
    961961    function = fun;
    962962}
    963963
    964 LispSymbol *add_sys_function(char const *name, short min_args, short max_args, short number)
     964LSymbol *add_sys_function(char const *name, short min_args, short max_args, short number)
    965965{
    966966  need_perm_space("add_sys_function");
    967   LispSymbol *s = LispSymbol::FindOrCreate(name);
     967  LSymbol *s = LSymbol::FindOrCreate(name);
    968968  if (s->function!=l_undefined)
    969969  {
     
    975975}
    976976
    977 LispSymbol *add_c_object(void *symbol, int16_t number)
     977LSymbol *add_c_object(void *symbol, int16_t number)
    978978{
    979979  need_perm_space("add_c_object");
    980   LispSymbol *s=(LispSymbol *)symbol;
     980  LSymbol *s=(LSymbol *)symbol;
    981981  if (s->value!=l_undefined)
    982982  {
     
    988988}
    989989
    990 LispSymbol *add_c_function(char const *name, short min_args, short max_args, short number)
     990LSymbol *add_c_function(char const *name, short min_args, short max_args, short number)
    991991{
    992992  total_user_functions++;
    993993  need_perm_space("add_c_function");
    994   LispSymbol *s = LispSymbol::FindOrCreate(name);
     994  LSymbol *s = LSymbol::FindOrCreate(name);
    995995  if (s->function!=l_undefined)
    996996  {
     
    10021002}
    10031003
    1004 LispSymbol *add_c_bool_fun(char const *name, short min_args, short max_args, short number)
     1004LSymbol *add_c_bool_fun(char const *name, short min_args, short max_args, short number)
    10051005{
    10061006  total_user_functions++;
    10071007  need_perm_space("add_c_bool_fun");
    1008   LispSymbol *s = LispSymbol::FindOrCreate(name);
     1008  LSymbol *s = LSymbol::FindOrCreate(name);
    10091009  if (s->function!=l_undefined)
    10101010  {
     
    10171017
    10181018
    1019 LispSymbol *add_lisp_function(char const *name, short min_args, short max_args, short number)
     1019LSymbol *add_lisp_function(char const *name, short min_args, short max_args, short number)
    10201020{
    10211021  total_user_functions++;
    10221022  need_perm_space("add_c_bool_fun");
    1023   LispSymbol *s = LispSymbol::FindOrCreate(name);
     1023  LSymbol *s = LSymbol::FindOrCreate(name);
    10241024  if (s->function!=l_undefined)
    10251025  {
     
    11061106{
    11071107  PtrRef r1(object), r2(list);
    1108   LispList *c = LispList::Create();
    1109   c->car = (LispObject *)object;
    1110   c->cdr = (LispObject *)list;
     1108  LList *c = LList::Create();
     1109  c->car = (LObject *)object;
     1110  c->cdr = (LObject *)list;
    11111111  list=c;
    11121112}
     
    11251125  else if (n[0]=='\'')                    // short hand for quote function
    11261126  {
    1127     void *cs = LispList::Create(), *c2=NULL, *tmp;
     1127    void *cs = LList::Create(), *c2=NULL, *tmp;
    11281128    PtrRef r1(cs), r2(c2);
    11291129
    1130     ((LispList *)cs)->car=quote_symbol;
    1131     c2 = LispList::Create();
     1130    ((LList *)cs)->car=quote_symbol;
     1131    c2 = LList::Create();
    11321132    tmp=compile(s);
    1133     ((LispList *)c2)->car = (LispObject *)tmp;
    1134     ((LispList *)c2)->cdr=NULL;
    1135     ((LispList *)cs)->cdr = (LispObject *)c2;
     1133    ((LList *)c2)->car = (LObject *)tmp;
     1134    ((LList *)c2)->cdr=NULL;
     1135    ((LList *)cs)->cdr = (LObject *)c2;
    11361136    ret=cs;
    11371137  }
    11381138  else if (n[0]=='`')                    // short hand for backquote function
    11391139  {
    1140     void *cs = LispList::Create(), *c2=NULL, *tmp;
     1140    void *cs = LList::Create(), *c2=NULL, *tmp;
    11411141    PtrRef r1(cs), r2(c2);
    11421142
    1143     ((LispList *)cs)->car=backquote_symbol;
    1144     c2 = LispList::Create();
     1143    ((LList *)cs)->car=backquote_symbol;
     1144    c2 = LList::Create();
    11451145    tmp=compile(s);
    1146     ((LispList *)c2)->car = (LispObject *)tmp;
    1147     ((LispList *)c2)->cdr=NULL;
    1148     ((LispList *)cs)->cdr = (LispObject *)c2;
     1146    ((LList *)c2)->car = (LObject *)tmp;
     1147    ((LList *)c2)->cdr=NULL;
     1148    ((LList *)cs)->cdr = (LObject *)c2;
    11491149    ret=cs;
    11501150  }  else if (n[0]==',')              // short hand for comma function
    11511151  {
    1152     void *cs = LispList::Create(), *c2=NULL, *tmp;
     1152    void *cs = LList::Create(), *c2=NULL, *tmp;
    11531153    PtrRef r1(cs), r2(c2);
    11541154
    1155     ((LispList *)cs)->car=comma_symbol;
    1156     c2 = LispList::Create();
     1155    ((LList *)cs)->car=comma_symbol;
     1156    c2 = LList::Create();
    11571157    tmp=compile(s);
    1158     ((LispList *)c2)->car = (LispObject *)tmp;
    1159     ((LispList *)c2)->cdr=NULL;
    1160     ((LispList *)cs)->cdr = (LispObject *)c2;
     1158    ((LList *)c2)->car = (LObject *)tmp;
     1159    ((LList *)c2)->cdr=NULL;
     1160    ((LList *)cs)->cdr = (LObject *)c2;
    11611161    ret=cs;
    11621162  }
     
    11871187                    read_ltoken(s, n);              // skip the '.'
    11881188                    tmp=compile(s);
    1189                     ((LispList *)last)->cdr = (LispObject *)tmp;          // link the last cdr to
     1189                    ((LList *)last)->cdr = (LObject *)tmp;          // link the last cdr to
    11901190                    last=NULL;
    11911191                  }
     
    11951195                {       
    11961196                  void *tmp;
    1197                   cur = LispList::Create();
     1197                  cur = LList::Create();
    11981198                  PtrRef r1(cur);
    11991199                  if (!first) first=cur;
    12001200                  tmp=compile(s);   
    1201                   ((LispList *)cur)->car = (LispObject *)tmp;
     1201                  ((LList *)cur)->car = (LObject *)tmp;
    12021202                  if (last)
    1203                     ((LispList *)last)->cdr = (LispObject *)cur;
     1203                    ((LList *)last)->cdr = (LObject *)cur;
    12041204                  last=cur;
    12051205                }
     
    12121212  else if (isdigit(n[0]) || (n[0]=='-' && isdigit(n[1])))
    12131213  {
    1214     LispNumber *num = LispNumber::Create(0);
     1214    LNumber *num = LNumber::Create(0);
    12151215    sscanf(n, "%ld", &num->num);
    12161216    ret=num;
    12171217  } else if (n[0]=='"')
    12181218  {
    1219     ret = LispString::Create(str_token_len(s));
     1219    ret = LString::Create(str_token_len(s));
    12201220    char *start=lstring_value(ret);
    12211221    for (;*s && (*s!='"' || s[1]=='"');s++, start++)
     
    12471247    else if (n[1]==0)                           // short hand for function
    12481248    {
    1249       void *cs = LispList::Create(), *c2=NULL, *tmp;
     1249      void *cs = LList::Create(), *c2=NULL, *tmp;
    12501250      PtrRef r4(cs), r5(c2);
    1251       tmp = LispSymbol::FindOrCreate("function");
    1252       ((LispList *)cs)->car = (LispObject *)tmp;
    1253       c2 = LispList::Create();
     1251      tmp = LSymbol::FindOrCreate("function");
     1252      ((LList *)cs)->car = (LObject *)tmp;
     1253      c2 = LList::Create();
    12541254      tmp=compile(s);
    1255       ((LispList *)c2)->car = (LispObject *)tmp;
    1256       ((LispList *)cs)->cdr = (LispObject *)c2;
     1255      ((LList *)c2)->car = (LObject *)tmp;
     1256      ((LList *)cs)->cdr = (LObject *)c2;
    12571257      ret=cs;
    12581258    }
     
    12631263    }
    12641264  } else {
    1265     ret = LispSymbol::FindOrCreate(n);
     1265    ret = LSymbol::FindOrCreate(n);
    12661266  }
    12671267  return ret;
     
    13061306      case L_CONS_CELL :
    13071307      {
    1308                 LispList *cs=(LispList *)i;
     1308                LList *cs=(LList *)i;
    13091309        lprint_string("(");
    1310         for (;cs;cs=(LispList *)lcdr(cs))   
     1310        for (;cs;cs=(LList *)lcdr(cs))   
    13111311                {
    13121312                  if (item_type(cs)==(ltype)L_CONS_CELL)
     
    13291329      {
    13301330                char num[10];
    1331                 sprintf(num, "%ld", ((LispNumber *)i)->num);
     1331                sprintf(num, "%ld", ((LNumber *)i)->num);
    13321332        lprint_string(num);
    13331333      }
    13341334      break;
    13351335      case L_SYMBOL :
    1336         lprint_string(((LispSymbol *)i)->name->GetString());
     1336        lprint_string(((LSymbol *)i)->name->GetString());
    13371337      break;
    13381338      case L_USER_FUNCTION :
     
    13761376                if (current_print_file)
    13771377                {
    1378                   uint8_t ch=((LispChar *)i)->ch;
     1378                  uint8_t ch=((LChar *)i)->ch;
    13791379                  current_print_file->write(&ch, 1);
    13801380                } else
    13811381                {
    1382                   uint16_t ch=((LispChar *)i)->ch;
     1382                  uint16_t ch=((LChar *)i)->ch;
    13831383                  dprintf("#\\");
    13841384                  switch (ch)
     
    13951395      case L_OBJECT_VAR :
    13961396      {
    1397                 l_obj_print(((LispObjectVar *)i)->number);
     1397                l_obj_print(((LObjectVar *)i)->number);
    13981398      } break;
    13991399      case L_1D_ARRAY :
    14001400      {
    1401           LispArray *a = (LispArray *)i;
    1402           LispObject **data = a->GetData();
     1401          LArray *a = (LArray *)i;
     1402          LObject **data = a->GetData();
    14031403          dprintf("#(");
    14041404          for (int j = 0; j < a->size; j++)
     
    14131413      {
    14141414                lprint_string("GC_refrence->");
    1415                 lprint(((LispRedirect *)i)->new_reference);
     1415                lprint(((LRedirect *)i)->new_reference);
    14161416      } break;
    14171417      default :
     
    14241424}
    14251425
    1426 void *eval_sys_function(LispSysFunction *fun, void *arg_list);
    1427 
    1428 void *eval_function(LispSymbol *sym, void *arg_list)
     1426void *eval_sys_function(LSysFunction *fun, void *arg_list);
     1427
     1428void *eval_function(LSymbol *sym, void *arg_list)
    14291429{
    14301430#ifdef TYPE_CHECKING
     
    14381438#endif
    14391439
    1440   void *fun=(LispSysFunction *)(((LispSymbol *)sym)->function);
     1440  void *fun=(LSysFunction *)(((LSymbol *)sym)->function);
    14411441  PtrRef ref2( fun  );
    14421442
     
    14521452    case L_L_FUNCTION :
    14531453    {
    1454       req_min=((LispSysFunction *)fun)->min_args;
    1455       req_max=((LispSysFunction *)fun)->max_args;
     1454      req_min=((LSysFunction *)fun)->min_args;
     1455      req_max=((LSysFunction *)fun)->max_args;
    14561456    } break;
    14571457    case L_USER_FUNCTION :
     
    14991499  {
    15001500    case L_SYS_FUNCTION :
    1501     { ret=eval_sys_function( ((LispSysFunction *)fun), arg_list); } break;
     1501    { ret=eval_sys_function( ((LSysFunction *)fun), arg_list); } break;
    15021502    case L_L_FUNCTION :
    1503     { ret=l_caller( ((LispSysFunction *)fun)->fun_number, arg_list); } break;
     1503    { ret=l_caller( ((LSysFunction *)fun)->fun_number, arg_list); } break;
    15041504    case L_USER_FUNCTION :
    15051505    {
     
    15141514      {
    15151515        if (first) {
    1516           tmp = LispList::Create();
    1517           ((LispList *)cur)->cdr = (LispObject *)tmp;
     1516          tmp = LList::Create();
     1517          ((LList *)cur)->cdr = (LObject *)tmp;
    15181518          cur=tmp;
    15191519        } else
    1520           cur=first = LispList::Create();
     1520          cur=first = LList::Create();
    15211521   
    15221522        void *val=eval(CAR(arg_list));
    1523         ((LispList *)cur)->car = (LispObject *)val;
     1523        ((LList *)cur)->car = (LObject *)val;
    15241524        arg_list=lcdr(arg_list);
    15251525      }
    15261526      if(t == L_C_FUNCTION)
    1527         ret = LispNumber::Create(c_caller( ((LispSysFunction *)fun)->fun_number, first));
    1528       else if (c_caller( ((LispSysFunction *)fun)->fun_number, first))
     1527        ret = LNumber::Create(c_caller( ((LSysFunction *)fun)->fun_number, first));
     1528      else if (c_caller( ((LSysFunction *)fun)->fun_number, first))
    15291529        ret=true_symbol;
    15301530      else ret=NULL;
     
    15361536#ifdef L_PROFILE
    15371537  time_marker end;
    1538   ((LispSymbol *)sym)->time_taken+=end.diff_time(&start);
     1538  ((LSymbol *)sym)->time_taken+=end.diff_time(&start);
    15391539#endif
    15401540
     
    15431543
    15441544#ifdef L_PROFILE
    1545 void pro_print(bFILE *out, LispSymbol *p)
     1545void pro_print(bFILE *out, LSymbol *p)
    15461546{
    15471547  if (p)
     
    15821582    }
    15831583  }
    1584   int i, stop = 0, num_args = ((LispList *)CDR(arg_list))->GetLength();
     1584  int i, stop = 0, num_args = ((LList *)CDR(arg_list))->GetLength();
    15851585  if (!num_args) return 0;
    15861586
    15871587  void **arg_on=(void **)malloc(sizeof(void *)*num_args);
    1588   LispList *list_on=(LispList *)CDR(arg_list);
     1588  LList *list_on=(LList *)CDR(arg_list);
    15891589  long old_ptr_son=PtrRef::stack.son;
    15901590
    15911591  for (i=0;i<num_args;i++)
    15921592  {
    1593     arg_on[i]=(LispList *)eval(CAR(list_on));
     1593    arg_on[i]=(LList *)eval(CAR(list_on));
    15941594    PtrRef::stack.push(&arg_on[i]);
    15951595
    1596     list_on=(LispList *)CDR(list_on);
     1596    list_on=(LList *)CDR(list_on);
    15971597    if (!arg_on[i]) stop=1;
    15981598  }
     
    16041604  }
    16051605
    1606   LispList *na_list=NULL, *return_list=NULL, *last_return=NULL;
     1606  LList *na_list=NULL, *return_list=NULL, *last_return=NULL;
    16071607
    16081608  do
     
    16101610    na_list=NULL;          // create a cons list with all of the parameters for the function
    16111611
    1612     LispList *first=NULL;                       // save the start of the list
     1612    LList *first=NULL;                       // save the start of the list
    16131613    for (i=0;!stop &&i<num_args;i++)
    16141614    {
    16151615      if (!na_list)
    1616         first=na_list = LispList::Create();
     1616        first=na_list = LList::Create();
    16171617      else
    16181618      {
    1619         na_list->cdr = (LispObject *)LispList::Create();
    1620                 na_list=(LispList *)CDR(na_list);
     1619        na_list->cdr = (LObject *)LList::Create();
     1620                na_list=(LList *)CDR(na_list);
    16211621      }
    16221622
     
    16241624      if (arg_on[i])
    16251625      {
    1626                 na_list->car = (LispObject *)CAR(arg_on[i]);
    1627                 arg_on[i]=(LispList *)CDR(arg_on[i]);
     1626                na_list->car = (LObject *)CAR(arg_on[i]);
     1627                arg_on[i]=(LList *)CDR(arg_on[i]);
    16281628      }
    16291629      else stop=1;
     
    16311631    if (!stop)
    16321632    {
    1633       LispList *c = LispList::Create();
    1634       c->car = (LispObject *)eval_function((LispSymbol *)sym, first);
     1633      LList *c = LList::Create();
     1634      c->car = (LObject *)eval_function((LSymbol *)sym, first);
    16351635      if (return_list)
    16361636        last_return->cdr=c;
     
    16571657  if (rtype==string_symbol)
    16581658  {
    1659     int elements = ((LispList *)el_list)->GetLength(); // see how many things we need to concat
    1660     if (!elements) ret = LispString::Create("");
     1659    int elements = ((LList *)el_list)->GetLength(); // see how many things we need to concat
     1660    if (!elements) ret = LString::Create("");
    16611661    else
    16621662    {
     
    16741674      case L_CONS_CELL :
    16751675      {
    1676         LispList *char_list=(LispList *)str_eval[i];
     1676        LList *char_list=(LList *)str_eval[i];
    16771677        while (char_list)
    16781678        {
     
    16851685        exit(0);
    16861686          }
    1687           char_list=(LispList *)CDR(char_list);
     1687          char_list=(LList *)CDR(char_list);
    16881688        }
    16891689      } break;
     
    16971697    }
    16981698      }
    1699       LispString *st = LispString::Create(len+1);
     1699      LString *st = LString::Create(len+1);
    17001700      char *s=lstring_value(st);
    17011701
     
    17071707      case L_CONS_CELL :
    17081708      {
    1709         LispList *char_list=(LispList *)str_eval[i];
     1709        LList *char_list=(LList *)str_eval[i];
    17101710        while (char_list)
    17111711        {
    17121712          if (item_type(CAR(char_list))==L_CHARACTER)
    1713             *(s++)=((LispChar *)CAR(char_list))->ch;
    1714           char_list=(LispList *)CDR(char_list);
     1713            *(s++)=((LChar *)CAR(char_list))->ch;
     1714          char_list=(LList *)CDR(char_list);
    17151715        }
    17161716      } break;
     
    17451745  else if (args==NULL)
    17461746    return NULL;
    1747   else if ((LispSymbol *) (((LispList *)args)->car)==comma_symbol)
     1747  else if ((LSymbol *) (((LList *)args)->car)==comma_symbol)
    17481748    return eval(CAR(CDR(args)));
    17491749  else
     
    17581758    {
    17591759      tmp=eval(CAR(CDR(args)));
    1760       ((LispList *)last)->cdr = (LispObject *)tmp;
     1760      ((LList *)last)->cdr = (LObject *)tmp;
    17611761      args=NULL;
    17621762    }
    17631763    else
    17641764    {
    1765       cur = LispList::Create();
     1765      cur = LList::Create();
    17661766      if (first)
    1767         ((LispList *)last)->cdr = (LispObject *)cur;
     1767        ((LList *)last)->cdr = (LObject *)cur;
    17681768      else
    17691769            first=cur;
    17701770      last=cur;
    17711771          tmp=backquote_eval(CAR(args));
    1772           ((LispList *)cur)->car = (LispObject *)tmp;
     1772          ((LList *)cur)->car = (LObject *)tmp;
    17731773       args=CDR(args);
    17741774    }
     
    17761776      {
    17771777    tmp=backquote_eval(args);
    1778     ((LispList *)last)->cdr = (LispObject *)tmp;
     1778    ((LList *)last)->cdr = (LObject *)tmp;
    17791779    args=NULL;
    17801780      }
     
    17871787
    17881788
    1789 void *eval_sys_function(LispSysFunction *fun, void *arg_list)
     1789void *eval_sys_function(LSysFunction *fun, void *arg_list)
    17901790{
    17911791  PtrRef ref1(arg_list);
     
    18121812      switch (item_type(v))
    18131813      {
    1814         case L_STRING : ret = LispNumber::Create(strlen(lstring_value(v))); break;
    1815         case L_CONS_CELL : ret = LispNumber::Create(((LispList *)v)->GetLength()); break;
     1814        case L_STRING : ret = LNumber::Create(strlen(lstring_value(v))); break;
     1815        case L_CONS_CELL : ret = LNumber::Create(((LList *)v)->GetLength()); break;
    18161816        default :
    18171817        { lprint(v);
     
    18261826      while (arg_list)
    18271827      {
    1828     cur = LispList::Create();
     1828    cur = LList::Create();
    18291829    void *val=eval(CAR(arg_list));
    1830     ((LispList *) cur)->car = (LispObject *)val;
     1830    ((LList *) cur)->car = (LObject *)val;
    18311831    if (last)
    1832       ((LispList *)last)->cdr = (LispObject *)cur;
     1832      ((LList *)last)->cdr = (LObject *)cur;
    18331833    else first=cur;
    18341834    last=cur;
    1835     arg_list=(LispList *)CDR(arg_list);
     1835    arg_list=(LList *)CDR(arg_list);
    18361836      }   
    18371837      ret=first;
    18381838    } break;
    18391839    case SYS_FUNC_CONS:
    1840     { void *c = LispList::Create();
     1840    { void *c = LList::Create();
    18411841      PtrRef r1(c);
    18421842      void *val=eval(CAR(arg_list));
    1843       ((LispList *)c)->car = (LispObject *)val;
     1843      ((LList *)c)->car = (LObject *)val;
    18441844      val=eval(CAR(CDR(arg_list)));
    1845       ((LispList *)c)->cdr = (LispObject *)val;
     1845      ((LList *)c)->cdr = (LObject *)val;
    18461846      ret=c;
    18471847    } break;
     
    18691869    arg_list=CDR(arg_list);
    18701870      }
    1871       ret = LispNumber::Create(sum);
     1871      ret = LNumber::Create(sum);
    18721872    }
    18731873    break;
     
    18961896      if (arg_list) first=eval(CAR(arg_list));
    18971897    } while (arg_list);
    1898     ret = LispNumber::Create(sum);
     1898    ret = LNumber::Create(sum);
    18991899      }
    19001900    }
     
    19141914    } else if (first)
    19151915    {
    1916       sum=((LispNumber *)i)->num;
     1916      sum=((LNumber *)i)->num;
    19171917      first=0;
    19181918    }
    1919     else sum/=((LispNumber *)i)->num;
     1919    else sum/=((LNumber *)i)->num;
    19201920    arg_list=CDR(arg_list);
    19211921      }
    1922       ret = LispNumber::Create(sum);
     1922      ret = LNumber::Create(sum);
    19231923    }
    19241924    break;
     
    19311931    arg_list=CDR(arg_list);
    19321932      }
    1933       ret = LispNumber::Create(x);
     1933      ret = LNumber::Create(x);
    19341934    }
    19351935    break;
     
    19571957        case L_SYMBOL :
    19581958        {
    1959           switch (item_type (((LispSymbol *)i)->value))
     1959          switch (item_type (((LSymbol *)i)->value))
    19601960          {
    19611961            case L_NUMBER :
    19621962            {
    1963               if (x==L_NUMBER && ((LispSymbol *)i)->value!=l_undefined)
    1964                 ((LispSymbol *)i)->SetNumber(lnumber_value(set_to));
     1963              if (x==L_NUMBER && ((LSymbol *)i)->value!=l_undefined)
     1964                ((LSymbol *)i)->SetNumber(lnumber_value(set_to));
    19651965              else
    1966                 ((LispSymbol *)i)->SetValue((LispNumber *)set_to);
     1966                ((LSymbol *)i)->SetValue((LNumber *)set_to);
    19671967            } break;
    19681968            case L_OBJECT_VAR :
    19691969            {
    1970               l_obj_set(((LispObjectVar *)(((LispSymbol *)i)->value))->number, set_to);
     1970              l_obj_set(((LObjectVar *)(((LSymbol *)i)->value))->number, set_to);
    19711971            } break;
    19721972            default :
    1973               ((LispSymbol *)i)->SetValue((LispObject *)set_to);
     1973              ((LSymbol *)i)->SetValue((LObject *)set_to);
    19741974          }
    1975           ret=((LispSymbol *)i)->value;
     1975          ret=((LSymbol *)i)->value;
    19761976        } break;
    19771977        case L_CONS_CELL :   // this better be an 'aref'
    19781978        {
    19791979#ifdef TYPE_CHECKING
    1980           void *car=((LispList *)i)->car;
     1980          void *car=((LList *)i)->car;
    19811981          if (car==car_symbol)
    19821982          {
     
    19841984            if (!car || item_type(car)!=L_CONS_CELL)
    19851985            { lprint(car); lbreak("setq car : evaled object is not a cons cell\n"); exit(0); }
    1986             ((LispList *)car)->car = (LispObject *)set_to;
     1986            ((LList *)car)->car = (LObject *)set_to;
    19871987          } else if (car==cdr_symbol)
    19881988          {
     
    19901990            if (!car || item_type(car)!=L_CONS_CELL)
    19911991            { lprint(car); lbreak("setq cdr : evaled object is not a cons cell\n"); exit(0); }
    1992             ((LispList *)car)->cdr = (LispObject *)set_to;
     1992            ((LList *)car)->cdr = (LObject *)set_to;
    19931993          } else if (car==aref_symbol)
    19941994          {
    19951995#endif
    1996             LispArray *a = (LispArray *)eval(CAR(CDR(i)));
     1996            LArray *a = (LArray *)eval(CAR(CDR(i)));
    19971997            PtrRef r1(a);
    19981998#ifdef TYPE_CHECKING
     
    20122012            }
    20132013#endif
    2014             a->GetData()[num] = (LispObject *)set_to;
     2014            a->GetData()[num] = (LObject *)set_to;
    20152015#ifdef TYPE_CHECKING
    20162016          } else
     
    20382038      void *item=eval(CAR(arg_list));
    20392039      PtrRef r1(item);
    2040       void *list=(LispList *)eval(CAR(CDR(arg_list)));
     2040      void *list=(LList *)eval(CAR(CDR(arg_list)));
    20412041      PtrRef r2(list);
    2042       ret=assoc(item, (LispList *)list);
     2042      ret=assoc(item, (LList *)list);
    20432043    } break;
    20442044    case SYS_FUNC_NOT:
     
    20502050      void *i1=eval(CAR(arg_list)), *i2=eval(CAR(CDR(arg_list)));
    20512051      PtrRef r1(i1);
    2052       LispList *cs = LispList::Create();
    2053       cs->car = (LispObject *)i1;
    2054       cs->cdr = (LispObject *)i2;
     2052      LList *cs = LList::Create();
     2053      cs->car = (LObject *)i1;
     2054      cs->cdr = (LObject *)i2;
    20552055      ret=cs;
    20562056    } break;
     
    20852085#endif
    20862086
    2087     l_user_stack.push(((LispSymbol *)var_name)->value);
     2087    l_user_stack.push(((LSymbol *)var_name)->value);
    20882088    tmp=eval(CAR(CDR(CAR(var_list))));   
    2089     ((LispSymbol *)var_name)->SetValue((LispObject *)tmp);
     2089    ((LSymbol *)var_name)->SetValue((LObject *)tmp);
    20902090    var_list=CDR(var_list);
    20912091      }
     
    21042104      {
    21052105    void *var_name=CAR(CAR(var_list));
    2106     ((LispSymbol *)var_name)->SetValue((LispObject *)l_user_stack.sdata[cur_stack++]);
     2106    ((LSymbol *)var_name)->SetValue((LObject *)l_user_stack.sdata[cur_stack++]);
    21072107    var_list=CDR(var_list);
    21082108      }
     
    21122112    case SYS_FUNC_DEFUN:
    21132113    {
    2114       LispSymbol *symbol = (LispSymbol *)CAR(arg_list);
     2114      LSymbol *symbol = (LSymbol *)CAR(arg_list);
    21152115#ifdef TYPE_CHECKING
    21162116      if (item_type(symbol)!=L_SYMBOL)
     
    21332133      intptr_t a=cache.reg_lisp_block(lcar(lcdr(arg_list)));
    21342134      intptr_t b=cache.reg_lisp_block(block_list);
    2135       LispUserFunction *ufun=new_lisp_user_function(a, b);
     2135      LUserFunction *ufun=new_lisp_user_function(a, b);
    21362136#else
    2137       LispUserFunction *ufun=new_lisp_user_function(lcar(lcdr(arg_list)), block_list);
     2137      LUserFunction *ufun=new_lisp_user_function(lcar(lcdr(arg_list)), block_list);
    21382138#endif
    21392139      symbol->SetFunction(ufun);
     
    21832183      {
    21842184        case L_CHARACTER :
    2185         { ret = LispNumber::Create(((LispChar *)i)->ch); } break;
     2185        { ret = LNumber::Create(((LChar *)i)->ch); } break;
    21862186        case L_STRING :
    2187         {  ret = LispNumber::Create(*lstring_value(i)); } break;
     2187        {  ret = LNumber::Create(*lstring_value(i)); } break;
    21882188        default :
    21892189        {
     
    22042204    exit(0);
    22052205      }
    2206       ret=new_lisp_character(((LispNumber *)i)->num);
     2206      ret=new_lisp_character(((LNumber *)i)->num);
    22072207    } break;
    22082208    case SYS_FUNC_COND:
     
    22422242    } break;
    22432243    case SYS_FUNC_FUNCTION:
    2244       ret = ((LispSymbol *)eval(CAR(arg_list)))->GetFunction();
     2244      ret = ((LSymbol *)eval(CAR(arg_list)))->GetFunction();
    22452245    break;
    22462246    case SYS_FUNC_MAPCAR:
     
    22492249    {
    22502250      void *n1=eval(CAR(arg_list));
    2251       ret=eval_function((LispSymbol *)n1, CDR(arg_list));
     2251      ret=eval_function((LSymbol *)n1, CDR(arg_list));
    22522252    } break;
    22532253    case SYS_FUNC_GT:
     
    22992299      }
    23002300#endif
    2301       ret=((LispSymbol *)symb)->name;
     2301      ret=((LSymbol *)symb)->name;
    23022302    break;
    23032303    case SYS_FUNC_TRACE:
     
    23312331      while (dig--)
    23322332        *(tp--)='0';
    2333       ret=LispString::Create(tp+1);
     2333      ret=LString::Create(tp+1);
    23342334    } break;
    23352335    case SYS_FUNC_LOCAL_LOAD:
     
    23652365            {
    23662366                delete fp;
    2367                 if( DEFINEDP(((LispSymbol *)load_warning)->GetValue())
    2368                      && ((LispSymbol *)load_warning)->GetValue())
     2367                if( DEFINEDP(((LSymbol *)load_warning)->GetValue())
     2368                     && ((LSymbol *)load_warning)->GetValue())
    23692369                    dprintf("Warning : file %s does not exist\n", st);
    23702370                ret = NULL;
     
    24122412    } break;
    24132413    case SYS_FUNC_ABS:
    2414       ret = LispNumber::Create(abs(lnumber_value(eval(CAR(arg_list))))); break;
     2414      ret = LNumber::Create(abs(lnumber_value(eval(CAR(arg_list))))); break;
    24152415    case SYS_FUNC_MIN:
    24162416    {
    24172417      int x=lnumber_value(eval(CAR(arg_list))), y=lnumber_value(eval(CAR(CDR(arg_list))));
    2418       ret = LispNumber::Create(x < y ? x : y);
     2418      ret = LNumber::Create(x < y ? x : y);
    24192419    } break;
    24202420    case SYS_FUNC_MAX:
    24212421    {
    24222422      int x=lnumber_value(eval(CAR(arg_list))), y=lnumber_value(eval(CAR(CDR(arg_list))));
    2423       ret = LispNumber::Create(x > y ? x : y);
     2423      ret = LNumber::Create(x > y ? x : y);
    24242424    } break;
    24252425    case SYS_FUNC_BACKQUOTE:
     
    24512451      long y=(lnumber_value(eval(CAR(arg_list))));   arg_list=CDR(arg_list);
    24522452      long x=(lnumber_value(eval(CAR(arg_list))));
    2453       ret = LispNumber::Create(lisp_atan2(y, x));
     2453      ret = LNumber::Create(lisp_atan2(y, x));
    24542454    } break;
    24552455    case SYS_FUNC_ENUM:
     
    24652465    {
    24662466      case L_SYMBOL :
    2467       { ((LispSymbol *)sym)->value = LispNumber::Create(x); } break;
     2467      { ((LSymbol *)sym)->value = LNumber::Create(x); } break;
    24682468      case L_CONS_CELL :
    24692469      {
     
    24782478#endif
    24792479        x=lnumber_value(eval(CAR(CDR(sym))));
    2480         ((LispSymbol *)sym)->value = LispNumber::Create(x);
     2480        ((LSymbol *)sym)->value = LNumber::Create(x);
    24812481      } break;
    24822482      default :
     
    25062506      long y=lnumber_value(eval(CAR(arg_list)));
    25072507      if (y==0) { lbreak("mod : division by zero\n"); y=1; }
    2508       ret = LispNumber::Create(x%y);
     2508      ret = LNumber::Create(x%y);
    25092509    } break;
    25102510/*    case SYS_FUNC_WRITE_PROFILE:
     
    25172517      {   
    25182518    for (void *s=symbol_list;s;s=CDR(s))       
    2519       fprintf(fp, "%8d  %s\n", ((LispSymbol *)(CAR(s)))->call_counter,
    2520           lstring_value(((LispSymbol *)(CAR(s)))->name));
     2519      fprintf(fp, "%8d  %s\n", ((LSymbol *)(CAR(s)))->call_counter,
     2520          lstring_value(((LSymbol *)(CAR(s)))->name));
    25212521    fclose(fp);
    25222522      }
     
    25242524    case SYS_FUNC_FOR:
    25252525    {
    2526       LispSymbol *bind_var = (LispSymbol *)CAR(arg_list);
     2526      LSymbol *bind_var = (LSymbol *)CAR(arg_list);
    25272527      arg_list = CDR(arg_list);
    25282528      PtrRef r1(bind_var);
     
    25462546      while (ilist)
    25472547      {
    2548                 bind_var->SetValue((LispObject *)CAR(ilist));
     2548                bind_var->SetValue((LObject *)CAR(ilist));
    25492549                for (block=arg_list;block;block=CDR(block))
    25502550                  ret=eval(CAR(block));
    25512551                ilist=CDR(ilist);
    25522552      }
    2553       bind_var->SetValue((LispObject *)l_user_stack.pop(1)); // restore symbol value
     2553      bind_var->SetValue((LObject *)l_user_stack.pop(1)); // restore symbol value
    25542554      ret=ret;
    25552555    } break;
     
    25852585                arg_list=CDR(arg_list);
    25862586      }
    2587       ret = LispNumber::Create(first);
     2587      ret = LNumber::Create(first);
    25882588    } break;
    25892589    case SYS_FUNC_BIT_OR:
     
    25952595                arg_list=CDR(arg_list);
    25962596      }
    2597       ret = LispNumber::Create(first);
     2597      ret = LNumber::Create(first);
    25982598    } break;
    25992599    case SYS_FUNC_BIT_XOR:
     
    26052605                arg_list=CDR(arg_list);
    26062606      }
    2607       ret = LispNumber::Create(first);
     2607      ret = LNumber::Create(first);
    26082608    } break;
    26092609    case SYS_FUNC_MAKE_ARRAY:
     
    26152615                exit(0);
    26162616      }
    2617       ret = LispArray::Create(l, CDR(arg_list));
     2617      ret = LArray::Create(l, CDR(arg_list));
    26182618    } break;
    26192619    case SYS_FUNC_AREF:
    26202620    {
    26212621      long x=lnumber_value(eval(CAR(CDR(arg_list))));
    2622       ret = ((LispArray *)eval(CAR(arg_list)))->Get(x);
     2622      ret = ((LArray *)eval(CAR(arg_list)))->Get(x);
    26232623    } break;
    26242624    case SYS_FUNC_IF_1PROGN:
     
    26462646    {
    26472647      void *v=eval(CAR(arg_list));
    2648       if (item_type(v)!=L_NUMBER || (((LispNumber *)v)->num!=0))
     2648      if (item_type(v)!=L_NUMBER || (((LNumber *)v)->num!=0))
    26492649        ret=NULL;
    26502650      else ret=true_symbol;
     
    26662666      char *find=strstr(haystack, needle);
    26672667      if (find)
    2668         ret = LispNumber::Create(find-haystack);
     2668        ret = LNumber::Create(find-haystack);
    26692669      else ret=NULL;
    26702670    } break;
     
    26942694      PtrRef r1(init_var);
    26952695      int i, ustack_start=l_user_stack.son;      // restore stack at end
    2696       LispSymbol *sym = NULL;
     2696      LSymbol *sym = NULL;
    26972697      PtrRef r2(sym);
    26982698
     
    27002700      for (init_var=CAR(arg_list);init_var;init_var=CDR(init_var))
    27012701      {
    2702                 sym = (LispSymbol *)CAR(CAR(init_var));
     2702                sym = (LSymbol *)CAR(CAR(init_var));
    27032703                if (item_type(sym)!=L_SYMBOL)
    27042704                { lbreak("expecting symbol name for iteration var\n"); exit(0); }
     
    27142714      for (init_var=CAR(arg_list);init_var;init_var=CDR(init_var), do_evaled++)
    27152715      {
    2716                 sym = (LispSymbol *)CAR(CAR(init_var));
    2717                 sym->SetValue((LispObject *)*do_evaled);
     2716                sym = (LSymbol *)CAR(CAR(init_var));
     2717                sym->SetValue((LObject *)*do_evaled);
    27182718      }
    27192719
     
    27362736      for (init_var=CAR(arg_list);init_var;init_var=CDR(init_var), do_evaled++)
    27372737      {
    2738                 sym = (LispSymbol *)CAR(CAR(init_var));
    2739                 sym->SetValue((LispObject *)*do_evaled);
     2738                sym = (LSymbol *)CAR(CAR(init_var));
     2739                sym->SetValue((LObject *)*do_evaled);
    27402740      }
    27412741
     
    27652765      char str[20];
    27662766      sprintf(str, "%ld", (long int)lnumber_value(eval(CAR(arg_list))));
    2767       ret=LispString::Create(str);
     2767      ret=LString::Create(str);
    27682768    } break;
    27692769    case SYS_FUNC_NCONC:
     
    27862786                next=l1;
    27872787                while (next) { l1=next; next=lcdr(next); }
    2788                 ((LispList *)l1)->cdr = (LispObject *)eval(CAR(arg_list));
     2788                ((LList *)l1)->cdr = (LObject *)eval(CAR(arg_list));
    27892789                arg_list=CDR(arg_list);
    27902790      } while (arg_list);
     
    28212821        lbreak("substr : bad x1 or x2 value");
    28222822
    2823       LispString *s=LispString::Create(x2-x1+2);
     2823      LString *s=LString::Create(x2-x1+2);
    28242824      if (x2-x1)
    28252825        memcpy(lstring_value(s), lstring_value(st)+x1, x2-x1+1);
     
    28372837        if (!rstart) rstart=q;
    28382838        while (r && CDR(r)) r=CDR(r);
    2839         CDR(r) = (LispObject *)q;
     2839        CDR(r) = (LObject *)q;
    28402840        arg_list=CDR(arg_list);
    28412841      }
     
    28442844
    28452845    default :
    2846     { dprintf("Undefined system function number %d\n", ((LispSysFunction *)fun)->fun_number); }
     2846    { dprintf("Undefined system function number %d\n", ((LSysFunction *)fun)->fun_number); }
    28472847  }
    28482848  return ret;
     
    28672867
    28682868
    2869 void *eval_user_fun(LispSymbol *sym, void *arg_list)
     2869void *eval_user_fun(LSymbol *sym, void *arg_list)
    28702870{
    28712871  void *ret=NULL;
     
    28852885
    28862886
    2887   LispUserFunction *fun=(LispUserFunction *)(((LispSymbol *)sym)->function);
     2887  LUserFunction *fun=(LUserFunction *)(((LSymbol *)sym)->function);
    28882888
    28892889#ifdef TYPE_CHECKING
     
    29162916  for (;f_arg;f_arg=CDR(f_arg))
    29172917  {
    2918     LispSymbol *s = (LispSymbol *)CAR(f_arg);
     2918    LSymbol *s = (LSymbol *)CAR(f_arg);
    29192919    l_user_stack.push(s->value);
    29202920  }
     
    29372937    // now store all the values and put them into the symbols
    29382938    for (f_arg=fun_arg_list;f_arg;f_arg=CDR(f_arg))
    2939       ((LispSymbol *)CAR(f_arg))->SetValue((LispObject *)l_user_stack.sdata[i++]);
     2939      ((LSymbol *)CAR(f_arg))->SetValue((LObject *)l_user_stack.sdata[i++]);
    29402940
    29412941    l_user_stack.son=new_start;
     
    29572957  long cur_stack=stack_start;
    29582958  for (f_arg=fun_arg_list;f_arg;f_arg=CDR(f_arg))
    2959     ((LispSymbol *)CAR(f_arg))->SetValue((LispObject *)l_user_stack.sdata[cur_stack++]);
     2959    ((LSymbol *)CAR(f_arg))->SetValue((LObject *)l_user_stack.sdata[cur_stack++]);
    29602960
    29612961  l_user_stack.son=stack_start;
     
    29632963#ifdef L_PROFILE
    29642964  time_marker end;
    2965   ((LispSymbol *)sym)->time_taken+=end.diff_time(&start);
     2965  ((LSymbol *)sym)->time_taken+=end.diff_time(&start);
    29662966#endif
    29672967
     
    30153015        else
    30163016                {
    3017                   ret = ((LispSymbol *)prog)->GetValue();
     3017                  ret = ((LSymbol *)prog)->GetValue();
    30183018                  if (item_type(ret)==L_OBJECT_VAR)
    3019                     ret=l_obj_get(((LispObjectVar *)ret)->number);
     3019                    ret=l_obj_get(((LObjectVar *)ret)->number);
    30203020                }
    30213021      } break;
    30223022      case L_CONS_CELL :
    30233023      {
    3024         ret=eval_function((LispSymbol *)CAR(prog), CDR(prog));
     3024        ret=eval_function((LSymbol *)CAR(prog), CDR(prog));
    30253025      }
    30263026      break;
     
    31273127}
    31283128
    3129 LispString *LispSymbol::GetName()
     3129LString *LSymbol::GetName()
    31303130{
    31313131#ifdef TYPE_CHECKING
     
    31403140}
    31413141
    3142 void LispSymbol::SetNumber(long num)
     3142void LSymbol::SetNumber(long num)
    31433143{
    31443144#ifdef TYPE_CHECKING
     
    31513151#endif
    31523152    if (value != l_undefined && item_type(value) == L_NUMBER)
    3153         ((LispNumber *)value)->num = num;
     3153        ((LNumber *)value)->num = num;
    31543154    else
    3155         value = LispNumber::Create(num);
    3156 }
    3157 
    3158 void LispSymbol::SetValue(LispObject *val)
     3155        value = LNumber::Create(num);
     3156}
     3157
     3158void LSymbol::SetValue(LObject *val)
    31593159{
    31603160#ifdef TYPE_CHECKING
     
    31693169}
    31703170
    3171 LispObject *LispSymbol::GetFunction()
     3171LObject *LSymbol::GetFunction()
    31723172{
    31733173#ifdef TYPE_CHECKING
     
    31823182}
    31833183
    3184 LispObject *LispSymbol::GetValue()
     3184LObject *LSymbol::GetValue()
    31853185{
    31863186#ifdef TYPE_CHECKING
  • abuse/trunk/src/lisp/lisp.h

    r491 r492  
    4545                       // and sure that word, etc are word aligned
    4646
    47 struct LispObject
     47struct LObject
    4848{
    4949    ltype type;
    5050};
    5151
    52 struct LispObjectVar : LispObject
     52struct LObjectVar : LObject
    5353{
    5454    long number;
    5555};
    5656
    57 struct LispList : LispObject
    58 {
    59     static LispList *Create();
     57struct LList : LObject
     58{
     59    static LList *Create();
    6060
    6161    size_t GetLength();
    6262
    63     LispObject *cdr, *car;
    64 };
    65 
    66 struct LispNumber : LispObject
    67 {
    68     static LispNumber *Create(long num);
     63    LObject *cdr, *car;
     64};
     65
     66struct LNumber : LObject
     67{
     68    static LNumber *Create(long num);
    6969
    7070    long num;
    7171};
    7272
    73 struct LispRedirect : LispObject
    74 {
    75     LispObject *new_reference;
    76 };
    77 
    78 struct LispString : LispObject
    79 {
    80     static LispString *Create(char const *string);
    81     static LispString *Create(char const *string, int length);
    82     static LispString *Create(int length);
     73struct LRedirect : LObject
     74{
     75    LObject *new_reference;
     76};
     77
     78struct LString : LObject
     79{
     80    static LString *Create(char const *string);
     81    static LString *Create(char const *string, int length);
     82    static LString *Create(int length);
    8383
    8484    char *GetString();
     
    8787};
    8888
    89 struct LispSymbol : LispObject
    90 {
    91     static LispSymbol *Find(char const *name);
    92     static LispSymbol *FindOrCreate(char const *name);
    93 
    94     LispString *GetName();
    95     LispObject *GetFunction();
    96     LispObject *GetValue();
    97 
    98     void SetFunction(LispObject *fun);
    99     void SetValue(LispObject *value);
     89struct LSymbol : LObject
     90{
     91    static LSymbol *Find(char const *name);
     92    static LSymbol *FindOrCreate(char const *name);
     93
     94    LString *GetName();
     95    LObject *GetFunction();
     96    LObject *GetValue();
     97
     98    void SetFunction(LObject *fun);
     99    void SetValue(LObject *value);
    100100    void SetNumber(long num);
    101101
     
    103103    float time_taken;
    104104#endif
    105     LispObject *value;
    106     LispObject *function;
    107     LispString *name;
    108     LispSymbol *left, *right; // tree structure
    109 };
    110 
    111 struct LispSysFunction : LispObject
     105    LObject *value;
     106    LObject *function;
     107    LString *name;
     108    LSymbol *left, *right; // tree structure
     109};
     110
     111struct LSysFunction : LObject
    112112{
    113113    short min_args, max_args;
     
    115115};
    116116
    117 struct LispUserFunction : LispObject
     117struct LUserFunction : LObject
    118118{
    119119#ifndef NO_LIBS
     
    124124};
    125125
    126 struct LispArray : LispObject
    127 {
    128     static LispArray *Create(int size, void *rest);
    129 
    130     inline LispObject **GetData() { return data; }
    131     LispObject *Get(long x);
     126struct LArray : LObject
     127{
     128    static LArray *Create(int size, void *rest);
     129
     130    inline LObject **GetData() { return data; }
     131    LObject *Get(long x);
    132132
    133133    unsigned short size;
     
    135135
    136136private:
    137     LispObject *data[1];
    138 };
    139 
    140 struct LispChar : LispObject
     137    LObject *data[1];
     138};
     139
     140struct LChar : LObject
    141141{
    142142    int16_t pad;
     
    144144};
    145145
    146 struct LispPointer : LispObject
     146struct LPointer : LObject
    147147{
    148148    void *addr;
    149149};
    150150
    151 
    152 struct LispFixedPoint : LispObject
     151struct LFixedPoint : LObject
    153152{
    154153    int32_t x;
    155154};
    156155
    157 static inline LispObject *&CAR(void *x) { return ((LispList *)x)->car; }
    158 static inline LispObject *&CDR(void *x) { return ((LispList *)x)->cdr; }
     156static inline LObject *&CAR(void *x) { return ((LList *)x)->car; }
     157static inline LObject *&CDR(void *x) { return ((LList *)x)->cdr; }
    159158static inline ltype item_type(void *x) { if (x) return *(ltype *)x; return L_CONS_CELL; }
    160159
     
    174173void *eval(void *prog);
    175174void *eval_block(void *list);
    176 void *eval_function(LispSymbol *sym, void *arg_list);
    177 void *eval_user_fun(LispSymbol *sym, void *arg_list);
     175void *eval_function(LSymbol *sym, void *arg_list);
     176void *eval_user_fun(LSymbol *sym, void *arg_list);
    178177void *compile(char const *&s);
    179178void *assoc(void *item, void *list);
     
    182181
    183182void push_onto_list(void *object, void *&list);
    184 LispSymbol *add_c_object(void *symbol, int16_t number);
    185 LispSymbol *add_c_function(char const *name, short min_args, short max_args, short number);
    186 LispSymbol *add_c_bool_fun(char const *name, short min_args, short max_args, short number);
    187 LispSymbol *add_lisp_function(char const *name, short min_args, short max_args, short number);
     183LSymbol *add_c_object(void *symbol, int16_t number);
     184LSymbol *add_c_function(char const *name, short min_args, short max_args, short number);
     185LSymbol *add_c_bool_fun(char const *name, short min_args, short max_args, short number);
     186LSymbol *add_lisp_function(char const *name, short min_args, short max_args, short number);
    188187int read_ltoken(char *&s, char *buffer);
    189188void print_trace_stack(int max_levels);
    190189
    191190
    192 LispPointer *new_lisp_pointer(void *addr);
    193 LispChar *new_lisp_character(uint16_t ch);
    194 LispFixedPoint *new_lisp_fixed_point(int32_t x);
    195 LispObjectVar *new_lisp_object_var(int16_t number);
    196 LispSysFunction *new_lisp_sys_function(int min_args, int max_args, int fun_number);
    197 LispSysFunction *new_lisp_c_function(int min_args, int max_args, int fun_number);
    198 LispSysFunction *new_lisp_c_bool(int min_args, int max_args, int fun_number);
     191LPointer *new_lisp_pointer(void *addr);
     192LChar *new_lisp_character(uint16_t ch);
     193LFixedPoint *new_lisp_fixed_point(int32_t x);
     194LObjectVar *new_lisp_object_var(int16_t number);
     195LSysFunction *new_lisp_sys_function(int min_args, int max_args, int fun_number);
     196LSysFunction *new_lisp_c_function(int min_args, int max_args, int fun_number);
     197LSysFunction *new_lisp_c_bool(int min_args, int max_args, int fun_number);
    199198
    200199#ifdef NO_LIBS
    201 LispUserFunction *new_lisp_user_function(void *arg_list, void *block_list);
     200LUserFunction *new_lisp_user_function(void *arg_list, void *block_list);
    202201#else
    203 LispUserFunction *new_lisp_user_function(intptr_t arg_list, intptr_t block_list);
    204 #endif
    205 
    206 LispSysFunction *new_user_lisp_function(int min_args, int max_args, int fun_number);
     202LUserFunction *new_lisp_user_function(intptr_t arg_list, intptr_t block_list);
     203#endif
     204
     205LSysFunction *new_user_lisp_function(int min_args, int max_args, int fun_number);
    207206
    208207int end_of_program(char *s);
     
    210209void lisp_init(long perm_size, long tmp_size);
    211210void lisp_uninit();
    212 extern LispSymbol *lsym_root;
     211extern LSymbol *lsym_root;
    213212
    214213extern uint8_t *space[4], *free_space[4];
     
    234233
    235234// FIXME: get rid of this later
    236 static inline void *symbol_value(void *sym) { return ((LispSymbol *)sym)->GetValue(); }
    237 static inline char *lstring_value(void *str) { return ((LispString *)str)->GetString(); }
     235static inline void *symbol_value(void *sym) { return ((LSymbol *)sym)->GetValue(); }
     236static inline char *lstring_value(void *str) { return ((LString *)str)->GetString(); }
    238237
    239238#include "lisp_opt.h"
  • abuse/trunk/src/lisp/lisp_gc.cpp

    r491 r492  
    8484}
    8585
    86 static LispObject *CollectObject(LispObject *x);
    87 
    88 static LispArray *CollectArray(LispArray *x)
     86static LObject *CollectObject(LObject *x);
     87
     88static LArray *CollectArray(LArray *x)
    8989{
    9090    size_t s = x->size;
    91     LispArray *a = LispArray::Create(s, NULL);
    92     LispObject **src = x->GetData();
    93     LispObject **dst = a->GetData();
     91    LArray *a = LArray::Create(s, NULL);
     92    LObject **src = x->GetData();
     93    LObject **dst = a->GetData();
    9494    for (size_t i = 0; i < s; i++)
    9595        dst[i] = CollectObject(src[i]);
     
    9898}
    9999
    100 inline LispList *CollectList(LispList *x)
    101 {
    102     LispList *last = NULL, *first = NULL;
     100inline LList *CollectList(LList *x)
     101{
     102    LList *last = NULL, *first = NULL;
    103103
    104104    for (; x && item_type(x) == L_CONS_CELL; )
    105105    {
    106         LispList *p = LispList::Create();
    107         LispObject *old_car = x->car;
    108         LispObject *old_cdr = x->cdr;
    109         LispObject *old_x = x;
    110         x = (LispList *)CDR(x);
    111         ((LispRedirect *)old_x)->type = L_COLLECTED_OBJECT;
    112         ((LispRedirect *)old_x)->new_reference = p;
     106        LList *p = LList::Create();
     107        LObject *old_car = x->car;
     108        LObject *old_cdr = x->cdr;
     109        LObject *old_x = x;
     110        x = (LList *)CDR(x);
     111        ((LRedirect *)old_x)->type = L_COLLECTED_OBJECT;
     112        ((LRedirect *)old_x)->new_reference = p;
    113113
    114114        p->car = CollectObject(old_car);
     
    126126}
    127127
    128 static LispObject *CollectObject(LispObject *x)
    129 {
    130   LispObject *ret = x;
     128static LObject *CollectObject(LObject *x)
     129{
     130  LObject *ret = x;
    131131
    132132  if (((uint8_t *)x) >= cstart && ((uint8_t *)x) < cend)
     
    139139        break;
    140140      case L_NUMBER:
    141         ret = LispNumber::Create(((LispNumber *)x)->num);
     141        ret = LNumber::Create(((LNumber *)x)->num);
    142142        break;
    143143      case L_SYS_FUNCTION:
    144         ret = new_lisp_sys_function(((LispSysFunction *)x)->min_args,
    145                                     ((LispSysFunction *)x)->max_args,
    146                                     ((LispSysFunction *)x)->fun_number);
     144        ret = new_lisp_sys_function(((LSysFunction *)x)->min_args,
     145                                    ((LSysFunction *)x)->max_args,
     146                                    ((LSysFunction *)x)->fun_number);
    147147        break;
    148148      case L_USER_FUNCTION:
    149149#ifndef NO_LIBS
    150         ret = new_lisp_user_function(((LispUserFunction *)x)->alist,
    151                                      ((LispUserFunction *)x)->blist);
     150        ret = new_lisp_user_function(((LUserFunction *)x)->alist,
     151                                     ((LUserFunction *)x)->blist);
    152152
    153153#else
    154154        {
    155           LispObject *arg = CollectObject(((LispUserFunction *)x)->arg_list);
    156           LispObject *block = CollectObject(((LispUserFunction *)x)->block_list);
     155          LObject *arg = CollectObject(((LUserFunction *)x)->arg_list);
     156          LObject *block = CollectObject(((LUserFunction *)x)->block_list);
    157157          ret = new_lisp_user_function(arg, block);
    158158        }
     
    160160        break;
    161161      case L_STRING:
    162         ret = LispString::Create(lstring_value(x));
     162        ret = LString::Create(lstring_value(x));
    163163        break;
    164164      case L_CHARACTER:
     
    166166        break;
    167167      case L_C_FUNCTION:
    168         ret = new_lisp_c_function(((LispSysFunction *)x)->min_args,
    169                                   ((LispSysFunction *)x)->max_args,
    170                                   ((LispSysFunction *)x)->fun_number);
     168        ret = new_lisp_c_function(((LSysFunction *)x)->min_args,
     169                                  ((LSysFunction *)x)->max_args,
     170                                  ((LSysFunction *)x)->fun_number);
    171171        break;
    172172      case L_C_BOOL:
    173         ret = new_lisp_c_bool(((LispSysFunction *)x)->min_args,
    174                               ((LispSysFunction *)x)->max_args,
    175                               ((LispSysFunction *)x)->fun_number);
     173        ret = new_lisp_c_bool(((LSysFunction *)x)->min_args,
     174                              ((LSysFunction *)x)->max_args,
     175                              ((LSysFunction *)x)->fun_number);
    176176        break;
    177177      case L_L_FUNCTION:
    178         ret = new_user_lisp_function(((LispSysFunction *)x)->min_args,
    179                                      ((LispSysFunction *)x)->max_args,
    180                                      ((LispSysFunction *)x)->fun_number);
     178        ret = new_user_lisp_function(((LSysFunction *)x)->min_args,
     179                                     ((LSysFunction *)x)->max_args,
     180                                     ((LSysFunction *)x)->fun_number);
    181181        break;
    182182      case L_POINTER:
     
    184184        break;
    185185      case L_1D_ARRAY:
    186         ret = CollectArray((LispArray *)x);
     186        ret = CollectArray((LArray *)x);
    187187        break;
    188188      case L_FIXED_POINT:
     
    190190        break;
    191191      case L_CONS_CELL:
    192         ret = CollectList((LispList *)x);
     192        ret = CollectList((LList *)x);
    193193        break;
    194194      case L_OBJECT_VAR:
    195         ret = new_lisp_object_var(((LispObjectVar *)x)->number);
     195        ret = new_lisp_object_var(((LObjectVar *)x)->number);
    196196        break;
    197197      case L_COLLECTED_OBJECT:
    198         ret = ((LispRedirect *)x)->new_reference;
     198        ret = ((LRedirect *)x)->new_reference;
    199199        break;
    200200      default:
     
    205205        break;
    206206    }
    207     ((LispRedirect *)x)->type = L_COLLECTED_OBJECT;
    208     ((LispRedirect *)x)->new_reference = ret;
     207    ((LRedirect *)x)->type = L_COLLECTED_OBJECT;
     208    ((LRedirect *)x)->new_reference = ret;
    209209  }
    210210  else if ((uint8_t *)x < collected_start || (uint8_t *)x >= collected_end)
     
    213213    {
    214214      for (; x && item_type(x) == L_CONS_CELL; x = CDR(x))
    215         ((LispList *)x)->car = CollectObject(((LispList *)x)->car);
     215        ((LList *)x)->car = CollectObject(((LList *)x)->car);
    216216      if (x)
    217         ((LispList *)x)->cdr = CollectObject(((LispList *)x)->cdr);
     217        ((LList *)x)->cdr = CollectObject(((LList *)x)->cdr);
    218218    }
    219219  }
     
    222222}
    223223
    224 static void collect_symbols(LispSymbol *root)
     224static void collect_symbols(LSymbol *root)
    225225{
    226226  if (root)
     
    228228    root->value = CollectObject(root->value);
    229229    root->function = CollectObject(root->function);
    230     root->name = (LispString *)CollectObject(root->name);
     230    root->name = (LString *)CollectObject(root->name);
    231231    collect_symbols(root->left);
    232232    collect_symbols(root->right);
     
    240240  void **d = l_user_stack.sdata;
    241241  for (int i = 0; i < t; i++, d++)
    242     *d = CollectObject((LispObject *)*d);
     242    *d = CollectObject((LObject *)*d);
    243243
    244244  t = PtrRef::stack.son;
     
    247247  {
    248248    void **ptr = *d2;
    249     *ptr = CollectObject((LispObject *)*ptr);
     249    *ptr = CollectObject((LObject *)*ptr);
    250250  }
    251251
     
    254254  {
    255255    void **ptr = *d2;
    256     *ptr = CollectObject((LispObject *)*ptr);
     256    *ptr = CollectObject((LObject *)*ptr);
    257257  }
    258258}
  • abuse/trunk/src/lisp/lisp_opt.cpp

    r491 r492  
    1919#include "lisp_gc.h"
    2020
    21 LispObject *l_undefined;
    22 LispSymbol *true_symbol = NULL, *list_symbol, *string_symbol, *quote_symbol,
     21LObject *l_undefined;
     22LSymbol *true_symbol = NULL, *list_symbol, *string_symbol, *quote_symbol,
    2323     *backquote_symbol, *comma_symbol, *do_symbol, *in_symbol, *aref_symbol,
    2424     *if_symbol, *progn_symbol, *car_symbol, *cdr_symbol;
     
    9595{
    9696    // This needs to be defined first
    97     l_undefined = LispSymbol::FindOrCreate(":UNDEFINED");
     97    l_undefined = LSymbol::FindOrCreate(":UNDEFINED");
    9898
    9999    // Collection problems result if we don't do this
    100     ((LispSymbol *)l_undefined)->function = NULL;
    101     ((LispSymbol *)l_undefined)->value = NULL;
     100    ((LSymbol *)l_undefined)->function = NULL;
     101    ((LSymbol *)l_undefined)->value = NULL;
    102102
    103     true_symbol = LispSymbol::FindOrCreate("T");
     103    true_symbol = LSymbol::FindOrCreate("T");
    104104
    105     list_symbol = LispSymbol::FindOrCreate("list");
    106     string_symbol = LispSymbol::FindOrCreate("string");
    107     quote_symbol = LispSymbol::FindOrCreate("quote");
    108     backquote_symbol = LispSymbol::FindOrCreate("backquote");
    109     comma_symbol = LispSymbol::FindOrCreate("comma");
    110     in_symbol = LispSymbol::FindOrCreate("in");
    111     do_symbol = LispSymbol::FindOrCreate("do");
    112     aref_symbol = LispSymbol::FindOrCreate("aref");
    113     colon_initial_contents = LispSymbol::FindOrCreate(":initial-contents");
    114     colon_initial_element = LispSymbol::FindOrCreate(":initial-element");
     105    list_symbol = LSymbol::FindOrCreate("list");
     106    string_symbol = LSymbol::FindOrCreate("string");
     107    quote_symbol = LSymbol::FindOrCreate("quote");
     108    backquote_symbol = LSymbol::FindOrCreate("backquote");
     109    comma_symbol = LSymbol::FindOrCreate("comma");
     110    in_symbol = LSymbol::FindOrCreate("in");
     111    do_symbol = LSymbol::FindOrCreate("do");
     112    aref_symbol = LSymbol::FindOrCreate("aref");
     113    colon_initial_contents = LSymbol::FindOrCreate(":initial-contents");
     114    colon_initial_element = LSymbol::FindOrCreate(":initial-element");
    115115
    116     if_1progn = LispSymbol::FindOrCreate("if-1progn");
    117     if_2progn = LispSymbol::FindOrCreate("if-2progn");
    118     if_12progn = LispSymbol::FindOrCreate("if-12progn");
    119     if_symbol = LispSymbol::FindOrCreate("if");
    120     progn_symbol = LispSymbol::FindOrCreate("progn");
    121     not_symbol = LispSymbol::FindOrCreate("not");
    122     eq_symbol = LispSymbol::FindOrCreate("eq");
    123     zero_symbol = LispSymbol::FindOrCreate("0");
    124     eq0_symbol = LispSymbol::FindOrCreate("eq0");
    125     car_symbol = LispSymbol::FindOrCreate("car");
    126     cdr_symbol = LispSymbol::FindOrCreate("cdr");
    127     load_warning = LispSymbol::FindOrCreate("load_warning");
     116    if_1progn = LSymbol::FindOrCreate("if-1progn");
     117    if_2progn = LSymbol::FindOrCreate("if-2progn");
     118    if_12progn = LSymbol::FindOrCreate("if-12progn");
     119    if_symbol = LSymbol::FindOrCreate("if");
     120    progn_symbol = LSymbol::FindOrCreate("progn");
     121    not_symbol = LSymbol::FindOrCreate("not");
     122    eq_symbol = LSymbol::FindOrCreate("eq");
     123    zero_symbol = LSymbol::FindOrCreate("0");
     124    eq0_symbol = LSymbol::FindOrCreate("eq0");
     125    car_symbol = LSymbol::FindOrCreate("car");
     126    cdr_symbol = LSymbol::FindOrCreate("cdr");
     127    load_warning = LSymbol::FindOrCreate("load_warning");
    128128}
    129129
  • abuse/trunk/src/lisp/lisp_opt.h

    r490 r492  
    1313#include "lisp.h"
    1414
    15 extern LispObject *l_undefined;
    16 extern LispSymbol *true_symbol, *list_symbol, *string_symbol, *quote_symbol,
     15extern LObject *l_undefined;
     16extern LSymbol *true_symbol, *list_symbol, *string_symbol, *quote_symbol,
    1717     *backquote_symbol, *comma_symbol, *do_symbol, *in_symbol, *aref_symbol,
    1818     *if_symbol, *progn_symbol, *car_symbol, *cdr_symbol;
  • abuse/trunk/src/loader2.cpp

    r484 r492  
    368368  char const *ff;
    369369  // FIXME: unnecessary duplicate call
    370   if (DEFINEDP(LispSymbol::FindOrCreate("frame_file")->GetValue()))
    371     ff = lstring_value(LispSymbol::FindOrCreate("frame_file")->GetValue());
     370  if (DEFINEDP(LSymbol::FindOrCreate("frame_file")->GetValue()))
     371    ff = lstring_value(LSymbol::FindOrCreate("frame_file")->GetValue());
    372372  else
    373373    ff = "art/frame.spe";
  • abuse/trunk/src/menu.cpp

    r490 r492  
    134134  args=CAR(CDR(args));
    135135
    136   int options = ((LispList *)args)->GetLength();
     136  int options = ((LList *)args)->GetLength();
    137137  int mh=(font->height()+1)*options+10,maxw=0;
    138138
     
    377377void show_sell(int abortable)
    378378{
    379   LispSymbol *ss = LispSymbol::FindOrCreate("sell_screens");
     379  LSymbol *ss = LSymbol::FindOrCreate("sell_screens");
    380380  if (!DEFINEDP(ss->GetValue()))
    381381  {
     
    385385//    char *prog="((\"art/endgame.spe\" . \"credit\") (\"art/help.spe\" . \"sell6\"))";
    386386    char const *prog="((\"art/endgame.spe\" . \"credit\"))";
    387     ss->SetValue((LispObject *)compile(prog));
     387    ss->SetValue((LObject *)compile(prog));
    388388    current_space=sp;
    389389  }
     
    394394    wm->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
    395395
    396     LispObject *tmp = (LispObject *)ss->GetValue();
     396    LObject *tmp = (LObject *)ss->GetValue();
    397397    int quit=0;
    398398    while (tmp && !quit)
     
    409409        quit=1;
    410410      fade_out(16);
    411       tmp = (LispObject *)CDR(tmp);
     411      tmp = (LObject *)CDR(tmp);
    412412    }
    413413    wm->set_mouse_shape(cache.img(c_normal)->copy(),1,1);
     
    696696                if (!current_demo)
    697697                {
    698                     LispSymbol *d = LispSymbol::FindOrCreate("demos");
     698                    LSymbol *d = LSymbol::FindOrCreate("demos");
    699699                    if (DEFINEDP(d->GetValue()))
    700700                        current_demo = d->GetValue();
  • abuse/trunk/src/objects.cpp

    r491 r492  
    105105  for (i=0;i<figures[otype]->tiv;i++)
    106106  {
    107     if (!strcmp(lstring_value(((LispSymbol *)figures[otype]->vars[i])->GetName()),name))
     107    if (!strcmp(lstring_value(((LSymbol *)figures[otype]->vars[i])->GetName()),name))
    108108    {
    109109      return lvars[figures[otype]->var_index[i]];
    110 /*      LispObjectVar *cobj=(LispObjectVar *)symbol_value(figures[otype]->vars[i]);
     110/*      LObjectVar *cobj=(LObjectVar *)symbol_value(figures[otype]->vars[i]);
    111111      character_type *t=figures[otype];
    112112      int number=cobj->number;
     
    135135  }
    136136  for (i=0;i<figures[otype]->tiv;i++)
    137     if (!strcmp(lstring_value(((LispSymbol *)figures[otype]->vars[i])->GetName()),name))
     137    if (!strcmp(lstring_value(((LSymbol *)figures[otype]->vars[i])->GetName()),name))
    138138    {
    139139      lvars[figures[otype]->var_index[i]]=value;
     
    265265
    266266    void *m=mark_heap(TMP_SPACE);
    267     eval_function((LispSymbol *)ns,NULL);
     267    eval_function((LSymbol *)ns,NULL);
    268268    restore_heap(m,TMP_SPACE);
    269269
     
    279279        current_object = this;
    280280        void *m = mark_heap( TMP_SPACE );
    281         (void)eval_function( (LispSymbol *)ns, NULL );
     281        (void)eval_function( (LSymbol *)ns, NULL );
    282282        restore_heap( m, TMP_SPACE );
    283283    }
     
    419419      prof1=new time_marker;
    420420
    421     Cell *ret=(Cell *)eval_function((LispSymbol *)figures[otype]->get_fun(OFUN_AI),NULL);
     421    Cell *ret=(Cell *)eval_function((LSymbol *)figures[otype]->get_fun(OFUN_AI),NULL);
    422422    if (profiling())
    423423    {
     
    483483  if (d)
    484484  {
    485     LispList *am, *frm, *hx, *hy, *px, *py;
     485    LList *am, *frm, *hx, *hy, *px, *py;
    486486    game_object *o = current_object;
    487487    current_object = this;
     
    489489    void *m = mark_heap(TMP_SPACE);
    490490
    491     am = LispList::Create();
     491    am = LList::Create();
    492492    PtrRef r1(am);
    493     am->car = LispNumber::Create(amount);
    494 
    495     frm = LispList::Create();
     493    am->car = LNumber::Create(amount);
     494
     495    frm = LList::Create();
    496496    PtrRef r2(frm);
    497497    frm->car = new_lisp_pointer(from);
    498498
    499     hx = LispList::Create();
     499    hx = LList::Create();
    500500    PtrRef r3(hx);
    501     hx->car = LispNumber::Create(hitx);
    502 
    503     hy = LispList::Create();
     501    hx->car = LNumber::Create(hitx);
     502
     503    hy = LList::Create();
    504504    PtrRef r4(hy);
    505     hy->car = LispNumber::Create(hity);
    506 
    507     px = LispList::Create();
     505    hy->car = LNumber::Create(hity);
     506
     507    px = LList::Create();
    508508    PtrRef r5(px);
    509     px->car = LispNumber::Create(push_xvel);
    510 
    511     py = LispList::Create();
     509    px->car = LNumber::Create(push_xvel);
     510
     511    py = LList::Create();
    512512    PtrRef r6(py);
    513     py->car = LispNumber::Create(push_yvel);
     513    py->car = LNumber::Create(push_yvel);
    514514
    515515    px->cdr = py;
     
    523523      prof1 = new time_marker;
    524524
    525     eval_user_fun((LispSymbol *)d, am);
     525    eval_user_fun((LSymbol *)d, am);
    526526    if (profiling())
    527527    {
     
    635635      prof1=new time_marker;
    636636
    637     eval_function((LispSymbol *)figures[otype]->get_fun(OFUN_DRAW),NULL);
     637    eval_function((LSymbol *)figures[otype]->get_fun(OFUN_DRAW),NULL);
    638638    if (profiling())
    639639    {
     
    662662      prof1=new time_marker;
    663663
    664     eval_function((LispSymbol *)figures[otype]->get_fun(OFUN_MAP_DRAW),NULL);
     664    eval_function((LSymbol *)figures[otype]->get_fun(OFUN_MAP_DRAW),NULL);
    665665    if (profiling())
    666666    {
     
    903903      } else
    904904      {
    905     push_onto_list(LispNumber::Create(ly),rlist);
    906     push_onto_list(LispNumber::Create(lx),rlist);
     905    push_onto_list(LNumber::Create(ly),rlist);
     906    push_onto_list(LNumber::Create(lx),rlist);
    907907    push_onto_list(l_tile,rlist);
    908908      }
    909       push_onto_list(LispNumber::Create(ret),rlist);
     909      push_onto_list(LNumber::Create(ret),rlist);
    910910
    911911      return rlist;
     
    11691169      prof1=new time_marker;
    11701170
    1171     eval_function((LispSymbol *)figures[type]->get_fun(OFUN_CONSTRUCTOR),NULL);
     1171    eval_function((LSymbol *)figures[type]->get_fun(OFUN_CONSTRUCTOR),NULL);
    11721172    if (profiling())
    11731173    {
     
    12071207  if (figures[otype]->get_fun(OFUN_MOVER))      // is a lisp move function defined?
    12081208  {
    1209     LispList *lcx, *lcy, *lb;
     1209    LList *lcx, *lcy, *lb;
    12101210
    12111211    game_object *o=current_object;
     
    12131213
    12141214    // make a list of the parameters, and call the lisp function
    1215     lcx = LispList::Create();
     1215    lcx = LList::Create();
    12161216    PtrRef r1(lcx);
    1217     lcx->car = LispNumber::Create(cx);
    1218 
    1219     lcy = LispList::Create();
     1217    lcx->car = LNumber::Create(cx);
     1218
     1219    lcy = LList::Create();
    12201220    PtrRef r2(lcy);
    1221     lcy->car = LispNumber::Create(cy);
    1222 
    1223     lb = LispList::Create();
     1221    lcy->car = LNumber::Create(cy);
     1222
     1223    lb = LList::Create();
    12241224    PtrRef r3(lb);
    1225     lb->car = LispNumber::Create(button);
     1225    lb->car = LNumber::Create(button);
    12261226
    12271227    lcx->cdr = lcy;
     
    12341234      prof1=new time_marker;
    12351235
    1236     void *r=eval_function((LispSymbol *)figures[otype]->get_fun(OFUN_MOVER),
     1236    void *r=eval_function((LSymbol *)figures[otype]->get_fun(OFUN_MOVER),
    12371237              (void *)lcx);
    12381238    if (profiling())
     
    15941594        prof1=new time_marker;
    15951595
    1596       eval_user_fun((LispSymbol *)f,NULL);
     1596      eval_user_fun((LSymbol *)f,NULL);
    15971597
    15981598      if (profiling())
     
    16371637      prof1=new time_marker;
    16381638
    1639     eval_function((LispSymbol *)figures[new_type]->get_fun(OFUN_CONSTRUCTOR),NULL);
     1639    eval_function((LSymbol *)figures[new_type]->get_fun(OFUN_CONSTRUCTOR),NULL);
    16401640    if (profiling())
    16411641    {
  • abuse/trunk/src/particle.cpp

    r484 r492  
    6161int defun_pseq(void *args)
    6262{
    63   LispSymbol *sym=(LispSymbol *)lcar(args);
     63  LSymbol *sym=(LSymbol *)lcar(args);
    6464  if (item_type(sym)!=L_SYMBOL)
    6565  {
  • abuse/trunk/src/seq.cpp

    r490 r492  
    4040    total=1;
    4141  else
    42     total = ((LispList *)pict_list)->GetLength();
     42    total = ((LList *)pict_list)->GetLength();
    4343
    4444  seq=(int *) malloc(sizeof(int)*total);
  • abuse/trunk/src/statbar.cpp

    r484 r492  
    4141  char sbname[100];
    4242  char iname[20];
    43   void *l_name = LispSymbol::FindOrCreate("sbar_file");
     43  void *l_name = LSymbol::FindOrCreate("sbar_file");
    4444  if (symbol_value(l_name)!=l_undefined)
    4545    strcpy(sbname,lstring_value(symbol_value(l_name)));
  • abuse/trunk/src/view.cpp

    r488 r492  
    334334/*    if( DEFINEDP( symbol_function( l_get_local_input ) ) )
    335335    {
    336         void *ret = eval_function((LispSymbol *)l_get_local_input, NULL );
     336        void *ret = eval_function((LSymbol *)l_get_local_input, NULL );
    337337        sug_x = lnumber_value( CAR( ret ) );
    338338        ret = CDR( ret );
     
    460460      void *m=mark_heap(TMP_SPACE);
    461461      void *list=NULL;
    462       push_onto_list(LispString::Create(chat_buf),list);
    463       eval_function((LispSymbol *)l_chat_input,list);
     462      push_onto_list(LString::Create(chat_buf),list);
     463      eval_function((LSymbol *)l_chat_input,list);
    464464      restore_heap(m,TMP_SPACE);
    465465
     
    883883      game_object *o=current_object;
    884884      current_object=focus;
    885       eval_user_fun((LispSymbol *)figures[focus->otype]->get_fun(OFUN_CONSTRUCTOR),NULL);
     885      eval_user_fun((LSymbol *)figures[focus->otype]->get_fun(OFUN_CONSTRUCTOR),NULL);
    886886      current_object=o;
    887887    }
Note: See TracChangeset for help on using the changeset viewer.