From 52c754a22d4556795a3927706256bfae4624ccc4 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Sun, 17 Feb 2013 15:56:25 +0100 Subject: [PATCH] Minor fix to Octave autodoc generation for functions returning structs Patch #27 - see also git commit 72ffdb930dcbbe0ae2a1cf7164a7ca4b632b1fee --- CHANGES.current | 3 +++ Source/Modules/octave.cxx | 10 +++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 779e20528..90389d812 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -56,6 +56,9 @@ Version 2.0.10 (in progress) When generating functions provided by %extend, use "(void)" for no-argument functions instead of "()". This prevents warnings when compiling with "gcc -Wstrict-prototypes". +2013-02-17: kwwette + [Octave] Minor fix to autodoc generation: get the right type for functions returning structs. + 2013-02-15: wsfulton Deprecate typedef names used in %extend that are not the real class/struct name. For example: diff --git a/Source/Modules/octave.cxx b/Source/Modules/octave.cxx index 6f6e5b8ae..a9be76fc2 100644 --- a/Source/Modules/octave.cxx +++ b/Source/Modules/octave.cxx @@ -355,14 +355,10 @@ public: SwigType *type = Getattr(n, "type"); if (type && Strcmp(type, "void")) { - type = SwigType_base(type); - Node *lookup = Swig_symbol_clookup(type, 0); - if (lookup) - type = Getattr(lookup, "sym:name"); + Node *nn = classLookup(Getattr(n, "type")); + String *type_str = nn ? Copy(Getattr(nn, "sym:name")) : SwigType_str(type, 0); Append(decl_info, "@var{retval} = "); - String *type_str = NewString(""); - Printf(type_str, "@var{retval} is of type %s. ", type); - Append(args_str, type_str); + Printf(args_str, "%s@var{retval} is of type %s. ", args_str, type_str); Delete(type_str); }