Page 19 of 22

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 08 Jul 2009 05:42
by DJ Nekkid
make a "clean tile" at the top of the grf' and use it whenever you need a "default" that is never gonna be reached anyway? :p

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 08 Jul 2009 09:04
by FooBar
Well that's a non-solution IMO. I much rather accept the warnings being there than implement code that is never used.

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 08 Jul 2009 13:51
by DaleStan
FooBar wrote:Well that's a non-solution IMO. I much rather accept the warnings being there than implement code that is never used.
Yet you implement a default that is never used. :p
FooBar wrote:I tried using renum -w 100,141,144 but ... this silences warnings 141 and 144 just fine, it doesn't silence this warning 100.
On a more serious note, are you quite sure that's what it does? Debugging suggests to me that it doesn't do anything at all. (Please don't ask me how I pulled that stunt.)

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 08 Jul 2009 17:10
by DJ Nekkid
FooBar wrote:Well that's a non-solution IMO. I much rather accept the warnings being there than implement code that is never used.
oki, i see that, but then;

FooBar wrote:

Code: Select all

-1 * 0 02 09 B3 //layout 3 
	85 43 //check relative position (00yx[YYXX])
	00 FF FF //don't shift, don't mask
	\b3 //number of ranges to check (number of tiles)
	//pit
	\wx00  01 02  01 02
	\wx01  00 02  00 02
	\wx02  01 00  01 00
	\wx00 //<default> (first sprite available)
Why not:

Code: Select all

-1 * 0 02 09 B3 //layout 3 
	85 43 //check relative position (00yx[YYXX])
	00 FF FF //don't shift, don't mask
	\b2 //number of ranges to check (number of tiles)
	//pit
   \wx00  01 02  01 02
   \wx01  00 02  00 02
   \wx02  //<default> (first sprite available)
or similar then?

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 08 Jul 2009 20:56
by FooBar
Leaving one variation out and use the default for that is duly noted :D
DaleStan wrote:On a more serious note, are you quite sure that's what it does? Debugging suggests to me that it doesn't do anything at all. (Please don't ask me how I pulled that stunt.)
That's how -? told me how to use it:
-w and -W (and their long counterparts) also accept a comma-separated list of messages, all of which will be ENABLEd or DISABLEd.
It might be that I don't have any warnings 141 and 144 any more...

/me goes testing...

EDIT: It seems that I don't have warnings 141 and 144 any more (probably due to renum update), but -w 100 doesn't do anything either...

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 08 Jul 2009 23:54
by DaleStan
FooBar wrote:It seems that I don't have warnings 141 and 144 any more (probably due to renum update), but -w 100 doesn't do anything either...
Now this I can't reproduce; -w 100 works for me. Anyway, hopefully 2127 will fix the issues.

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 09 Jul 2009 04:02
by George
DaleStan wrote:
FooBar wrote:It seems that I don't have warnings 141 and 144 any more (probably due to renum update), but -w 100 doesn't do anything either...
Now this I can't reproduce; -w 100 works for me. Anyway, hopefully 2127 will fix the issues.
How about putting the latest prebuild win executable at http://users.tt-forums.net/dalestan/nforenum/ ?
r2100 is the latest one I see there :(

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 09 Jul 2009 05:52
by planetmaker
@DaleStan: thanks again for the quick fix! Indeed that has -w100 working here now, again, too.

@George: Currently I try to keep available the latest binaries at http://dev.openttdcoop.org/bundles/grfdev
I still hope that we manage to get the OpenTTD compile farm providing latest binaries automatically :)

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 09 Jul 2009 11:11
by FooBar
DaleStan wrote:Anyway, hopefully 2127 will fix the issues.
Thanks for fixing something that wasn't broke in the first place, so I think an apology is in order...

I had -w 144,141 specified in my Makefile.local all the time, so changing the renum flags Makefile.config to -w 100,144,141 or even -w 100 didn't have any effect at all, as Makefile.local overruled those. :oops:
So next time I can't get something to work, ask me about my makefile.local...

But then you're commit isn't completely useless, as now there's a check to detect faulty command line arguments. :]

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 09 Jul 2009 19:07
by George
planetmaker wrote:@DaleStan: thanks again for the quick fix! Indeed that has -w100 working here now, again, too.

@George: Currently I try to keep available the latest binaries at http://dev.openttdcoop.org/bundles/grfdev
I still hope that we manage to get the OpenTTD compile farm providing latest binaries automatically :)
Thank you!

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 01 Aug 2009 19:33
by planetmaker
With nforenum r2166 I have problems to use target "bundle_zip" under MinGW, as MinGW isn't recognized as a windows environment and thus the target "release" searches for renum instead of renum.exe. The attached diff amends Makefile such, that a MinGW environment is detected and the correct binary name assigned.

Btw: Thanks for fixing the random bits for canals. New versions, using the new bundle_zip target are uploaded to http://mz.openttdcoop.org/bundles/grfdev/nforenum/

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 02 Aug 2009 01:54
by DaleStan
Does diff work for you too? I like it better, but if it doesn't work, we can go back to using uname and cut.

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 02 Aug 2009 05:19
by planetmaker
Thanks, that diff works for me, too.

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 22 Aug 2009 13:17
by planetmaker
Two things I wonder about:

- when you terminate a comment line in NFO with \ the subsequent sprite is ignored. Is that intended (escaping the line break)?
- when you add colour codes (e.g. 8E) to action 08, nforenum complains with warning 144 about the use there, indicating that that is a mis-use of the colour codes. I don't see why they must not be used there...

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 23 Aug 2009 04:22
by DaleStan
1) Are you running the code through the C preprocessor? If so, then that is to blame, and not NFORenum; renum can't help you if CPP has already eaten the newline.
2) I went conservative there, obviously. I can make it more permissive pretty easily.

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 23 Aug 2009 05:16
by planetmaker
DaleStan wrote:1) Are you running the code through the C preprocessor? If so, then that is to blame, and not NFORenum; renum can't help you if CPP has already eaten the newline.
2) I went conservative there, obviously. I can make it more permissive pretty easily.
ad 1) Yes, I do. :-) That then seems to be the cause, thanks.
ad 2) I would appreciate it as it's in the newgrfs I'm involved right now a warning which is not necessary as it also seems nicely supported by the programmes.

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 30 Aug 2009 19:11
by Yexo
I've finally compiled nforenum myself. I noticed an odd thing in the Makefile:

