Channels as extended bitvectors

Posted by Vaelarin on Fri 07 Jun 2002 03:05 AM — 6 posts, 23,915 views.

USA #0
I'm trying to change the channels from bitvectors to extended bitvectors. Everything worked ok, except for one line of code in save.c. I'm using smaug 1.4a, linux.

The snippet I'm using says to change this:
in fwrite_char:
if (ch->deaf )
fprintf( pf, "Deaf %d\n", ch->deaf );
into this:
if ( !xIS_EMPTY(ch->deaf) )
fprintf( fp, "Deaf %s\n", frpint_bitvector(&ch->deaf) );

which is what I did. However, when I try to compile, when it reaches save.c it gives this error:
implicit declaration of function 'fprint_bitvector'
warning format argument is not a pointer (arg3)

it continues, until it tries to build save.o, then it crashes and gives me this error:

In function `fwrite_char':
/home/username/dist/src/save.c:345: undefined reference to `fprint_bitvector'
collect2: ld returned 1 exit status
make[1]: *** [smaug] Error 1
make[1]: Leaving directory `/home/username/dist/src'
make: *** [all] Error 2

any ideas?
USA #1
The original code was:
fprintf( pf, "Deaf %d\n", ch->deaf );
You changed it to:
fprintf( fp, "Deaf %s\n", frpint_bitvector(&ch->deaf) );

Comaparing them shows that one has pf, one fp, not sure if that makes a difference, but it might be worth changing just to see, and also you wrote frpint_bitvector, could be that it should be fprint_bitvector. These are just guesses, since I never worked much with that type of thing.

-Jay
USA #2
ah, no those were typoes. Sorry. They are correct in the code, listed as:

if ( ch->deaf )
fprint( fp, "Deaf %d\n", ch->deaf);

and

if ( !xIS_EMPTY(ch->deaf) )
fprint( fp, "Deaf %s\n", fprint_bitvector(&ch->deaf) );

still having the errors...
USA #3
Only other thing I noticed was that when I searched through SMAUG code there is nowhere with fprint_bitvector, unless that was something you added, which might be what the problem is.

-Jay
Australia Forum Administrator #4
Looking at the source, it is "print_bitvector", not "fprint_bitvector".
USA #5
excellent, that took care of the problem. Thanks.