From 8eda01fd759fce082b4aacce4a92ae3e24c82cf8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 6 Aug 2019 00:24:07 +0200 Subject: [PATCH] Get rid of extra unnecessary blocks in common typemaps Use "..." instead of "{...}" to avoid generating extra lines with opening/closing curly braces, which are completely unnecessary. Also remove an unnecessary "if" check in "in" typemap, which was useless. No real changes. --- Lib/c/c.swg | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Lib/c/c.swg b/Lib/c/c.swg index 824129a16..96a463cba 100644 --- a/Lib/c/c.swg +++ b/Lib/c/c.swg @@ -145,14 +145,9 @@ same_action_all_primitive_types(in, "$1 = ($1_ltype) $input;", "$1 = &$input;") $1 = *($&1_ltype) &$input; } -%typemap(in) SWIGTYPE { - $1 = *($1_ltype *)$input; -} +%typemap(in) SWIGTYPE "$1 = *($1_ltype *)$input;" -%typemap(in) SWIGTYPE * { - if ($input) - $1 = ($1_ltype) $input; -} +%typemap(in) SWIGTYPE * "$1 = ($1_ltype) $input;" %typemap(in) SWIGTYPE *[ANY] { if ($input) { @@ -209,13 +204,9 @@ same_action_all_primitive_types(out, "$result = $1;", "$result = *$1;") *($&1_ltype) &$result = $1; } -%typemap(out) SWIGTYPE { - $result = (SwigObj*) &$1; -} +%typemap(out) SWIGTYPE "$result = (SwigObj*) &$1;" -%typemap(out) SWIGTYPE *, SWIGTYPE & { - $result = (SwigObj*) $1; -} +%typemap(out) SWIGTYPE *, SWIGTYPE & "$result = (SwigObj*) $1;" %typemap(out) SWIGTYPE * [ANY], SWIGTYPE [ANY][ANY] { static SwigObj **_temp = 0;