Code: Select all

-include ${MAKEFILELOCAL}
Is before the lines setting CFLAGS/CXXFLAGS, so changing CFLAGS in Makefile.local has no effect. You can argue that CFLAGS shouldn't be changed in Makefile.local but if that's the case they shouldn't be included in Makefile.local.sample either.

And my compliments about the config data format. It really shows how much information you can pack in only a few bytes :p

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 06 Sep 2009 22:08
by Yexo
The following code is wrong, so the error is correct but not really helpful. "sound import sprites", how many is that?

Code: Select all

//!!Fatal Error (41): All Basic standard 02s for houses and industry tiles are sound import sprites bytes long.
   11 * 12	 02 09 00 00
        00 80 00 00
        00 00 00 00

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 08 Sep 2009 02:07
by DaleStan
Hmm...
That could be considered somewhat incorrect. Fixed in 2198.

Re: NFORenum v3.4.6 released (NFO renumberer and linter)

Posted: 08 Sep 2009 06:16
by planetmaker
nforenum r2198 has a compile warning (gcc 4.0.1 on mac):

Code: Select all

[CPP] act0.o
act0.cpp: In function 'void FormatSprite(PseudoSprite&, uint&, uint, uint)':
act0.cpp:294:7: warning: suggest explicit braces to avoid ambiguous 'else'
The attached diff should fix that, given indentation in the original source is right :-)