Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Yandex, DotBot

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Adding changes snippet
Forum Rules | Mark all | Recent Posts

Adding changes snippet
< Newer Topic :: Older Topic > Causes stralloc errors on compling

Pages:<< prev 1 next >>
Post is unread #1 Dec 16, 2011, 7:52 am
Go to the top of the page
Go to the bottom of the page

Kalisto
Fledgling
GroupMembers
Posts2
JoinedDec 16, 2011

ive been fighting with some errors trying to add a changes snippet to stock smaugFUSS1.9 heres a list of errors

changes.c: In function âvoid load_changes()â:
changes.c:220:57: warning: too many arguments for format [-Wformat-extra-args]

changes.c:227:70: error: invalid conversion from âvoid*â to âNEWCHANGE_DATA* {aka newchanges_data*}â [-fpermissive]

changes.c:231:49: error: invalid conversion from âconst char*â to âchar*â [-fpermissive]

changes.c: In function âint strip_change_month(char*)â:
changes.c:341:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]



there is alot more but its just repeated errors

heres a pastebin of my two source files for them

http://pastebin.com/yt1UcVv5

Help me out guys please :)
       
Post is unread #2 Dec 20, 2011, 5:08 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

changes.c:220:57: warning: too many arguments for format [-Wformat-extra-args]

changes.c:227:70: error: invalid conversion from âvoid*â to âNEWCHANGE_DATA* {aka newchanges_data*}â [-fpermissive]

changes.c:231:49: error: invalid conversion from âconst char*â to âchar*â [-fpermissive]

changes.c: In function âint strip_change_month(char*)â:
changes.c:341:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Ok should have edited these to this
changes.c:207:57: warning: too many arguments for format [-Wformat-extra-args]

changes.c:214:70: error: invalid conversion from âvoid*â to âNEWCHANGE_DATA* {aka newchanges_data*}â [-fpermissive]

changes.c:218:49: error: invalid conversion from âconst char*â to âchar*â [-fpermissive]

changes.c: In function âint strip_change_month(char*)â:
changes.c:328:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

You took out the credits which is about 13 lines so either include the credits in the copy bin/fix the numbers in the post/give what is on the line it complains about for ease of following it when asking for help :) Thanks. Now with that out the way lets take a look here.

In your game
   changes.c:220:57: warning: too many arguments for format [-Wformat-extra-args]
In the post
   changes.c:207:57: warning: too many arguments for format [-Wformat-extra-args]

is this
      bug ("Could not open Changes File for reading.", 0);

Bug got redone awhile back to be like this instead
      bug( "%s", "Could not open Changes File for reading." );


In your game
   changes.c:214:70: error: invalid conversion from âvoid*â to âNEWCHANGE_DATA* {aka newchanges_data*}â [-fpermissive]
In the post
   changes.c:227:70: error: invalid conversion from âvoid*â to âNEWCHANGE_DATA* {aka newchanges_data*}â [-fpermissive]

is this
   changes_table = malloc (sizeof (NEWCHANGE_DATA) * (maxChanges + 1));

try this
   changes_table = ( NEWCHANGE_DATA * )malloc ( sizeof ( NEWCHANGE_DATA ) * ( maxChanges + 1 ) );


In your game
   changes.c:231:49: error: invalid conversion from âconst char*â to âchar*â [-fpermissive]
In the post
   changes.c:218:49: error: invalid conversion from âconst char*â to âchar*â [-fpermissive]

is this
      changes_table[i].change = fread_string (fp);

fread_string was changed to a const char * instead of a char * so chances are you will have to open changes.h or wherever you have the changes_table struct at to change char *change to const char *change.

In your game
   changes.c:341:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In the post
   changes.c:328:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

is this
    for( a = 0; a < strlen(date); a++ )

strlen returns a size_t while a is defined as an int so it is complaining about comparing the two. Not sure what way is best to handle it. Id say try changing a to a size_t and as long as no issues go with that or you can try a < (int) strlen( date );

Good luck and hope it helps out some :)
       
Post is unread #3 Dec 21, 2011, 1:03 pm   Last edited Dec 21, 2011, 1:06 pm by Kalisto
Go to the top of the page
Go to the bottom of the page

Kalisto
Fledgling
GroupMembers
Posts2
JoinedDec 16, 2011

[edit] Oppsed didnt mean to post
       
Pages:<< prev 1 next >>