[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]  FUSS Updated
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

FUSS Updated

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


Posted by Samson   USA  (683 posts)  [Biography] bio
Date Tue 13 Jul 2004 11:39 AM (UTC)
Message
Just to let people know, the Smaug/SWR/SWFOTE FUSS packages were updated recently. I went through them and cleaned out alot of warnings with some aggressive compiler flags I use on my own codebase.

Also, the SWFOTE package specifically has some codebase specific fixes added to it which were posted to the SWFOTE forum. These fixes were provided by Rapidrunner and should provide a much more stable platform from which to build on this base.

The updated files can be found at www.mudplanet.org/files.php as usual.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 14 Jul 2004 12:20 AM (UTC)
Message
Thanks, I have put copies in the download area here.

- Nick Gammon

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

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #2 on Wed 14 Jul 2004 12:57 AM (UTC)
Message
I currently use the slightly older version of SWR:FUSS and I would like to know, could you run some diff's or give out a change log so I might know what you changed? I'd like to apply it to my current code base. Thanks :)

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 14 Jul 2004 01:24 AM (UTC)

Amended on Wed 14 Jul 2004 01:29 AM (UTC) by Nick Gammon

Message
I tried compiling the smaug14afuss.tgz and got this:


make -s smaug
  Compiling o/comm.o....
