In file besch/writer/bridge_writer.cc, the parameter for the maximum length of a bridge is called max_lenght (sic). Can we please accept the proper spelling of "max_length" ? The variable is spelled correctly in the source, but the dat files must misspell it.
Like this, perhaps?
uint8 max_length = obj.get_int("max_length",0) || obj.get_int("max_lenght",0); // max_length==0: unlimited
...although I forget if C's || operator works like Perl's... hmm
That won't work as I think you intend.
Quote from: Ters on December 23, 2012, 04:15:42 PM
That won't work as I think you intend.
;D Classic one, that...
That's true
Both should be accepted, with the wrong one deprecated but for compatibility.
Quote from: Ters on December 23, 2012, 04:15:42 PM
That won't work as I think you intend.
That's why I still love Perl. In C I believe you have to write it out pedantically, because C does not let values percolate through the boolean operators:
uint8 max_length = obj.get_int("max_length",0); // max_length==0: unlimited
if (!max_length) {
max_length = obj.get_int("max_lenght",0); // compatibility with old misspelling
}
I might have made a mistake. As long as the default value is 0, it probably will work. Performance-wise, the most used spelling should come first, but this isn't really performace critical.
There was already even an incorrect try to fix this in the code ...
What exactly is not working with max_length ?
If you spell max_length correctly, it will be ignored as only the incorrect spelling is recognized. Both should be accepted.
Quote from: wlindley on December 28, 2012, 03:34:41 PM
If you spell max_length correctly, it will be ignored as only the incorrect spelling is recognized. Both should be accepted.
which is not true, I checked it right now. Of course you should use a recent makeobj version (from 2009 or newer).
This is the current source code:
uint8 max_length = obj.get_int("max_lenght",0); // max_lenght==0: unlimited
max_length = obj.get_int("max_length",max_length); // with correct spelling