Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Yandex

Members: 0
Guests: 20
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SmaugFUSS Bugfix List » [Bug] QUICKMATCH macro no lon...
Forum Rules | Mark all | Recent Posts

[Bug] QUICKMATCH macro no longer works as desired in GCC4
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 May 7, 2005, 12:42 am   Last edited May 11, 2005, 4:23 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: QUICKMATCH macro no longer works as desired in GCC4
Danger: Fatal for GCC4 users - compile will fail. None for GCC 3 users.
Found by: Zhamel
Fixed by: Samson

---

hotboot.c, save_mobile

Locate:
   if( QUICKMATCH( mob->name, mob->pIndexData->player_name ) == 0 )
      fprintf( fp, "Name     %s~\n", mob->name );
   if( QUICKMATCH( mob->short_descr, mob->pIndexData->short_descr ) == 0 )
      fprintf( fp, "Short	%s~\n", mob->short_descr );
   if( QUICKMATCH( mob->long_descr, mob->pIndexData->long_descr ) == 0 )
      fprintf( fp, "Long	%s~\n", mob->long_descr );
   if( QUICKMATCH( mob->description, mob->pIndexData->description ) == 0 )
      fprintf( fp, "Description %s~\n", mob->description );


Replace with:
   if( mob->name && mob->pIndexData->player_name && str_cmp( mob->name, mob->pIndexData->player_name ) )
      fprintf( fp, "Name     %s~\n", mob->name );
   if( mob->short_descr && mob->pIndexData->short_descr && str_cmp( mob->short_descr, mob->pIndexData->short_descr ) )
      fprintf( fp, "Short	%s~\n", mob->short_descr );
   if( mob->long_descr && mob->pIndexData->long_descr && str_cmp( mob->long_descr, mob->pIndexData->long_descr ) )
      fprintf( fp, "Long	%s~\n", mob->long_descr );
   if( mob->description && mob->pIndexData->description && str_cmp( mob->description, mob->pIndexData->description ) )
      fprintf( fp, "Description %s~\n", mob->description );


save.c, fwrite_obj

Locate:
   if( QUICKMATCH( obj->name, obj->pIndexData->name ) == 0 )
      fprintf( fp, "Name         %s~\n", obj->name );
   if( QUICKMATCH( obj->short_descr, obj->pIndexData->short_descr ) == 0 )
      fprintf( fp, "ShortDescr   %s~\n", obj->short_descr );
   if( QUICKMATCH( obj->description, obj->pIndexData->description ) == 0 )
      fprintf( fp, "Description  %s~\n", obj->description );
   if( QUICKMATCH( obj->action_desc, obj->pIndexData->action_desc ) == 0 )
      fprintf( fp, "ActionDesc   %s~\n", obj->action_desc );


Replace with:
   if( obj->name && obj->pIndexData->name && str_cmp( obj->name, obj->pIndexData->name ) )
      fprintf( fp, "Name         %s~\n", obj->name );
   if( obj->short_descr && obj->pIndexData->short_descr && str_cmp( obj->short_descr, obj->pIndexData->short_descr ) )
      fprintf( fp, "ShortDescr   %s~\n", obj->short_descr );
   if( obj->description && obj->pIndexData->description && str_cmp( obj->description, obj->pIndexData->description ) )
      fprintf( fp, "Description  %s~\n", obj->description );
   if( obj->action_desc && obj->pIndexData->action_desc && str_cmp( obj->action_desc, obj->pIndexData->action_desc ) )
      fprintf( fp, "ActionDesc   %s~\n", obj->action_desc );


fwrite_mobile

Locate:
   if( QUICKMATCH( mob->name, mob->pIndexData->player_name ) == 0 )
      fprintf( fp, "Name     %s~\n", mob->name );
   if( QUICKMATCH( mob->short_descr, mob->pIndexData->short_descr ) == 0 )
      fprintf( fp, "Short	%s~\n", mob->short_descr );
   if( QUICKMATCH( mob->long_descr, mob->pIndexData->long_descr ) == 0 )
      fprintf( fp, "Long	%s~\n", mob->long_descr );
   if( QUICKMATCH( mob->description, mob->pIndexData->description ) == 0 )
      fprintf( fp, "Description %s~\n", mob->description );


Replace with:
   if( mob->name && mob->pIndexData->player_name && str_cmp( mob->name, mob->pIndexData->player_name ) )
      fprintf( fp, "Name     %s~\n", mob->name );
   if( mob->short_descr && mob->pIndexData->short_descr && str_cmp( mob->short_descr, mob->pIndexData->short_descr ) )
      fprintf( fp, "Short	%s~\n", mob->short_descr );
   if( mob->long_descr && mob->pIndexData->long_descr && str_cmp( mob->long_descr, mob->pIndexData->long_descr ) )
      fprintf( fp, "Long	%s~\n", mob->long_descr );
   if( mob->description && mob->pIndexData->description && str_cmp( mob->description, mob->pIndexData->description ) )
      fprintf( fp, "Description %s~\n", mob->description );


Changes in the GCC compiler version 4 have rendered the QUICKMATCH macro useless in the situation above where the results are compared to 0. The strings were being checked to see if they do not match and so the best course of action to maintain consistency was to simply switch to calling str_cmp instead which will produce identical results.
       
Pages:<< prev 1 next >>