MIL undeclared?

Posted by Zeno on Sun 09 May 2004 08:39 PM — 8 posts, 29,479 views.

USA #0
After replacing color.c and color.h (see http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4134&page=999999 ) I went to do a clean recompile, and got this odd errors.



gcc -c  -O -g2 -Wall     -DI3 -DI3SMAUG act_wiz.c
act_wiz.c: In function `do_setclass':
act_wiz.c:7545: `MIL' undeclared (first use in this function)
act_wiz.c:7545: (Each undeclared identifier is reported only once
act_wiz.c:7545: for each function it appears in.)
act_wiz.c:7545: warning: unused variable `arg1'
act_wiz.c:7545: warning: unused variable `arg2'
act_wiz.c: In function `do_setrace':
act_wiz.c:7945: `MSL' undeclared (first use in this function)
act_wiz.c:7945: `MIL' undeclared (first use in this function)
act_wiz.c:7945: warning: unused variable `buf'
act_wiz.c:7945: warning: unused variable `arg1'
act_wiz.c:7945: warning: unused variable `arg2'
act_wiz.c:7945: warning: unused variable `arg3'
make[1]: *** [act_wiz.o] Error 1


I never touched do_setclass at all. Here's some lines.

void do_setclass( CHAR_DATA *ch, char *argument )
{
  char arg1[MIL], arg2[MIL];
  FILE *fpList;
  char classlist[256];
  struct class_type *class;
  int cl, value, i;


Also those unused variables were never there before... I don't see why act_wiz.c just suddenly does this... Any idea why? And is that part of the code stock code?
USA #1
Sounds like you didnt close the brackets in the function above do_setclass properly.
USA #2

bool create_new_class( int index, char *argument )
{
  int i;

  if ( index >= MAX_CLASS || class_table[index] == NULL )
        return FALSE;
  if ( class_table[index]->who_name )
        STRFREE( class_table[index]->who_name );
  if ( argument[0] != '\0' )
        argument[0] = UPPER(argument[0]);
  class_table[index]->who_name = STRALLOC( argument );
  xCLEAR_BITS( class_table[index]->affected );
  class_table[index]->attr_prime = 0;
  class_table[index]->attr_second = 0;
  class_table[index]->attr_deficient = 0;
  class_table[index]->resist = 0;
  class_table[index]->suscept = 0;
  class_table[index]->weapon = 0;
  class_table[index]->guild = 0;
  class_table[index]->skill_adept = 0;
  class_table[index]->thac0_00 = 0;
  class_table[index]->thac0_32 = 0;
  class_table[index]->hp_min = 0;
  class_table[index]->hp_max = 0;
  class_table[index]->fMana = FALSE;
  class_table[index]->exp_base = 0;
  for ( i=0; i< MAX_LEVEL;i++ )
  {
        title_table[index][0] = str_dup( "Not set." );
        title_table[index][1] = str_dup( "Not set." );
  }
  return TRUE;
}

/*
* Edit class information     -Thoric
*/
void do_setclass( CHAR_DATA *ch, char *argument )
{


Looks fine to me. (Stupid forum code)
Amended on Sun 09 May 2004 08:57 PM by Zeno
USA #3
BAsically you have an older copy of the FUSS code. The bug you've got was later fixed by the updated do_setclass and do_setrace fixes. You need to replace the entirety of both functions to fix that.
USA #4
Alright. But why get the errors now? color.c and color.h had something to do with it?
Australia Forum Administrator #5
Quote:

Looks fine to me. (Stupid forum code)


If you look at the actual text you have [i] in it, which means italics. Use the MUSHclient notepad "quote forum codes" function, or if you don't want to do that, use an editor to change:


\ to \\
[ to \[
] to \]
USA #6
Ah, I didn't even know MUSHclient had that.
USA #7
Zeno, yes. color.h had a holdover definition of MIL I had forgotten about and when it finally got removed it revealed the fix for the act_wiz.c stuff was relying on it. That and a couple of other things I've now forgotten about had the same issue. The FUSS packages on the download site here shouldn't have that problem.