Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, DotBot, Google

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
Vintar (28)
Related Links
» SmaugMuds.org » Bugfix Lists » AFKMud Bugfix List » AFKMud Bug Archive » [Bug] Compile failure on 64-b...
Forum Rules | Mark all | Recent Posts

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

Pages:<< prev 1 next >>
Post is unread #1 Oct 9, 2005, 1:06 pm   Last edited Oct 29, 2005, 3:18 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Bug: Compile failure on 64-bit systems
Discovered in: AFKMud 1.76a
Danger: Fatal - Compile aborts with error
Found by: Elshar
Fixed by: Samson

---

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 );
         }


update.c, spell_update

Locate:
      if( !ch->in_room || !ch->name )
      {
         log_string( "spell_update: bad ch record!  (Shortcutting.)" );
         log_printf( "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( lastplayercmd );
         if( lst_ch )
            log_printf( "lst_ch: %d  lst_ch->prev: %d  lst_ch->next: %d",
                        ( int )lst_ch, ( int )lst_ch->prev, ( int )lst_ch->next );
         else
            log_string( "lst_ch: NULL" );
         gch_prev = NULL;
         continue;
      }


Change to:
      if( !ch->in_room || !ch->name )
      {
         log_string( "spell_update: bad ch record!  (Shortcutting.)" );
         log_printf( "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( lastplayercmd );
         if( lst_ch )
            log_printf( "lst_ch: %ld  lst_ch->prev: %ld  lst_ch->next: %ld",
                        ( long )lst_ch, ( long )lst_ch->prev, ( long )lst_ch->next );
         else
            log_string( "lst_ch: NULL" );
         gch_prev = NULL;
         continue;
      }


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 >>