Fix some typos in docs and examples and make the code look nicer.
This commit is contained in:
parent
70801d47d1
commit
8985c34809
45 changed files with 717 additions and 717 deletions
|
|
@ -224,7 +224,7 @@ For example:
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
%define ARRAYHELPER(type,name)
|
||||
%define ARRAYHELPER(type, name)
|
||||
%inline %{
|
||||
type *new_ ## name (int nitems) {
|
||||
return (type *) malloc(sizeof(type)*nitems);
|
||||
|
|
@ -269,7 +269,7 @@ SWIG-1.3.12 and newer releases support variadic preprocessor macros. For exampl
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
#define DEBUGF(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
|
||||
#define DEBUGF(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -281,12 +281,12 @@ macros defined using <tt>%define</tt>.
|
|||
|
||||
<p>
|
||||
SWIG allows a variable number of arguments to be empty. However, this often results
|
||||
in an extra comma (,) and syntax error in the resulting expansion. For example:
|
||||
in an extra comma (, ) and syntax error in the resulting expansion. For example:
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
<pre>
|
||||
DEBUGF("hello"); --> fprintf(stderr,"hello",);
|
||||
DEBUGF("hello"); --> fprintf(stderr, "hello", );
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -296,7 +296,7 @@ To get rid of the extra comma, use <tt>##</tt> like this:
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
#define DEBUGF(fmt,...) fprintf(stderr,fmt, ##__VA_ARGS__)
|
||||
#define DEBUGF(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -306,7 +306,7 @@ SWIG also supports GNU-style variadic macros. For example:
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
#define DEBUGF(fmt, args...) fprintf(stdout,fmt,args)
|
||||
#define DEBUGF(fmt, args...) fprintf(stdout, fmt, args)
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -425,7 +425,7 @@ whereas
|
|||
<div class="code">
|
||||
<pre>
|
||||
#define SWIG_macro(CAST) (CAST)$input
|
||||
%typemap(in,noblock=1) Int {$1= SWIG_macro(int);}
|
||||
%typemap(in, noblock=1) Int {$1= SWIG_macro(int);}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue