Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Today, 9:00 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, Yandex, DotBot, Remcon

Members: 1
Guests: 18
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,237
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Calareymud loadarea crash
Forum Rules | Mark all | Recent Posts

Calareymud loadarea crash
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2, 3, 4, 5 ... next >>
Post is unread #1 Jul 31, 2013, 10:45 am   Last edited Jul 31, 2013, 10:49 am by mystickdreamer
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

My mud which is based off the calareyMud 3.0 codebase crashes when I try and load an area after a copyover or a mud shutdown

If anyone could help I would appreciate it here is the core gdb

GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.or
This is free software: you are free to change and redistr
There is NO WARRANTY, to the extent permitted by law.  Ty
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /mnt/store/homes/mystickdreamer/cm3/
[New LWP 27021]


warning: Could not load shared library symbols for linux-
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/home/mystickdreamer/cm3/src/rmexe
Program terminated with signal 6, Aborted.
#0  0x00007fa4a00e7715 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007fa4a00e7715 in raise () from /lib64/libc.so.6
#1  0x00007fa4a00e89af in abort () from /lib64/libc.so.6
#2  0x00007fa4a0126b47 in ?? () from /lib64/libc.so.6
#3  0x00007fa4a012c1d5 in ?? () from /lib64/libc.so.6
#4  0x00000000004bdcd5 in load_resetmsg (tarea=0xd0d600,
    at db.c:785
#5  0x00000000004c973e in load_area_file (tarea=0xd0d600,
    filename=0x7fffef048880 "../building/Admin.are" ) at d
#6  0x000000000049db35 in do_loadarea (ch=0xd0bc50, argum
    at build.c:8127
#7  0x000000000051240f in interpret (ch=0xd0bc50, argumen
    forced=0 '\000') at interp.c:447
#8  0x00000000004b2a4e in game_loop () at comm.c:681
#9  0x00000000004b1b7f in main (argc=2, argv=0x7fffef049c
(gdb) list
149
150     #ifdef WIN32
151     int mainthread( int argc, char **argv )
152     #else
153     int main( int argc, char **argv )
154     #endif
155     {
156        struct timeval now_time;
157        char hostn[128];
158        bool fCopyOver = FALSE;
(gdb) up
#1  0x00007fa4a00e89af in abort () from /lib64/libc.so.6
(gdb) list
159     #ifdef IMC
160        int imcsocket = -1;
161     #endif
162
163        /*
164         * Memory debugging if needed.
165         */
166     #if defined(MALLOC_DEBUG)
167        malloc_debug( 2 );
168     #endif
(gdb) up
#2  0x00007fa4a0126b47 in ?? () from /lib64/libc.so.6
(gdb) list
169
170        num_descriptors = 0;
171        first_descriptor = NULL;
172        last_descriptor = NULL;
173        sysdata.NO_NAME_RESOLVING = TRUE;
174
175        /*
176         * Init time.
177         */
178        gettimeofday( &now_time, NULL );
(gdb) up
#3  0x00007fa4a012c1d5 in ?? () from /lib64/libc.so.6
(gdb) list
179        current_time = ( time_t ) now_time.tv_sec;
180     /*  gettimeofday( &boot_time, NULL);   okay, so it's kludgy, sue me : ) */
181        boot_time = time( 0 );  /*  <-- I think this is what you wanted */
182        strcpy( str_boot_time, ctime( &current_time ) );
183
184        /*
185         * Init boot time.
186         */
187        set_boot_time = &set_boot_time_struct;
188        set_boot_time->manual = 0;
(gdb) up
#4  0x00000000004bdcd5 in load_resetmsg (tarea=0xd0d600, fp=0xd0f840)
    at db.c:785
785           DISPOSE( tarea->resetmsg );
(gdb) list
780           else
781              return;
782        }
783
784        if( tarea->resetmsg )
785           DISPOSE( tarea->resetmsg );
786        tarea->resetmsg = fread_string_nohash( fp );
787        return;
788     }
789
(gdb) up
#5  0x00000000004c973e in load_area_file (tarea=0xd0d600,
    filename=0x7fffef048880 "../building/Admin.are" ) at db.c:5387
5387             load_resetmsg( tarea, fpArea );
(gdb) list
5382          else if( !str_cmp( word, "RANGES" ) )
5383             load_ranges( tarea, fpArea );
5384          else if( !str_cmp( word, "ECONOMY" ) )
5385             load_economy( tarea, fpArea );
5386          else if( !str_cmp( word, "RESETMSG" ) )
5387             load_resetmsg( tarea, fpArea );
5388          /*
5389           * Rennard
5390           */
5391          else if( !str_cmp( word, "MOBILES" ) )
(gdb) up
#6  0x000000000049db35 in do_loadarea (ch=0xd0bc50, argument=0x7fffef049678 "" )
    at build.c:8127
8127       load_area_file( tarea, filename );
(gdb) list
8122          send_to_char( "Your area is already loaded.\n\r", ch );
8123          return;
8124       }
8125       sprintf( filename, "%s%s", BUILD_DIR, tarea->filename );
8126       send_to_char( "Loading...\n\r", ch );
8127       load_area_file( tarea, filename );
8128       send_to_char( "Linking exits...\n\r", ch );
8129       fix_area_exits( tarea );
8130       if( tarea->first_room )
8131       {
(gdb) up
#7  0x000000000051240f in interpret (ch=0xd0bc50, argument=0x7fffef049678 "",
    forced=0 '\000') at interp.c:447
447        ( *cmd->do_fun ) ( ch, argument );
(gdb) list
442         */
443
444        ch->prev_cmd = ch->last_cmd;  /* haus, for automapping */
445        ch->last_cmd = cmd->do_fun;
446        start_timer( &time_used );
447        ( *cmd->do_fun ) ( ch, argument );
448        end_timer( &time_used );
449
450        /*
451         * Command's done, send the outputsuffix if they want it -- Scion
(gdb) up
#8  0x00000000004b2a4e in game_loop () at comm.c:681
681                             interpret( d->character, cmdline, FALSE );
(gdb) list
676                             nanny( d, cmdline );
677                             break;
678                          case CON_PLAYING:
679                             if( d->character && !IS_NPC( d->character ) )
680                                d->character->pcdata->alias_used = 0;
681                             interpret( d->character, cmdline, FALSE );
682                             break;
683                          case CON_EDITING:
684                             edit_buffer( d->character, cmdline );
685                             break;
(gdb) up
#9  0x00000000004b1b7f in main (argc=2, argv=0x7fffef049c68) at comm.c:335
335        game_loop(  );
(gdb) list
330        {
331           log_string( "Running copyover_recover." );
332           copyover_recover(  );
333        }
334
335        game_loop(  );
336
337        /*
338         * Save the world's position -- Scion
339         */
(gdb) up
Initial frame selected; you cannot go up.
       
Post is unread #2 Jul 31, 2013, 10:57 am
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Looks like tarea->resetmsg is your problem. What's it trying to set it to?
       
Post is unread #3 Jul 31, 2013, 11:28 am
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

This is my first time working with smaug code. I was using circle before so a lot of this looks unfamiliar to me.

Here is the function in db.c


/* Reset Message Load, Rennard */
void load_resetmsg( AREA_DATA * tarea, FILE * fp )
{
   if( !tarea )
   {
      bug( "Load_resetmsg: no #AREA seen yet." );
      if( fBootDb )
      {
         shutdown_mud( "No #AREA" );
         exit( 1 );
      }
      else
         return;
   }

   if( tarea->resetmsg )
      DISPOSE( tarea->resetmsg );
   tarea->resetmsg = fread_string_nohash( fp );
   return;
}



Earlier in the code there is this:

void load_resetmsg args( ( AREA_DATA * tarea, FILE * fp ) );   /* Rennard */





and after rereading my earlier post I want to make sure my question is clear

The mud crashes when I use the loadarea command to load up an area I'm building on
       
Post is unread #4 Jul 31, 2013, 11:39 am
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Yes, but I meant what is the actual data being passed through this function and not what the code is.
       
Post is unread #5 Jul 31, 2013, 12:09 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

Well here is what I have done

I rassign admin vnums 1000 1100

I go and make a room then savearea

then to test the loadarea command I either shutdown the mud or do a copyover which then says in my score AreaLoaded: no

so I type loadarea and it crashes




I'm not sure what the actual data being passed through the function is

If you wouldn't mind helping me find that out I would appreciate it
       
Post is unread #6 Jul 31, 2013, 12:56 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,863
JoinedJul 26, 2005

while you are here
(gdb) up
#4  0x00000000004bdcd5 in load_resetmsg (tarea=0xd0d600, fp=0xd0f840)
    at db.c:785
