From 2535297efbc72e857ac0865a4bd3e0e4ca331ca2 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 23 Apr 2010 06:44:47 +0000 Subject: [PATCH] minor formatting change git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11995 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/allegrocl/allegrocl.swg | 6 +++--- Lib/chicken/std_string.i | 5 ++--- Lib/guile/std_string.i | 7 +++---- Lib/lua/lua.swg | 2 +- Lib/lua/luatypemaps.swg | 10 +++++----- Lib/lua/wchar.i | 8 ++++---- Lib/python/argcargv.i | 2 +- Lib/r/r.swg | 6 +++--- 8 files changed, 22 insertions(+), 24 deletions(-) diff --git a/Lib/allegrocl/allegrocl.swg b/Lib/allegrocl/allegrocl.swg index cc23a1f90..87e030ce4 100644 --- a/Lib/allegrocl/allegrocl.swg +++ b/Lib/allegrocl/allegrocl.swg @@ -203,20 +203,20 @@ SWIG_TYPECHECK_STRING_ARRAY 1140 %typemap(in) wchar_t "$1 = $input;"; %typemap(lin,numinputs=1) wchar_t "(cl::let (($out (cl:char-code $in)))\n $body)"; -%typemap(lin,numinputs=1) wchar_t* "(excl:with-native-string ($out $in +%typemap(lin,numinputs=1) wchar_t * "(excl:with-native-string ($out $in :external-format #+little-endian :fat-le #-little-endian :fat)\n $body)" %typemap(out) wchar_t "$result = $1;"; %typemap(lout) wchar_t "(cl::setq ACL_ffresult (cl::code-char $body))"; -%typemap(lout) wchar_t* "(cl::setq ACL_ffresult (excl:native-to-string $body +%typemap(lout) wchar_t * "(cl::setq ACL_ffresult (excl:native-to-string $body :external-format #+little-endian :fat-le #-little-endian :fat))"; %typemap(ffitype) wchar_t ":unsigned-short"; %typemap(lisptype) wchar_t ""; %typemap(ctype) wchar_t "wchar_t"; %typemap(lispclass) wchar_t "cl:character"; -%typemap(lispclass) wchar_t* "cl:string"; +%typemap(lispclass) wchar_t * "cl:string"; ////////////////////////////////////////////////////////////// /* Array reference typemaps */ diff --git a/Lib/chicken/std_string.i b/Lib/chicken/std_string.i index ce24cba32..9907a58bc 100644 --- a/Lib/chicken/std_string.i +++ b/Lib/chicken/std_string.i @@ -30,7 +30,7 @@ namespace std { %typemap(typecheck) string = char *; %typemap(typecheck) const string & = char *; - %typemap(in) string (char* tempptr) { + %typemap(in) string (char * tempptr) { if ($input == C_SCHEME_FALSE) { $1.resize(0); } else { @@ -44,8 +44,7 @@ namespace std { } } - %typemap(in) const string& (std::string temp, - char* tempptr) { + %typemap(in) const string& (std::string temp, char *tempptr) { if ($input == C_SCHEME_FALSE) { temp.resize(0); diff --git a/Lib/guile/std_string.i b/Lib/guile/std_string.i index c10806e98..65ab6efbf 100644 --- a/Lib/guile/std_string.i +++ b/Lib/guile/std_string.i @@ -26,7 +26,7 @@ namespace std { %typemap(typecheck) string = char *; %typemap(typecheck) const string & = char *; - %typemap(in) string (char* tempptr) { + %typemap(in) string (char * tempptr) { if (gh_string_p($input)) { tempptr = SWIG_scm2str($input); $1.assign(tempptr); @@ -36,8 +36,7 @@ namespace std { } } - %typemap(in) const string & (std::string temp, - char* tempptr) { + %typemap(in) const string & (std::string temp, char *tempptr) { if (gh_string_p($input)) { tempptr = SWIG_scm2str($input); temp.assign(tempptr); @@ -48,7 +47,7 @@ namespace std { } } - %typemap(in) string * (char* tempptr) { + %typemap(in) string * (char *tempptr) { if (gh_string_p($input)) { tempptr = SWIG_scm2str($input); $1 = new std::string(tempptr); diff --git a/Lib/lua/lua.swg b/Lib/lua/lua.swg index 5218bf0a8..a15f14148 100644 --- a/Lib/lua/lua.swg +++ b/Lib/lua/lua.swg @@ -176,7 +176,7 @@ use %include instead %{lua_pushnumber(L,(lua_Number)(int)$1);SWIG_fail; %} // strings are just sent as errors -%typemap(throws) char*, const char* +%typemap(throws) char *, const char * %{lua_pushstring(L,$1);SWIG_fail;%} // char is changed to a string diff --git a/Lib/lua/luatypemaps.swg b/Lib/lua/luatypemaps.swg index ae65cbfea..aff116192 100644 --- a/Lib/lua/luatypemaps.swg +++ b/Lib/lua/luatypemaps.swg @@ -89,7 +89,7 @@ temp=($basetype)lua_tonumber(L,$input); $1=&temp;%} %typemap(out) const bool& %{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%} -// strings (char* and char[]) +// strings (char * and char[]) %fragment("SWIG_lua_isnilstring", "header") { int SWIG_lua_isnilstring(lua_State *L, int idx) { int ret = lua_isstring(L, idx); @@ -99,17 +99,17 @@ temp=($basetype)lua_tonumber(L,$input); $1=&temp;%} } } -%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char*, char* +%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char *, char * %{$1 = ($ltype)lua_tostring(L, $input);%} %typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char[ANY], char[ANY] %{$1 = ($ltype)lua_tostring(L, $input);%} -%typemap(out) const char*, char* -%{ lua_pushstring(L,(const char*)$1); SWIG_arg++;%} +%typemap(out) const char *, char * +%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} %typemap(out) const char[ANY], char[ANY] -%{ lua_pushstring(L,(const char*)$1); SWIG_arg++;%} +%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} // char's // currently treating chars as small strings, not as numbers diff --git a/Lib/lua/wchar.i b/Lib/lua/wchar.i index 02b5428be..92f7ed0e2 100644 --- a/Lib/lua/wchar.i +++ b/Lib/lua/wchar.i @@ -12,11 +12,11 @@ %{ #include -wchar_t* str2wstr(const char* str, int len) +wchar_t* str2wstr(const char *str, int len) { wchar_t* p; if (str==0 || len<1) return 0; - p=(wchar*)malloc((len+1)*sizeof(wchar_t)); + p=(wchar *)malloc((len+1)*sizeof(wchar_t)); if (p==0) return 0; if (mbstowcs(p, str, len)==-1) { @@ -28,13 +28,13 @@ wchar_t* str2wstr(const char* str, int len) } %} -%typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t* +%typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t * %{ $1 = str2wstr(lua_tostring( L, $input ),lua_strlen( L, $input )); if ($1==0) {lua_pushfstring(L,"Error in converting to wchar (arg %d)",$input);goto fail;} %} -%typemap(freearg) wchar_t* +%typemap(freearg) wchar_t * %{ free($1); %} diff --git a/Lib/python/argcargv.i b/Lib/python/argcargv.i index d5d008ae5..717fe7334 100644 --- a/Lib/python/argcargv.i +++ b/Lib/python/argcargv.i @@ -60,7 +60,7 @@ SWIG_AsArgcArgv(PyObject *input, } /* - This typemap works with either a char**, a python list or a python + This typemap works with either a char **, a python list or a python tuple */ diff --git a/Lib/r/r.swg b/Lib/r/r.swg index b70d80581..121797e33 100644 --- a/Lib/r/r.swg +++ b/Lib/r/r.swg @@ -144,11 +144,11 @@ SWIG_InitializeModule(0); $1 = %reinterpret_cast(INTEGER($input), $1_ltype); } -%typemap(in,noblock=1,fragment="SWIG_strdup") char* { +%typemap(in,noblock=1,fragment="SWIG_strdup") char * { $1 = %reinterpret_cast(SWIG_strdup(CHAR(STRING_ELT($input, 0))), $1_ltype); } -%typemap(freearg,noblock=1) char* { +%typemap(freearg,noblock=1) char * { free($1); } @@ -189,7 +189,7 @@ else strcpy($1, ""); %} -%typemap(out,noblock=1) char* +%typemap(out,noblock=1) char * { $result = $1 ? Rf_mkString(%reinterpret_cast($1,char *)) : R_NilValue; } %typemap(in,noblock=1) char {