Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
AFKMud 2.2.2
Mar 3, 2019 5:35 pm
By Samson
Development
Nov 28, 2018 12:10 pm
By Keirath
First Immortal
Oct 12, 2018 2:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018 7:31 pm
By joeyfogas
question on overland code
May 31, 2018 12:03 pm
By joeyfogas
SmaugFUSS 1.9.3
Author: Various
Submitted by: Samson
AFKMud 2.2.2
Author: AFKMud Team
Submitted by: Samson
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Remcon, Google

Members: 1
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
483
3,743
19,401
655
RodrickMci
Today's Birthdays
tphegley (37)
Related Links
» SmaugMuds » Bugfix Lists » SWFOTE 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 1:46 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,647
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 >>