785           DISPOSE( tarea->resetmsg );
(gdb) list
780           else
781              return;
782        }
783
784        if( tarea->resetmsg )
785           DISPOSE( tarea->resetmsg );
786        tarea->resetmsg = fread_string_nohash( fp );
787        return;
788     }
789

you should try print tarea->resetmsg and print tarea
       
Post is unread #7 Jul 31, 2013, 1:25 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

when I put in the two prints


(gdb) print tarea->resetmsg
$1 = 0x1a55b00 "Void"
(gdb) print tarea
$2 = (AREA_DATA *) 0x1a77800
(gdb)
       
Post is unread #8 Jul 31, 2013, 1:47 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

My question is... what's calling abort?
       
Post is unread #9 Jul 31, 2013, 4:35 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,863
JoinedJul 26, 2005

Ok, downloaded a copy of Calareymud and the issue is going to be the fact that in assign_area in build.c it uses
          tarea->resetmsg = STRALLOC( "Void" );

change that to
          tarea->resetmsg = str_dup( "Void" );

       
Post is unread #10 Jul 31, 2013, 7:52 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

You are absolutely amazing.

Thank you so much.
       
Post is unread #11 Jul 31, 2013, 7:56 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,863
JoinedJul 26, 2005

Glad it helped :) You're welcome.
       
Post is unread #12 Aug 1, 2013, 6:52 am
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

Although now the savearea command doesnt seem to actually save the area

no crashes,

and if I create a few rooms then install the area in the zones it says the area has 0-0 rooms even if I created 10 or more rooms

Where shojld I start looking for that issue?

       
Post is unread #13 Aug 1, 2013, 2:54 pm   Last edited Aug 1, 2013, 2:55 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,863
JoinedJul 26, 2005

look in the building directory for the file, if the file is there then try making a new mobile/room/object in the vnums (with the area loaded) and save the area and check to see if it saved the new stuff. If it did save the new stuff, reboot/etc... and then load the area and see if you can see the new stuff using rlist/olist/mlist.
       
Post is unread #14 Aug 1, 2013, 4:50 pm   Last edited Aug 1, 2013, 4:53 pm by mystickdreamer
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

Ok so apparently I did something else wrong, so I started with a fresh copy and just made your change, and that made it to where I can save the rooms, but the mobiles or objects aren't saving.

Opening the area file they are not saving in the area file either.



Oh and as a side note the rlist works when the area is loaded, but olist or mlist does not.
       
Post is unread #15 Aug 1, 2013, 4:55 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,863
JoinedJul 26, 2005

mind doing a full list of the area vnums and what all you are doing? as well as wjat all ends up in the file.
       
Post is unread #16 Aug 1, 2013, 5:22 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

ok so I forgot to assign myself the vnums for the objects and mobiles so of course they disappeared

so after assigning myself the vnums the objects do save into the mlist and olist, but they don't actually save in the room when I load my area back after doing a copyover




here is the build area file

#AREA   {PROTO} Admin's area in progress~



#VERSION 1
#AUTHOR Admin~

#RANGES
0 0 0 0
$

#RESETMSG Void~

#FLAGS
0

#ECONOMY 0 0

#CLIMATE 2 2 2 0

#MOBILES
#10001
Janitor~
a newly created Janitor~
~
3 0 0 S
0 0 0 0d0+0 0d0+0
0 0
112 100 0
#0


#OBJECTS
#10000
Object~
a TEST object~
Some god dropped a newly created Object here.~
~
13 0 0
0
0 0 0 0
1 0 0
#0


#ROOMS
#10000
Solis' Info~
~
0 1073741824 1
0 0 0 0 0 0 0 0
S
#10001
Solis' Gate~
~
0 1073741824 1
0 0 0 0 0 0 0 0
S
#0


#SHOPS
0


#SPECIALS
S


#$




Am I just doing something wrong to make sure they stay in the room they are put in?
       
Post is unread #17 Aug 1, 2013, 5:44 pm   Last edited Aug 1, 2013, 5:45 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,863
JoinedJul 26, 2005

well to get them to stay in the room, you need to use the instaroom command. yea i just got through getting it running to test and had no issue aside from the loadarea crash haha so fixed that so i could test it out. That code so needs updated though to make it work with less warnings now days.
       
Post is unread #18 Aug 1, 2013, 5:57 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

Ah I knew I had to be doing something wrong for the objects and mobiles not to stay and I thought of the instaroom, but I wasn't sure


Unfortunately I don't think I'm good enough to update the code to get rid of the warnings.


I'm not sure if you had time to update it, but if you decide to let me know I would love to have it updated.