comm.c: In function `new_descriptor':
comm.c:832: warning: cast discards qualifiers from pointer target type
make[1]: *** [o/comm.o] Error 1
make: *** [all] Error 2


The line in error is in bold:


    if ( sysdata.NO_NAME_RESOLVING )
      dnew->host = STRALLOC( buf );
    else
    {
       from = gethostbyaddr( (char *) &sock.sin_addr,
	  	sizeof(sock.sin_addr), AF_INET );
       dnew->host = STRALLOC( (char *)( from ? from->h_name : buf) );
    }


This is with:


$ gcc --version
gcc (GCC) 3.3.1 (cygming special)



- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 14 Jul 2004 01:27 AM (UTC)
Message
Also, "make clean" does this:


$ make clean
rm -f *.o smaug.exe *~


However the object files are in the "o" subdirectory, so it should do:


$ make clean
rm -f o/*.o smaug.exe *~




- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Wed 14 Jul 2004 01:52 AM (UTC)
Message
When compiling under Visual C++ 6, I got the following errors/warnings. You may wish to track down the warnings for sake of completenes...


act_wiz.c
g:\smaug14afuss\smaugfuss\src\act_wiz.c(5668) : warning C4013: 'lstat' undefined; assuming extern returning int
g:\smaug14afuss\smaugfuss\src\act_wiz.c(7404) : warning C4013: 'snprintf' undefined; assuming extern returning int

build.c
g:\smaug14afuss\smaugfuss\src\boards.c(1447) : warning C4715: 'read_note' : not all control paths return a value

color.c
g:\smaug14afuss\smaugfuss\src\color.c(367) : warning C4013: 'snprintf' undefined; assuming extern returning int
g:\smaug14afuss\smaugfuss\src\color.c(1319) : warning C4013: 'vsnprintf' undefined; assuming extern returning int

i3.c
g:\smaug14afuss\smaugfuss\src\i3.c(28) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

imc.c
g:\smaug14afuss\smaugfuss\src\imc.c(46) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

mud_comm.c
g:\smaug14afuss\smaugfuss\src\mud_comm.c(1513) : warning C4305: 'function' : truncation from 'const int ' to 'short '

special.c
G:\smaug14afuss\SmaugFUSS\src\special.c(55) : warning C4550: expression evaluates to a function which is missing an argument list

(previous warning occurred 571 times)



I changed mud.h by adding the following lines, and removed the files i3.c and imc.c from the build, and got it down to 2 warnings:


#ifdef WIN32
  #include <winsock.h>
  #include <sys/types.h>
  #pragma warning( disable: 4018 4244 4761)
  #define NOCRYPT
  #define index strchr
  #define rindex strrchr
  #pragma warning( disable : 4550)  // NJG
  #define vsnprintf _vsnprintf      // NJG
  #define snprintf _snprintf        // NJG
  #define lstat stat                // NJG
  #pragma comment( lib, "ws2_32.lib ")  // NJG
  #pragma comment( lib, "winmm.lib" )   // NJG
#else


These are the warnings, which sound genuine:


build.c
g:\smaug14afuss\smaugfuss\src\boards.c(1447) : warning C4715: 'read_note' : not all control paths return a value

mud_comm.c
g:\smaug14afuss\smaugfuss\src\mud_comm.c(1513) : warning C4305: 'function' : truncation from 'const int ' to 'short '


- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Wed 14 Jul 2004 02:13 AM (UTC)
Message
It is interesting to note compile times here. I compiled the FUSS source under both Cygwin and Visual C++ in debug mode (with debugging symbols, and no optimisation), and release mode (no debugging, optimisation) with the following build times (for everything excepting i3.c and imc.c) ...

Debug build - compile and link


  • Cygwin - 21 seconds

  • Visual C++ - 22 seconds


Release build - compile and link


  • Cygwin - 32 seconds

  • Visual C++ - 30 seconds


This was done on the same PC (hence the same CPU speed, memory size, hard disk speed etc.).

It is interesting that there is virtually no difference in compile speeds. One or two seconds to rebuild the whole project is nothing to worry about.



Using UltraEdit to compile

I also had some success compiling using UltraEdit as the front-end to Cygwin (much like using the Visual Studio environment).

To do this, I used the UltraEdit Advanced menu -> Tool Configuration, and entered:


  • Command line: \cygwin\bin\bash --login -i -c 'cd /home/nick/SmaugFUSS/src;make'

  • Working directory: C:\cygwin\home\Nick\SmaugFUSS\src\

  • Menu item name: make smaugFUSS

  • Save all files first: checked

  • Command output:

    • Output to list box: selected
    • Capture output: checked



Then click "Insert" to add this as a special command, and then OK to close the dialog box.

Having done all this (which you only do once) then there is a new menu item under the Advanced menu:


make smaugFUSS - Ctrl+Shift+0


Then to do a "make" I just select that menu item or type Ctrl+Shift+0, and the whole process kicks in. If there are errors they display in the Output pane near the bottom (select Window -> Output Window to see it). You can double-click any error message and it will open the appropriate file and go to the line in error. Very handy.




- Nick Gammon

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

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Reply #7 on Wed 14 Jul 2004 02:53 AM (UTC)
Message
Cleared the Cygwin warnings, but I'm afraid the other stuff is beyond my reach since I don't have access to a VC++ compiler. I'd also prefer not to remove the intermud code from the distro just because of that either. It compiles as intended now in all 3 packages. I'm sure there must be someone who knows how to get the complete package to compile under VC++, with the intermud code enabled for those who might wish to use it?

Anyway, the 3 package files have been updated again.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Wed 14 Jul 2004 03:20 AM (UTC)
Message
You don't seem to have changed mud.h. If you add the suggested lines (the ones ending with // NJG ) then it won't affect the non-Win32 compiles, and should make it compile cleanly under Visual C++.

Unless I have downloaded the wrong copy, you also don't seem to have changed the "make clean" behaviour.

- Nick Gammon

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

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Reply #9 on Wed 14 Jul 2004 03:50 AM (UTC)
Message
Here's to hoping attempt #3 does the job. I could swear I uploaded that stuff. I must be getting old.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Fri 16 Jul 2004 02:16 AM (UTC)

Amended on Fri 16 Jul 2004 02:17 AM (UTC) by Nick Gammon

Message
OK, seems better now. I still get this warning:


build.c
g:\cygwin\home\nick\smaugfuss\src\boards.c(1447) : warning C4715: 'read_note' : not all control paths return a value


This is in:


NOTE_DATA *read_note( char *notefile, FILE *fp )
{
  NOTE_DATA *pnote;
  char *word;

// ... stuff omitted ...

  bug ( "read_note: bad key word." );
  exit( 1 );
}


See, although exit (1) would stop the program, that is a function call, and not, strictly speaking, returning a value. It should really be:


NOTE_DATA *read_note( char *notefile, FILE *fp )
{
  NOTE_DATA *pnote;
  char *word;

// ... stuff omitted ...

  bug ( "read_note: bad key word." );
  exit( 1 );
  return NULL;
}


The other warning is:


mud_comm.c
g:\cygwin\home\nick\smaugfuss\src\mud_comm.c(1513) : warning C4305: 'function' : truncation from 'const int ' to 'short '


The definition of add_timer is:


void add_timer( CHAR_DATA *ch, sh_int type, sh_int count, DO_FUN *fun, int value )


The warning occurs at:


void do_mpnuisance( CHAR_DATA *ch, char *argument )
{
    CHAR_DATA *victim;
    char arg1[MAX_STRING_LENGTH];

// ... stuff omitted ...

    victim->pcdata->nuisance->max_time = mktime(now_time);
    add_timer( victim, TIMER_NUISANCE, (28800*2), NULL, 0 );
    return;
}


The 3rd argument (sh_int count) is being passed the value 28800*2 which is 57,600. This is higher than the maximum possible in a short, which is 32767. This is therefore wrong.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


6,792 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]