Fix EOF detection in PGN parser The result of fgetc was stored in a (char) before comparing it with EOF, which fails badly if the char is not signed.
Silence Clang warnings The assignment of the variant number to appData.variant was a real bug. The signedness of EP_STATUS looked like one, but seemed to work in practice.
Prevent crash on loading empty game file The parser code is made resistant to loading a file with 0 characters in it.
Implement triple capture Moves can now have two locust squares (and promote even when they are locust captures). This applies to move entry (but only through click- click; buttonless dragging does not yet work), as well as sending or receiving from engine, and generating and parsing SAN.
Merge branch 'v4.8.x'
updated copyright for 2016
Slight speedup of parsing promotion suffix
Let PROMOTED and DEMOTED macros use argument These macros were expanding to offsets added to what followed them. Now the thing that followed them is passed to them as an argument. This will allow them to expand the prmomotion or demotion to a table lookup, rather than just an addition. Where PROMOTED appeared in a case label, though, it was just a readability enhancement for the fixed assignment, and a new macro PROMO equal to the old PROMOTED is introduced for that.
Fix parsing of OO castling when redefined A 'piece' command can redefine the castling stride of a King, and OO castling for non-Fischer castling is internally encoded as the King step, and thus has to know this.
Let parsing of O-O castlings pay attention to castling rank The parser assumed O-O and O-O-O castlings would always take place on the back rank, even when the newly introduced castlingRank array specified differently.
Updated copyright notice to 2015
Implement piece suffixes The piece ID can now be suffixed with an 'ornament', which then is considered part of the piece ID. This expands the number of pieces that can be indicated in FEN or SAN to several times the alphabet. This does not yet work in a promotion suffix, as it is mainly intended for the large Shogi variants, which only use + as promotion suffix. It also does not work on King (which deserves an unadulterated letter). Currently the ornaments ' (single quote) and ! (exclamation point) are defined, (through a macro SUFFIXES in moves.h), increasing the number of piece types that can be represented to 78.
Fix shift-JIS codes for N, P, +B, +R
Remove debug printf for kanji
Wrap kif comments in braces The parser assumes that a text that parsed as comment contained enclosing braces, but in kif files we have to apply those ourselves, to prevent a bare comment (starting with '*'!) to appear between the moves.
Use PGN result in Game List build to supply tag If a PGN tag was missing (as in loading of non-PGN game collections) the game would be marked as unfinished ('*') in the Game List, even when it contained a result. The kif-format resign messages are now cast in a form that also recognizes the result-detail message.
Implement kifu move disambiguation For sliders the Japanese disambiguation clues cannot be translated to PSN-like disambiguators, so the problem had to be resolved in the Disambiguate callback, at the time when the second piece of the requested type is identified, so that the relative position of the pieces is known.
Make move parser understand kif-format Shogi moves For now only utf-8 kanji are recognized. The recognition of '*' as an unfinished game end had to be suspended for this, based on encountering of bare kanji (from the kif header), and is only regained after reading of a PGN tag!
Fix spurious promo-suffixes on drop moves The promo-suffix from the previous move would be left on drop moves, and could even be set to the engine.
Make inlined functions static Clang apparently chokes on non-static inline functions, and they were not used from other files anyway.