Difference for common/arch.c from version 1.29 to 1.30


version 1.29 version 1.30
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_arch_c =   * static char *rcsid_arch_c =
  *   "$Id: arch.c,v 1.29 2003/10/27 07:24:13 mwedel Exp $";   *   "$Id: arch.c,v 1.30 2005/05/03 18:31:04 ryo_saeba Exp $";
  */   */
   
 /*  /*
Line 58
 
Line 58
  * Return value:   * Return value:
  * - the archetype found or null if nothing was found.   * - the archetype found or null if nothing was found.
  */   */
 archetype *find_archetype_by_object_name(char *name) {  archetype *find_archetype_by_object_name(const char *name) {
     archetype *at;      archetype *at;
   
     if (name == NULL)      if (name == NULL)
Line 76
 
Line 76
  * against (eg, to only match against skills or only skill objects for example).   * against (eg, to only match against skills or only skill objects for example).
  * If type is -1, ew don't match on type.   * If type is -1, ew don't match on type.
  */   */
 object *get_archetype_by_skill_name(char *skill, int type) {  object *get_archetype_by_skill_name(const char *skill, int type) {
     archetype *at;      archetype *at;
   
     if (skill == NULL)      if (skill == NULL)
Line 120
 
Line 120
  * doesn't malloc it each time - not that this function is used much,   * doesn't malloc it each time - not that this function is used much,
  * but it otherwise had a big memory leak.   * but it otherwise had a big memory leak.
  */   */
 object *get_archetype_by_object_name(char *name) {  object *get_archetype_by_object_name(const char *name) {
     archetype *at;      archetype *at;
     char tmpname[MAX_BUF];      char tmpname[MAX_BUF];
     int i;      int i;
Line 139
 
Line 139
 }  }
   
  /* GROS - find_best_weapon_used_match and item_matched_string moved there */   /* GROS - find_best_weapon_used_match and item_matched_string moved there */
  object *find_best_weapon_used_match(object *pl, char *params)  object *find_best_weapon_used_match(object *pl, const char *params)
  {   {
    object *tmp, *best=NULL;     object *tmp, *best=NULL;
    int match_val=0,tmpmatch;     int match_val=0,tmpmatch;
Line 175
 
Line 175
   * IF count is >1, we need to make plural name.  Return if match.    * IF count is >1, we need to make plural name.  Return if match.
   * Last, make a check on the full name.    * Last, make a check on the full name.
   */    */
 int item_matched_string(object *pl, object *op, char *name)  int item_matched_string(object *pl, object *op, const char *name)
 {  {
     char *cp, local_name[MAX_BUF];      char *cp, local_name[MAX_BUF];
     int count,retval=0;      int count,retval=0;
Line 583
 
Line 583
  * an object, and never NULL.   * an object, and never NULL.
  */   */
   
 object *create_singularity(char *name) {  object *create_singularity(const char *name) {
   object *op;    object *op;
   char buf[MAX_BUF];    char buf[MAX_BUF];
   sprintf(buf,"singluarity (%s)",name);    sprintf(buf,"singluarity (%s)",name);
Line 599
 
Line 599
  * object containing a copy of the archetype.   * object containing a copy of the archetype.
  */   */
   
 object *get_archetype(char *name) {  object *get_archetype(const char *name) {
   archetype *at;    archetype *at;
   at = find_archetype(name);    at = find_archetype(name);
   if (at == NULL)    if (at == NULL)
Line 612
 
Line 612
  */   */
   
 unsigned long  unsigned long
 hasharch(char *str, int tablesize) {  hasharch(const char *str, int tablesize) {
     unsigned long hash = 0;      unsigned long hash = 0;
     int i = 0, rot = 0;      int i = 0, rot = 0;
     char *p;      const char *p;
   
     for (p = str; i < MAXSTRING && *p; p++, i++) {      for (p = str; i < MAXSTRING && *p; p++, i++) {
         hash ^= (unsigned long) *p << rot;          hash ^= (unsigned long) *p << rot;
Line 631
 
Line 631
  * returns a pointer to the found archetype, otherwise NULL.   * returns a pointer to the found archetype, otherwise NULL.
  */   */
   
 archetype *find_archetype(char *name) {  archetype *find_archetype(const char *name) {
   archetype *at;    archetype *at;
   unsigned long index;    unsigned long index;
   


Legend:
line(s) removed in v.1.29 
line(s) changed
 line(s) added in v.1.30

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:05