I'm not sure if that would constitute enough of a change to be able put it here, I saw that somebody said Ntanel only wanted it to be downloaded from his website. I actually went there first, but could not find any support.

So I definitely thank you for all of your help.



I'm hoping to port over the OasisOLC eventually into it.

       
Post is unread #19 Aug 2, 2013, 10:39 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,863
JoinedJul 26, 2005

well i seen a copy of it on mudbytes but it was corrupt so i ended up getting it from his site. We can't release it in any way without his permission. As for the warnings if I get around to it I'll fix them and put how to fix them on here for you (granted it will likely be just how to fix them based on what they are). Glad to help out when I have the time and can.
       
Post is unread #20 Aug 2, 2013, 1:06 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,863
JoinedJul 26, 2005

i3.c
-----------------
i3.c: In function ‘I3_chanlist’:
i3.c:6912:45: warning: the address of ‘filter’ will always evaluate as ‘true’

find
      if( !all && !channel->local_name && ( !filter || filter[0] == '\0' ) )

change it to
      if( !all && !channel->local_name && ( filter == NULL || filter[0] == '\0' ) )


i3.c: In function ‘I3_chanlist’:
i3.c:6921:16: warning: the address of ‘filter’ will always evaluate as ‘true’

find
      if( !all && filter && filter[0] != '\0' && i3str_prefix( filter, channel->I3_name )
          && i3str_prefix( filter, channel->host_mud ) )
         continue;

change it to
      if( !all && filter != NULL && filter[0] != '\0' && i3str_prefix( filter, channel->I3_name )
          && i3str_prefix( filter, channel->host_mud ) )
         continue;


i3.c: In function ‘I3_setup_channel’:
i3.c:6961:8: warning: the address of ‘localname’ will always evaluate as ‘true’

find
   if( !localname || localname[0] == '\0' )

change it to
   if( localname == NULL || localname[0] == '\0' )


i3.c: In function ‘I3_chan_who’:
i3.c:7109:8: warning: the address of ‘channel_name’ will always evaluate as ‘true’

find
   if( !channel_name || channel_name[0] == '\0' || !argument || argument[0] == '\0' )

change it to
   if( channel_name == NULL || channel_name[0] == '\0' || !argument || argument[0] == '\0' )


i3.c: In function ‘I3_deny_channel’:
i3.c:7207:8: warning: the address of ‘vic_name’ will always evaluate as ‘true’

find
   if( !vic_name || vic_name[0] == '\0' || !argument || argument[0] == '\0' )

change it to
   if( vic_name == NULL || vic_name[0] == '\0' || !argument || argument[0] == '\0' )


i3.c: In function ‘I3_chanlayout’:
i3.c:7385:8: warning: the address of ‘arg1’ will always evaluate as ‘true’
i3.c:7390:8: warning: the address of ‘arg2’ will always evaluate as ‘true’

find
   if( !arg1 || arg1[0] == '\0' )
   {
      I3_chanlayout( ch, "" );
      return;
   }
   if( !arg2 || arg2[0] == '\0' )
   {
      I3_chanlayout( ch, "" );
      return;
   }

change it to
   if( arg1 == NULL || arg1[0] == '\0' )
   {
      I3_chanlayout( ch, "" );
      return;
   }
   if( arg2 == NULL || arg2[0] == '\0' )
   {
      I3_chanlayout( ch, "" );
      return;
   }


i3.c: In function ‘I3_admin_channel’:
i3.c:7622:8: warning: the address of ‘arg1’ will always evaluate as ‘true’
i3.c:7634:8: warning: the address of ‘arg2’ will always evaluate as ‘true’

find
   if( !arg1 || arg1[0] == '\0' )
   {
      I3_admin_channel( ch, "" );
      return;
   }

   if( !( channel = find_I3_channel_by_localname( arg1 ) ) )
   {
      i3_to_char( "No such channel with that name here.\n\r", ch );
      return;
   }

   if( !arg2 || arg2[0] == '\0' )
   {
      I3_admin_channel( ch, "" );
      return;
   }

change it to
   if( arg1 == NULL || arg1[0] == '\0' )
   {
      I3_admin_channel( ch, "" );
      return;
   }

   if( !( channel = find_I3_channel_by_localname( arg1 ) ) )
   {
      i3_to_char( "No such channel with that name here.\n\r", ch );
      return;
   }

   if( arg2 == NULL || arg2[0] == '\0' )
   {
      I3_admin_channel( ch, "" );
      return;
   }


