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.
File:
1 edited

Legend:

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

    r2 r39  
     1#include <stdio.h>
     2#include <string.h>
     3
    14#include "property.hpp"
    25#include "jmalloc.hpp"
    3 #include <stdio.h>
    46#include "dprint.hpp"
    5 #include <string.h>
     7#include "game.hpp"
    68
    79class property
     
    1113  char *def_str;
    1214  int def_num;
    13   property(char *Name, int Def)
     15  property(char const *Name, int Def)
    1416  { name=strcpy((char *)jmalloc(strlen(Name)+1,"Property Name"),Name);
    1517    def_num=Def;
     
    1820  }
    1921
    20   property(char *Name, char *Def)
     22  property(char const *Name, char const *Def)
    2123  { name=strcpy((char *)jmalloc(strlen(Name)+1,"Property Name"),Name);
    2224    def_str=strcpy((char *)jmalloc(strlen(Def)+1,"Property text"),Def);
     
    3335  }
    3436
    35   void set(char *x)
     37  void set(char const *x)
    3638  {
    3739    if (def_str)
     
    5254} ;
    5355
    54 property *property_manager::find(char *name)
     56property *property_manager::find(char const *name)
    5557{
    5658  for (property *i=first;i;i=i->next) 
     
    7173}
    7274
    73 int property_manager::get(char *name, int def)
     75int property_manager::get(char const *name, int def)
    7476{
    7577  property *f=find(name);
     
    8082
    8183
    82 char *property_manager::get(char *name,char *def)
     84char const *property_manager::get(char const *name,char const *def)
    8385{
    8486  property *f=find(name);
     
    8991
    9092
    91 void property_manager::set(char *name, double def)
     93void property_manager::set(char const *name, double def)
    9294{
    9395  property *f=find(name);
     
    102104}
    103105
    104 void property_manager::set(char *name, char *def)
     106void property_manager::set(char const *name, char const *def)
    105107{
    106108  property *f=find(name);
     
    116118
    117119
    118 FILE *open_FILE(char *filename, char *mode);
    119 
    120 void property_manager::save(char *filename)
     120void property_manager::save(char const *filename)
    121121{
    122122  FILE *fp=open_FILE(filename,"wb");
     
    138138
    139139
    140 void property_manager::load(char *filename)
     140void property_manager::load(char const *filename)
    141141{
    142142  char buf[100],*c1,*c2,name[100],str[100];
Note: See TracChangeset for help on using the changeset viewer.