[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Channels as extended bitvectors
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Channels as extended bitvectors

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Vaelarin   USA  (8 posts)  [Biography] bio
Date Fri 07 Jun 2002 03:05 AM (UTC)
Message
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?
[Go to top] top

Posted by Neves   USA  (78 posts)  [Biography] bio
Date Reply #1 on Fri 07 Jun 2002 03:16 AM (UTC)
Message
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
[Go to top] top

Posted by Vaelarin   USA  (8 posts)  [Biography] bio
Date Reply #2 on Fri 07 Jun 2002 04:03 AM (UTC)
Message
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...
[Go to top] top

Posted by Neves   USA  (78 posts)  [Biography] bio
Date Reply #3 on Fri 07 Jun 2002 04:55 AM (UTC)
Message
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
[Go to top] top

Posted by Nick Gammon   Australia  (21,386 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Fri 07 Jun 2002 10:56 PM (UTC)
Message
Looking at the source, it is "print_bitvector", not "fprint_bitvector".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Vaelarin   USA  (8 posts)  [Biography] bio
Date Reply #5 on Sat 08 Jun 2002 02:23 PM (UTC)
Message
excellent, that took care of the problem. Thanks.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,207 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]