i3.c: In function ‘I3_addchan’:
i3.c:7728:44: warning: the address of ‘arg’ will always evaluate as ‘true’
i3.c:7728:70: warning: the address of ‘arg2’ will always evaluate as ‘true’

find
   if( !argument || argument[0] == '\0' || !arg || arg[0] == '\0' || !arg2 || arg2[0] == '\0' )

change it to
   if( !argument || argument[0] == '\0' || arg == NULL || arg[0] == '\0' || arg2 == NULL || arg2[0] == '\0' )


i3.c: In function ‘I3_setconfig’:
i3.c:7835:8: warning: the address of ‘arg’ will always evaluate as ‘true’

find
   if( !arg || arg[0] == '\0' )

change it to
   if( arg == NULL || arg[0] == '\0' )


i3.c: In function ‘I3_permset’:
i3.c:8052:8: warning: the address of ‘arg’ will always evaluate as ‘true’

find
   if( !arg || arg[0] == '\0' )

change it to
   if( arg == NULL || arg[0] == '\0' )


i3.c: In function ‘I3_router’:
i3.c:8351:11: warning: the address of ‘rtname’ will always evaluate as ‘true’
i3.c:8351:43: warning: the address of ‘rtip’ will always evaluate as ‘true’

find
      if( !rtname || rtname[0] == '\0' || !rtip || rtip[0] == '\0' || !argument || argument[0] == '\0' )

change it to
      if( rtname == NULL || rtname[0] == '\0' || rtip == NULL || rtip[0] == '\0' || !argument || argument[0] == '\0' )


i3.c: In function ‘i3_hedit’:
i3.c:8478:8: warning: the address of ‘name’ will always evaluate as ‘true’
i3.c:8478:36: warning: the address of ‘cmd’ will always evaluate as ‘true’

find
   if( !name || name[0] == '\0' || !cmd || cmd[0] == '\0' || !argument || argument[0] == '\0' )

change it to
   if( name == NULL || name[0] == '\0' || cmd == NULL || cmd[0] == '\0' || !argument || argument[0] == '\0' )


i3.c: In function ‘i3_cedit’:
i3.c:8594:8: warning: the address of ‘name’ will always evaluate as ‘true’
i3.c:8594:36: warning: the address of ‘option’ will always evaluate as ‘true’

find
   if( !name || name[0] == '\0' || !option || option[0] == '\0' )

change it to
   if( name == NULL || name[0] == '\0' || option == NULL || option[0] == '\0' )


i3.c: In function ‘I3_send_social’:
i3.c:9112:8: warning: the address of ‘socbuf_o’ will always evaluate as ‘true’
i3.c:9115:10: warning: the address of ‘socbuf_o’ will always evaluate as ‘true’
i3.c:9115:49: warning: the address of ‘socbuf_t’ will always evaluate as ‘true’

find
   if( socbuf_o && socbuf_o[0] != '\0' )
      snprintf( socbuf_t, LGST, "%s", I3_find_social( ch, arg1, person, mud, TRUE ) );

   if( ( socbuf_o && socbuf_o[0] != '\0' ) && ( socbuf_t && socbuf_t[0] != '\0' ) )

change it to
   if( socbuf_o != NULL && socbuf_o[0] != '\0' )
      snprintf( socbuf_t, LGST, "%s", I3_find_social( ch, arg1, person, mud, TRUE ) );

   if( ( socbuf_o != NULL && socbuf_o[0] != '\0' ) && ( socbuf_t != NULL && socbuf_t[0] != '\0' ) )


Thats all the warnings for i3.c that have to do with always evaluate as 'true' or 'false' and similar ones in other files will be handled in similar ways.

i3.c: In function ‘I3_getarg’:
i3.c:570:4: warning: array subscript has type ‘char’
i3.c:574:7: warning: array subscript has type ‘char’
i3.c:577:7: warning: array subscript has type ‘char’
i3.c:580:4: warning: array subscript has type ‘char’
i3.c:583:4: warning: array subscript has type ‘char’

find
   while( *argument && isspace( *argument ) )
      argument++;

   if( arg )
      while( *argument && !isspace( *argument ) && len < length - 1 )
         *arg++ = *argument++, len++;
   else
      while( *argument && !isspace( *argument ) )
         argument++;

   while( *argument && !isspace( *argument ) )
      argument++;

   while( *argument && isspace( *argument ) )
      argument++;

