Fixes to Octave examples

- rename example modules from "example" to "swigexample", to avoid a
  warning from shadowing the Octave built-in function "example"
- remove deprecated "static" Makefile targets: there is no longer
  an option to build static Octave modules in the Examples Makefile
- emacs whitespace cleanup run on all files
This commit is contained in:
Karl Wette 2013-05-08 22:43:49 +02:00 • committed by william
commit c28d0c6c80
63 changed files with 211 additions and 345 deletions

View file

@ -1,10 +1,10 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS =
TARGET = example
CXXSRCS =
TARGET = swigexample
INTERFACE = example.i
LIBS = -lm
SWIGOPT =
SWIGOPT =
check: build
$(MAKE) -f $(TOP)/Makefile octave_run
@ -13,9 +13,5 @@ build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='myoctave' INTERFACE='$(INTERFACE)' octave_cpp_static
clean:
$(MAKE) -f $(TOP)/Makefile octave_clean

View file

@ -25,7 +25,7 @@ public:
ComplexVal operator-() const {
return ComplexVal(-rpart, -ipart);
}
double re() const { return rpart; }
double im() const { return ipart; }
};

View file

@ -1,5 +1,5 @@
/* File : example.i */
%module example
%module swigexample
#pragma SWIG nowarn=SWIGWARN_IGNORE_OPERATOR_EQ
%{
#include "example.h"

View file

@ -1,8 +1,8 @@
# Operator overloading example
example
swigexample
a = example.ComplexVal(2,3);
b = example.ComplexVal(-5,10);
a = swigexample.ComplexVal(2,3);
b = swigexample.ComplexVal(-5,10);
printf("a = %s\n",disp(a));
printf("b = %s\n",disp(b));
@ -12,7 +12,7 @@ printf("c = %s\n",disp(c));
printf("a*b = %s\n",disp(a*b));
printf("a-c = %s\n",disp(a-c));
e = example.ComplexVal(a-c);
e = swigexample.ComplexVal(a-c);
printf("e = %s\n",disp(e));
# Big expression