Ignore:
Timestamp:
Mar 2, 2008, 12:29:06 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Fix almost 2,000 warnings by using proper "const" keywords where needed.
Location:
abuse/trunk/src/include
Files:
22 edited

Legend:

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

    r2 r39  
    1717
    1818#define TOTAL_ABILITIES (walk_top_speed+1)
    19 extern char *ability_names[TOTAL_ABILITIES];
     19extern char const *ability_names[TOTAL_ABILITIES];
    2020long get_ability(int who, ability a);
    2121long get_ability_default(ability a);
  • abuse/trunk/src/include/cache.hpp

    r17 r39  
    3737  uint32_t crc;
    3838  char *filename;
    39   crced_file(char *name);
     39  crced_file(char const *name);
    4040  ~crced_file();
    4141} ;
     
    4747  public :
    4848  crc_manager();
    49   int get_filenumber(char *filename);
     49  int get_filenumber(char const *filename);
    5050  uint32_t get_crc(int32_t filenumber, int &failed);
    5151  void set_crc(int32_t filenumber, uint32_t crc);
     
    5353  void clean_up();
    5454  int total_filenames() { return total_files; }
    55   int write_crc_file(char *filename);
    56   int load_crc_file(char *filename);
     55  int write_crc_file(char const *filename);
     56  int load_crc_file(char const *filename);
    5757} ;
    5858
     
    8787  int in_use() { if (used) { used=0; return 1; } else return 0; }
    8888  int full() { if (ful) { ful=0; return 1; } else return 0; }
    89   int32_t reg_object(char *filename, void *object, int type, int rm_dups);      // lisp object
    90   int32_t reg(char *filename, char *name, int type=-1, int rm_dups=0);          // returns id to item
     89  int32_t reg_object(char const *filename, void *object, int type, int rm_dups);      // lisp object
     90  int32_t reg(char const *filename, char const *name, int type=-1, int rm_dups=0);          // returns id to item
    9191  int32_t reg_lisp_block(Cell *block);
    9292  int loaded(int id);
  • abuse/trunk/src/include/chars.hpp

    r2 r39  
    2424
    2525#define MAX_STATE (running+1)
    26 extern char *state_names[];
     26extern char const *state_names[];
    2727
    2828class named_field
     
    5555                                  // then objects will not draw a damage when hitting it
    5656     };
    57 extern char *cflag_names[TOTAL_CFLAGS];
     57extern char const *cflag_names[TOTAL_CFLAGS];
    5858
    5959// all object functions default to NULL
     
    7171       OFUN_CHANGE_TYPE
    7272     } ;
    73 extern char *ofun_names[TOTAL_OFUNS];
     73extern char const *ofun_names[TOTAL_OFUNS];
    7474
    7575
  • abuse/trunk/src/include/config.hpp

    r2 r39  
    1212void get_movement(int player, int &x, int &y, int &b1, int &b2, int &b3, int &b4);
    1313void config_cleanup();  // free any memory allocated
    14 int get_keycode(char *str);  // -1 means not a valid key code
     14int get_keycode(char const *str);  // -1 means not a valid key code
    1515
    1616#endif
  • abuse/trunk/src/include/console.hpp

    r2 r39  
    1414  public :
    1515
    16   console(window_manager *WM, JCFont *font, int width, int height, char *Name);
     16  console(window_manager *WM, JCFont *font, int width, int height, char const *Name);
    1717  int showing() { return con_win!=NULL; }
    1818  void show();
     
    2626  int wy() { return con_win->y1(); }
    2727  void draw_cursor();
    28   void put_string(char *st);
     28  void put_string(char const *st);
    2929  void draw_char(int x, int y, char ch);
    3030  void toggle() { if (con_win) hide(); else show(); }
    31   void print_f(const char *format, ...);
     31  void print_f(char const *format, ...);
    3232  ~console();
    3333} ;
     
    3737  char shcmd[300];
    3838  public :
    39   shell_term(window_manager *WM, JCFont *font, int width, int height, char *Name);
     39  shell_term(window_manager *WM, JCFont *font, int width, int height, char const *Name);
    4040  virtual ~shell_term() {};
    4141  int handle_event(event &ev, window_manager *wm);
    4242  virtual void prompt();
    43   virtual void execute(char *st);
     43  virtual void execute(char const *st);
    4444} ;
    4545
  • abuse/trunk/src/include/dev.hpp

    r16 r39  
    1515void dev_cleanup();
    1616void toggle_edit_mode();
    17 char *symbol_str(char *name);
     17char const *symbol_str(char const *name);
    1818
    1919class pal_win
     
    8585  void toggle_light_window();
    8686  void toggle_search_window();
    87   void show_char_mem(char *name);
     87  void show_char_mem(char const *name);
    8888  void close_oedit_window();
    8989  void show_mem();
    9090  dev_controll();
    9191  void handle_event(event &ev);
    92   void do_command(char *st, event &ev);
     92  void do_command(char const *st, event &ev);
    9393  int is_pal_win(jwindow *win);
    9494  void dev_draw(view *v);
  • abuse/trunk/src/include/extend.hpp

    r17 r39  
    4141  morph_char *mc;
    4242  int total_vars();
    43   char *var_name(int x);
    44   int   var_type(int x);
     43  char const *var_name(int x);
     44  int var_type(int x);
    4545  void set_var(int x, uint32_t v);
    4646  int32_t get_var(int x);
  • abuse/trunk/src/include/game.hpp

    r17 r39  
    5050extern int demo_start,idle_ticks;
    5151
     52extern FILE *open_FILE(char const *filename, char const *mode);
     53
    5254class game
    5355{
     
    8082  game(int argc, char **argv);
    8183  void step();
    82   void show_help(char *st);
     84  void show_help(char const *st);
    8385  void draw_value(image *screen, int x, int y, int w, int h, int val, int max);
    8486  unsigned char get_color(int x) { return x; }
     
    120122
    121123  int in_area(event &ev, int x1, int y1, int x2, int y2);
    122   void load_level(char *name);
     124  void load_level(char const *name);
    123125  void set_level(level *nl);
    124126  void show_time();
  • abuse/trunk/src/include/gui.hpp

    r2 r39  
    1010  char key[16];
    1111public :
    12   ico_button(int X, int Y, int ID, int Up, int down, int upa, int downa, ifield *Next, int act_id=-1, char *help_key=NULL);
     12  ico_button(int X, int Y, int ID, int Up, int down, int upa, int downa, ifield *Next, int act_id=-1, char const *help_key=NULL);
    1313
    1414  virtual void area(int &x1, int &y1, int &x2, int &y2, window_manager *wm);
  • abuse/trunk/src/include/items.hpp

    r17 r39  
    1414{
    1515public : 
    16   boundary(bFILE *fp,char *er_name);
     16  boundary(bFILE *fp,char const *er_name);
    1717  uint8_t *inside;     // tells which side of the line is on the inside
    1818  boundary(boundary *p);      // flips the *inside list
  • abuse/trunk/src/include/language.hpp

    r2 r39  
    1 char *lang_string(char *symbol);
     1char const *lang_string(char const *symbol);
  • abuse/trunk/src/include/level.hpp

    r17 r39  
    8585  uint16_t background_height() { return bg_height; }
    8686  int load_failed() { return map_fg==NULL; }
    87   level(spec_directory *sd, bFILE *fp, char *lev_name);
     87  level(spec_directory *sd, bFILE *fp, char const *lev_name);
    8888  void load_fail();             
    89   level(int width, int height, char *name); 
    90   int save(char *filename, int save_all);  // save_all includes player and view information (1 = success)
    91   void set_name(char *name) { Name=strcpy((char *)jrealloc(Name,strlen(name)+1,"map name"),name); }
     89  level(int width, int height, char const *name); 
     90  int save(char const *filename, int save_all);  // save_all includes player and view information (1 = success)
     91  void set_name(char const *name) { Name=strcpy((char *)jrealloc(Name,strlen(name)+1,"map name"),name); }
    9292  void set_size(int w, int h);
    9393  void remove_light(light_source *which);
  • abuse/trunk/src/include/light.hpp

    r17 r39  
    5555                               int32_t inner, int32_t outer, int32_t xshift, int32_t yshift);
    5656
    57 void add_light_spec(spec_directory *sd, char *level_name);
     57void add_light_spec(spec_directory *sd, char const *level_name);
    5858void write_lights(bFILE *fp);
    59 void read_lights(spec_directory *sd, bFILE *fp, char *level_name);
     59void read_lights(spec_directory *sd, bFILE *fp, char const *level_name);
    6060
    6161
  • abuse/trunk/src/include/lisp.hpp

    r19 r39  
    139139void *lisp_eq(void *n1, void *n2);
    140140void *lisp_equal(void *n1, void *n2);
    141 lisp_symbol *find_symbol(char *name);
     141lisp_symbol *find_symbol(char const *name);
    142142long list_length(void *i);
    143143void lprint(void *i);
     
    146146void *eval_function(lisp_symbol *sym, void *arg_list);
    147147void *eval_user_fun(lisp_symbol *sym, void *arg_list);
    148 void *compile(char *&s);
     148void *compile(char const *&s);
    149149void *symbol_value(void *symbol);
    150150void *symbol_function(void *symbol);
     
    155155void resize_tmp(int new_size);
    156156void resize_perm(int new_size);
    157 lisp_symbol *make_find_symbol(char *name);
     157lisp_symbol *make_find_symbol(char const *name);
    158158
    159159void push_onto_list(void *object, void *&list);
    160160lisp_symbol *add_c_object(void *symbol, int16_t number);
    161 lisp_symbol *add_c_function(char *name, short min_args, short max_args, short number);
    162 lisp_symbol *add_c_bool_fun(char *name, short min_args, short max_args, short number);
    163 lisp_symbol *add_lisp_function(char *name, short min_args, short max_args, short number);
     161lisp_symbol *add_c_function(char const *name, short min_args, short max_args, short number);
     162lisp_symbol *add_c_bool_fun(char const *name, short min_args, short max_args, short number);
     163lisp_symbol *add_lisp_function(char const *name, short min_args, short max_args, short number);
    164164int read_ltoken(char *&s, char *buffer);
    165165cons_cell *new_cons_cell();
     
    170170lisp_pointer *new_lisp_pointer(void *addr);
    171171lisp_character *new_lisp_character(uint16_t ch);
    172 lisp_string *new_lisp_string(char *string);
    173 lisp_string *new_lisp_string(char *string, int length);
     172lisp_string *new_lisp_string(char const *string);
     173lisp_string *new_lisp_string(char const *string, int length);
    174174lisp_string *new_lisp_string(int length);
    175175lisp_fixed_point *new_lisp_fixed_point(int32_t x);
  • abuse/trunk/src/include/lisp2.hpp

    r2 r39  
    8282void lisp_init (long a, long b);
    8383void lisp_uninit (void);
    84 char* lstring_value (void* x);
     84char * lstring_value (void* x);
    8585long lnumber_value (void* x);
    8686char lcharacter_value (void* x);
  • abuse/trunk/src/include/loadgame.hpp

    r2 r39  
    33
    44int show_load_icon();
    5 int load_game(int show_all, char *title);
     5int load_game(int show_all, char const *title);
    66void get_savegame_name(char *buf);  // buf should be at least 50 bytes
    77void last_savegame_name(char *buf);
  • abuse/trunk/src/include/netcfg.hpp

    r2 r39  
    2424  net_configuration();
    2525  int input();   // pulls up dialog box and input fileds
    26   void cfg_error(char *msg);
     26  void cfg_error(char const *msg);
    2727  int confirm_inputs(jwindow *j, int server);
    28   void error(char *message);
     28  void error(char const *message);
    2929  int confirm_inputs(input_manager *i, int server);
    3030  ifield *center_ifield(ifield *i,int x1, int x2, ifield *place_below);
  • abuse/trunk/src/include/nfserver.hpp

    r2 r39  
    1515
    1616int net_start();
    17 bFILE *open_nfs_file(char *filename,char *mode);
     17bFILE *open_nfs_file(char const *filename, char const *mode);
    1818
    1919int net_init(int argc, char **argv);
    20 int NF_open_file(char *filename, char *mode);
     20int NF_open_file(char const *filename, char const *mode);
    2121long NF_close(int fd);
    2222long NF_read(int fd, void *buf, long size);
     
    3030void net_reload();
    3131void read_new_views();
    32 int set_file_server(char *name);
     32int set_file_server(char const *name);
    3333int set_file_server(net_address *addr);
    3434
  • abuse/trunk/src/include/objects.hpp

    r18 r39  
    3737
    3838#define TOTAL_OBJECT_VARS 28
    39 struct obj_desc { char *name; int type; } ;
     39struct obj_desc { char const *name; int type; } ;
    4040extern obj_desc object_descriptions[TOTAL_OBJECT_VARS];
    4141int RC_type_size(int type);
  • abuse/trunk/src/include/property.hpp

    r2 r39  
    66{
    77  property *first;
    8   property *find(char *name);
     8  property *find(char const *name);
    99  public :
    1010  property_manager() { first=0; }
    11   void load(char *filename);
    12   void save(char *filename);
     11  void load(char const *filename);
     12  void save(char const *filename);
    1313 
    14   int getd(char *name, int def) { return (int)get(name,def); }
    15   int get(char *name, int def);
    16   char  *get(char *name, char *def);
     14  int getd(char const *name, int def) { return (int)get(name,def); }
     15  int get(char const *name, int def);
     16  char const *get(char const *name, char const *def);
    1717
    18   void setd(char *name, int def) { set(name,def); }
    19   void set(char *name, double def);
    20   void set(char *name, char *def);
     18  void setd(char const *name, int def) { set(name,def); }
     19  void set(char const *name, double def);
     20  void set(char const *name, char const *def);
    2121  ~property_manager();
    2222} ;
  • abuse/trunk/src/include/specache.hpp

    r2 r39  
    1414    spec_directory *sd;
    1515    char *filename() { return fn; }
    16     filename_node(char *filename, spec_directory *dir)
     16    filename_node(char const *filename, spec_directory *dir)
    1717    {
    1818      fn=(char *)memcpy(jmalloc(strlen(filename)+1,"spec_dir cache"),filename,strlen(filename)+1);
     
    2525  long size;
    2626  public :
    27   spec_directory *get_spec_directory(char *filename, bFILE *fp=NULL);
     27  spec_directory *get_spec_directory(char const *filename, bFILE *fp=NULL);
    2828  spec_directory_cache() { fn_root=0; size=0; }
    2929  void clear();                             // frees up all allocated memory
  • abuse/trunk/src/include/view.hpp

    r17 r39  
    119119object_node *make_player_onodes(int player_num=-1);
    120120int total_view_vars();
    121 char *get_view_var_name(int num);
     121char const *get_view_var_name(int num);
    122122ushort make_sync();
    123123
Note: See TracChangeset for help on using the changeset viewer.