change it to
   while( *argument && isspace( (int)*argument ) )
      argument++;

   if( arg )
      while( *argument && !isspace( (int)*argument ) && len < length - 1 )
         *arg++ = *argument++, len++;
   else
      while( *argument && !isspace( (int)*argument ) )
         argument++;

   while( *argument && !isspace( (int)*argument ) )
      argument++;

   while( *argument && isspace( (int)*argument ) )
      argument++;


i3.c: In function ‘i3capitalize’:
i3.c:659:7: warning: array subscript has type ‘char’
i3.c:661:4: warning: array subscript has type ‘char’

find
   for( i = 0; str[i] != '\0'; i++ )
      strcap[i] = tolower( str[i] );
   strcap[i] = '\0';
   strcap[0] = toupper( strcap[0] );

change it to
   for( i = 0; str[i] != '\0'; i++ )
      strcap[i] = tolower( (int)str[i] );
   strcap[i] = '\0';
   strcap[0] = toupper( (int)strcap[0] );


i3.c: In function ‘i3exists_player’:
i3.c:684:4: warning: array subscript has type ‘char’

find
   snprintf( buf, 256, "%s%c/%s", PLAYER_DIR, tolower( name[0] ), i3capitalize( name ) );

change it to
   snprintf( buf, 256, "%s%c/%s", PLAYER_DIR, tolower( (int)name[0] ), i3capitalize( name ) );


i3.c: In function ‘i3fread_number’:
i3.c:1068:4: warning: array subscript has type ‘char’

find
   while( isspace( c ) );

change it to
   while( isspace( (int)c ) );


i3.c: In function ‘i3fread_number’:
i3.c:1083:4: warning: array subscript has type ‘char’

find
   if( !isdigit( c ) )

change it to
   if( !isdigit( (int)c ) )


i3.c: In function ‘i3fread_number’:
i3.c:1089:4: warning: array subscript has type ‘char’

find
   while( isdigit( c ) )

change it to
   while( isdigit( (int)c ) )


i3.c: In function ‘i3fread_line’:
i3.c:1139:4: warning: array subscript has type ‘char’

find
   while( isspace( c ) );

change it to
   while( isspace( (int)c ) );


i3.c: In function ‘i3fread_word’:
i3.c:1199:4: warning: array subscript has type ‘char’

find
   while( isspace( cEnd ) );

change it to
   while( isspace( (int)cEnd ) );


i3.c: In function ‘i3fread_word’:
i3.c:1221:7: warning: array subscript has type ‘char’

find
      if( cEnd == ' ' ? isspace( *pword ) : *pword == cEnd )

change it to
      if( cEnd == ' ' ? isspace( (int)*pword ) : *pword == cEnd )


i3.c: In function ‘i3fread_letter’:
i3.c:1250:4: warning: array subscript has type ‘char’

find
   while( isspace( c ) );

change it to
   while( isspace( (int)c ) );


i3.c: In function ‘I3_addchan’:
i3.c:7753:4: warning: array subscript has type ‘char’

find
   if( !isdigit( argument[0] ) )

change it to
   if( !isdigit( (int)argument[0] ) )


i3.c: In function ‘I3_find_social’:
i3.c:8815:4: warning: array subscript has type ‘char’

find
   for( c = sname; *c; *c = tolower( *c ), c++ );

change it to
   for( c = sname; *c; *c = tolower( (int)*c ), c++ );


i3.c: In function ‘i3act_string’:
i3.c:8951:7: warning: array subscript has type ‘char’

find
      else if( should_upper == TRUE && !isspace( *format ) && *format != '$' )

change it to
      else if( should_upper == TRUE && !isspace( (int)*format ) && *format != '$' )


i3.c: In function ‘I3_send_social’:
i3.c:9147:10: warning: array subscript has type ‘char’

find
         buf[0] = tolower( buf[0] );

change it to
         buf[0] = tolower( (int)buf[0] );


i3.c: In function ‘I3_command_hook’:
i3.c:9469:10: warning: array subscript has type ‘char’

find
         while( isspace( *argument ) )

change it to
         while( isspace( (int)*argument ) )

i3.c: In function ‘I3_command_hook’:
i3.c:9478:10: warning: array subscript has type ‘char’

find
         while( isspace( *argument ) )

change it to
         while( isspace( (int)*argument ) )


All those were similar in setup and issue and was just adding (int) to them. All this gave me a clean compile on i3.c.
       
Pages:<< prev 1, 2, 3, 4, 5 ... next >>