Having a few problems that I humbly submit to the list.

Reference:  On my private project, I decided to ditch the aff2 setup and switch
over to the Unlimited Bit System provided by Danan (Ammaross?)--Ammaross Danan's
Unlimited Bit Snippet v1.1 for Rom24.  I completely removed aff2 from my code;
it's as if it never existed. Maybe others haven't had much problems with this,
but even the very most basic of functions seem to fail for me.  For brevity's
sake, I'm going to try and be as sparse as possible when giving code, as a
hundred pages of text would probably just annoy you.  Here we go:

...
gcc3 -DBIT_COMPILE -Wall -O -ggdb -DNOCRYPT -DQMFIXES -c -o obj/bitsys.o
bitsys.c
[EMAIL PROTECTED] src]$ In file included from bitsys.c:16:
merc.h:2611: warning: `struct flag_type' declared inside parameter list
merc.h:2611: warning: its scope is only this definition or declaration, which is
 probably not what you want.
bitsys.c:86: conflicting types for `str_flag_string'
merc.h:2611: previous declaration of `str_flag_string'
bitsys.c: In function `str_flag_string':
bitsys.c:91: warning: operation on `toggle' may be undefined
bitsys.c: In function `do_flag':
bitsys.c:344: warning: passing arg 5 of `do_flag_norm' makes pointer from
integer without a cast
make: *** [obj/bitsys.o] Error 1

[1]+  Exit 2                  make
Breakdown:
===========
merc.h:2611: warning: `struct flag_type' declared inside parameter list
merc.h:2611: warning: its scope is only this definition or declaration, which is
 probably not what you want.
bitsys.c:86: conflicting types for `str_flag_string'

Merc.h, line 2611:
char  *str_flag_string args( ( const struct flag_type *flag_table, FLAG
*bits ) );

Bitsys.c, line 86:
{

--The above is wierd.  It says just that bracket is the offending line.  Here is
line 85, though:
char *str_flag_string( const struct flag_type *flag_table, FLAG *bits )

==========
bitsys.c:91: warning: operation on `toggle' may be undefined

...
89  static int toggle;
90
91  toggle = (++toggle) % 10;
92
93    buf[toggle][0] = '\0';
...
==========
bitsys.c:344: warning: passing arg 5 of `do_flag_norm' makes pointer from
integer without a cast

   do_flag_norm( ch, victim, argument, type, victim->affected_by,
affect_flags );
.......

Here's the function header for do_flag norm:
void do_flag_norm( CHAR_DATA *ch, CHAR_DATA *victim, char *argument,
     char type, long *flag, const struct flag_type *flag_table )

relatedly, here's how victim->affected_by is laid out in merc.h:
    FLAG              affected_by;
and FLAG itself in merc.h is defined as:
    typedef int  FLAG;

I followed the walkthrough, but something's telling me that isn't right.
('something' meaning "compiler warnings" :-))
========================
And now a bazillion, assorted warnings like these:

=====
merc.h:2611: warning: `struct flag_type' declared inside parameter list
merc.h:2611: warning: its scope is only this definition or declaration, which is
 probably not what you want.
(addressed above)

act_wiz.c: In function `do_mstat':
act_wiz.c:2464: warning: passing arg 1 of `STR_IS_ZERO' makes pointer from
integer without a cast
2464:    if ( !STR_IS_ZERO(victim->affected_by, AFF_FLAGS) )

In merc.h, STR_IS_ZERO is defined as:
bool STR_IS_ZERO args( ( FLAG *var, int size ) );

and in bitsys.c, the actual function:
bool STR_IS_ZERO( FLAG * var, int size )
{
 int i;

 for( i = 0; i < size; i++ )
 {
  if( var[i] != 0 )
   return FALSE;
 }
 return TRUE;
}
=====
act_wiz.c:2467: warning: passing arg 1 of `affect_str_bit_name' makes pointer
from integer without a cast
2467:   affect_str_bit_name(victim->affected_by));
Surrounding lines:
    if ( !STR_IS_ZERO(victim->affected_by, AFF_FLAGS) ) <----2464
    {
  sprintf(buf, "Affected by %s\n\r",
   affect_str_bit_name(victim->affected_by)); <----2467
  send_to_char(buf,ch);
    }

Again, relatedly, here's how victim->affected_by is laid out in merc.h:
    FLAG              affected_by;
and FLAG itself in merc.h is defined as:
    typedef int  FLAG;

Note: this is part of the "2464" crap previously addressed.
=====
In file included from alias.c:38:
merc.h:2611: warning: `struct flag_type' declared inside parameter list
merc.h:2611: warning: its scope is only this definition or declaration, which is
 probably not what you want.
(addressed above)

gcc3 -DBIT_COMPILE -Wall -O -ggdb -DNOCRYPT -DQMFIXES -c -o obj/ban.o ban.c
In file included from ban.c:38:
merc.h:2611: warning: `struct flag_type' declared inside parameter list
merc.h:2611: warning: its scope is only this definition or declaration, which is
 probably not what you want.
(addressed above)
...

...and so on.

My own assumptions would be that I should remove the 'const' in the merc.h
definition of "char  *str_flag_string args( ( const struct flag_type
*flag_table, FLAG *bits ) );".  As for the victim->affected_by references, I
honestly don't know. Yay!

Ideas?  :-(

--Jeremy



Reply via email to