Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 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
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
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
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Bing, DotBot, Google, Sogou

Members: 0
Guests: 3
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SWR FUSS Bugfix List » [Bug] Compile failure on 64-b...
Forum Rules | Mark all | Recent Posts

[Bug] Compile failure on 64-bit systems
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 9, 2005, 11:44 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Compile failure on 64-bit systems
Danger: Fatal - Compile aborts with error
Found by: Elshar
Fixed by: Samson

---

fight.c, violence_update

Locate:
      /*
       * See if we got a pointer to some bad looking data...
       */
      if( !ch->in_room || !ch->name )
      {
         log_string( "violence_update: bad ch record!  (Shortcutting.)" );
         sprintf( buf, "ch: %d  ch->in_room: %d  ch->prev: %d  ch->next: %d",
                  ( int )ch, ( int )ch->in_room, ( int )ch->prev, ( int )ch->next );
         log_string( buf );
         log_string( lastplayercmd );
         if( lst_ch )
            sprintf( buf, "lst_ch: %d  lst_ch->prev: %d  lst_ch->next: %d",
                     ( int )lst_ch, ( int )lst_ch->prev, ( int )lst_ch->next );
         else
            strcpy( buf, "lst_ch: NULL" );
         log_string( buf );
         gch_prev = NULL;
         continue;
      }


Change to:
      /*
       * See if we got a pointer to some bad looking data...
       */
      if( !ch->in_room || !ch->name )
      {
         log_string( "violence_update: bad ch record!  (Shortcutting.)" );
         sprintf( buf, "ch: %ld  ch->in_room: %ld  ch->prev: %ld  ch->next: %ld",
                  ( long )ch, ( long )ch->in_room, ( long )ch->prev, ( long )ch->next );
         log_string( buf );
         log_string( lastplayercmd );
         if( lst_ch )
            sprintf( buf, "lst_ch: %ld  lst_ch->prev: %ld  lst_ch->next: %ld",
                     ( long )lst_ch, ( long )lst_ch->prev, ( long )lst_ch->next );
         else
            strcpy( buf, "lst_ch: NULL" );
         log_string( buf );
         gch_prev = NULL;
         continue;
      }


hashstr.c, hash_dump

Locate:
   for( c = 0, ptr = string_hash[hash]; ptr; ptr = ptr->next, c++ )
   {
      str = ( char * )( ( ( int )ptr ) + psize );
      fprintf( stderr, "Len:%4d Lnks:%5d Str: %s\n\r", ptr->length, ptr->links, str );
   }


Change to:
   for( c = 0, ptr = string_hash[hash]; ptr; ptr = ptr->next, c++ )
   {
      str = ( char * )( ( ( long )ptr ) + psize );
      fprintf( stderr, "Len:%4d Lnks:%5d Str: %s\n\r", ptr->length, ptr->links, str );
   }


show_high_hash

Locate:
         if( ptr->links >= top )
         {
            str = ( char * )( ( ( int )ptr ) + psize );
            fprintf( stderr, "Links: %5d  String: >%s<\n\r", ptr->links, str );
         }


Change to:
         if( ptr->links >= top )
         {
            str = ( char * )( ( ( long )ptr ) + psize );
            fprintf( stderr, "Links: %5d  String: >%s<\n\r", ptr->links, str );
         }


This error occurs because the size type for memory addresses is marked as a long integer. On 32-bit systems this is usually the same size as a regular integer because of architecture restrictions. On 64-bit systems these restrictions are much larger so a long integer can have a much higher maximum value and this causes the cast to return unexpected results. Fixing this on a 32-bit system will not affect the outcome, so it's safe to go ahead and add now.
       
Pages:<< prev 1 next >>