cosmetic changes removing unnecessary brackets and empty lines in generated code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8251 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
63c757ba94
commit
36b1e5c2ac
11 changed files with 150 additions and 174 deletions
|
|
@ -147,7 +147,7 @@
|
|||
const float & ($*1_ltype temp),
|
||||
const double & ($*1_ltype temp)
|
||||
%{ temp = ($*1_ltype)$input;
|
||||
$1 = &temp; %}
|
||||
$1 = &temp; %}
|
||||
|
||||
%typemap(out) const bool & %{ $result = *$1; %}
|
||||
%typemap(out) const char & %{ $result = *$1; %}
|
||||
|
|
@ -167,14 +167,14 @@ $1 = &temp; %}
|
|||
/* Default handling. Object passed by value. Convert to a pointer */
|
||||
%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp)
|
||||
%{ argp = ($&1_ltype)$input;
|
||||
if (!argp) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0);
|
||||
return $null;
|
||||
}
|
||||
$1 = *argp; %}
|
||||
if (!argp) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0);
|
||||
return $null;
|
||||
}
|
||||
$1 = *argp; %}
|
||||
%typemap(out) SWIGTYPE
|
||||
#ifdef __cplusplus
|
||||
%{$result = new $1_ltype(($1_ltype &)$1); %}
|
||||
%{ $result = new $1_ltype(($1_ltype &)$1); %}
|
||||
#else
|
||||
{
|
||||
$&1_ltype $1ptr = ($&1_ltype) malloc(sizeof($1_ltype));
|
||||
|
|
@ -292,23 +292,20 @@ $1 = &temp; %}
|
|||
short,
|
||||
unsigned int,
|
||||
unsigned long,
|
||||
unsigned short {
|
||||
char error_msg[256];
|
||||
sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1);
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, error_msg);
|
||||
return $null;
|
||||
}
|
||||
unsigned short
|
||||
%{ char error_msg[256];
|
||||
sprintf(error_msg, "C++ $1_type exception thrown, value: %d", $1);
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, error_msg);
|
||||
return $null; %}
|
||||
|
||||
%typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY] %{
|
||||
(void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) SWIGTYPE, SWIGTYPE &, SWIGTYPE *, SWIGTYPE [ANY]
|
||||
%{ (void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null; %}
|
||||
|
||||
%typemap(throws, canthrow=1) char * %{
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1);
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) char *
|
||||
%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1);
|
||||
return $null; %}
|
||||
|
||||
|
||||
/* Typemaps for code generation in proxy classes and C# type wrapper classes */
|
||||
|
|
|
|||
|
|
@ -15,11 +15,10 @@
|
|||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & ""
|
||||
|
||||
%typemap(throws, canthrow=1) const enum SWIGTYPE & %{
|
||||
(void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) const enum SWIGTYPE &
|
||||
%{ (void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null; %}
|
||||
|
||||
%typemap(csin) const enum SWIGTYPE & "(int)$csinput"
|
||||
%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & {
|
||||
|
|
@ -44,11 +43,10 @@
|
|||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE ""
|
||||
|
||||
%typemap(throws, canthrow=1) enum SWIGTYPE %{
|
||||
(void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) enum SWIGTYPE
|
||||
%{ (void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null; %}
|
||||
|
||||
%typemap(csin) enum SWIGTYPE "(int)$csinput"
|
||||
%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE {
|
||||
|
|
|
|||
|
|
@ -17,11 +17,10 @@
|
|||
|
||||
%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & ""
|
||||
|
||||
%typemap(throws, canthrow=1) const enum SWIGTYPE & %{
|
||||
(void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) const enum SWIGTYPE &
|
||||
%{ (void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null; %}
|
||||
|
||||
%typemap(csin) const enum SWIGTYPE & "$csinput"
|
||||
%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & {
|
||||
|
|
@ -46,11 +45,10 @@
|
|||
|
||||
%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE ""
|
||||
|
||||
%typemap(throws, canthrow=1) enum SWIGTYPE %{
|
||||
(void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) enum SWIGTYPE
|
||||
%{ (void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null; %}
|
||||
|
||||
%typemap(csin) enum SWIGTYPE "$csinput"
|
||||
%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE {
|
||||
|
|
|
|||
|
|
@ -16,11 +16,10 @@
|
|||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & ""
|
||||
|
||||
%typemap(throws, canthrow=1) const enum SWIGTYPE & %{
|
||||
(void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) const enum SWIGTYPE &
|
||||
%{ (void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null; %}
|
||||
|
||||
%typemap(csin) const enum SWIGTYPE & "$csinput.swigValue"
|
||||
%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & {
|
||||
|
|
@ -45,11 +44,10 @@
|
|||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE ""
|
||||
|
||||
%typemap(throws, canthrow=1) enum SWIGTYPE %{
|
||||
(void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) enum SWIGTYPE
|
||||
%{ (void)$1;
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
|
||||
return $null; %}
|
||||
|
||||
%typemap(csin) enum SWIGTYPE "$csinput.swigValue"
|
||||
%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class string;
|
|||
%{ if (!$input) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
|
||||
return $null;
|
||||
}
|
||||
$1 = std::string($input); %}
|
||||
}
|
||||
$1 = std::string($input); %}
|
||||
%typemap(out) string %{ $result = SWIG_csharp_string_callback($1.c_str()); %}
|
||||
|
||||
%typemap(csin) string "$csinput"
|
||||
|
|
@ -52,10 +52,9 @@ class string;
|
|||
|
||||
%typemap(typecheck) string = char *;
|
||||
|
||||
%typemap(throws, canthrow=1) string %{
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str());
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) string
|
||||
%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str());
|
||||
return $null; %}
|
||||
|
||||
// const string &
|
||||
%typemap(ctype) const string & "char *"
|
||||
|
|
@ -66,9 +65,9 @@ class string;
|
|||
%{ if (!$input) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
|
||||
return $null;
|
||||
}
|
||||
std::string $1_str($input);
|
||||
$1 = &$1_str; %}
|
||||
}
|
||||
std::string $1_str($input);
|
||||
$1 = &$1_str; %}
|
||||
%typemap(out) const string & %{ $result = SWIG_csharp_string_callback($1->c_str()); %}
|
||||
|
||||
%typemap(csin) const string & "$csinput"
|
||||
|
|
@ -89,10 +88,9 @@ class string;
|
|||
|
||||
%typemap(typecheck) const string & = char *;
|
||||
|
||||
%typemap(throws, canthrow=1) const string & %{
|
||||
SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str());
|
||||
return $null;
|
||||
%}
|
||||
%typemap(throws, canthrow=1) const string &
|
||||
%{ SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, $1.c_str());
|
||||
return $null; %}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue