From: SourceForge.net <no...@so...> - 2007-03-30 02:54:01
|
Patches item #1690948, was opened at 2007-03-30 00:01 Message generated for change (Comment added) made by olly You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=301645&aid=1690948&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: J Robert Ray (jrray) Assigned to: Olly Betts (olly) Summary: Fix bug outputing "<:" token Initial Comment: Small tweak to the SwigValueWrapper, it could output types like: SwigValueWrapper<::foo > bar; The "<:" token annoys GCC. I copied from similar code found in stype.c to create this patch. Note: the SwigType_alttype function has two main branches that have similar code, in the first case it does: if (use_wrapper) { String *str = SwigType_str(td, 0); w = NewStringf("SwigValueWrapper<%s >", str); Delete(str); } and in the second case it does: if (use_wrapper) { w = NewStringf("SwigValueWrapper<%s >", td); } td is a SwigType* in both cases. The stringification of td in the second case seemed suspicious to me so in my patch I changed the code to match the use in the first case. It looks like this function could be cleaned up further by pulling the now-identical use_wrapper blocks out of the main if/else. ---------------------------------------------------------------------- >Comment By: Olly Betts (olly) Date: 2007-03-30 03:53 Message: Logged In: YES user_id=14972 Originator: NO OK, applied. I went for just always inserting a space between "<" and the type which is simpler (it was actually me who changed stype.c - there I was concerned that changing the strings generated might cause problems if some other part of SWIG looked at the result - here it's more obvious that nothing does). I factored out some of the common code too. Using %s like this with a SwigType* is OK. If you look in Source/Swig/swig.h, SwigType is a typedef for DOH, and so it just magically gets converted to a string (see DohvPrintf() in Source/DOH/fio.c). ---------------------------------------------------------------------- Comment By: Olly Betts (olly) Date: 2007-03-30 00:18 Message: Logged In: YES user_id=14972 Originator: NO Thanks for the patch. I'm looking at applying it now... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=301645&aid=1690948&group_id=1645 |