summaryrefslogtreecommitdiff
path: root/Examples/octave/contract
diff options
context:
space:
mode:
authorKarl Wette <karl.wette@ligo.org>2013-05-08 22:43:49 +0200
committerwilliam <william@nadia.(none)>2013-05-08 22:44:40 +0100
commitc28d0c6c80c5254eeedcd63e0942f154dcb60871 (patch)
tree1a04abfb6914ca9ed4072ee42f100f033ecd71a4 /Examples/octave/contract
parent7964ebe34fb12f0e61fea48ca501dee2ca0f7246 (diff)
downloadswig-c28d0c6c80c5254eeedcd63e0942f154dcb60871.tar.gz
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
Diffstat (limited to 'Examples/octave/contract')
-rw-r--r--Examples/octave/contract/Makefile6
-rw-r--r--Examples/octave/contract/example.c2
-rw-r--r--Examples/octave/contract/example.i2
-rw-r--r--Examples/octave/contract/runme.m11
4 files changed, 7 insertions, 14 deletions
diff --git a/Examples/octave/contract/Makefile b/Examples/octave/contract/Makefile
index 2c33cd3d8..73e3962ed 100644
--- a/Examples/octave/contract/Makefile
+++ b/Examples/octave/contract/Makefile
@@ -1,7 +1,7 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
-TARGET = example
+TARGET = swigexample
INTERFACE = example.i
check: build
@@ -11,9 +11,5 @@ build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave
-static:
- $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
- TARGET='myoctave' INTERFACE='$(INTERFACE)' octave_static
-
clean:
$(MAKE) -f $(TOP)/Makefile octave_clean
diff --git a/Examples/octave/contract/example.c b/Examples/octave/contract/example.c
index 1a644543f..fbdc054cd 100644
--- a/Examples/octave/contract/example.c
+++ b/Examples/octave/contract/example.c
@@ -19,5 +19,3 @@ int fact(int n) {
if (n <= 0) return 1;
return n*fact(n-1);
}
-
-
diff --git a/Examples/octave/contract/example.i b/Examples/octave/contract/example.i
index 8fd1a80af..78c459efc 100644
--- a/Examples/octave/contract/example.i
+++ b/Examples/octave/contract/example.i
@@ -1,5 +1,5 @@
/* File : example.i */
-%module example
+%module swigexample
%contract gcd(int x, int y) {
require:
diff --git a/Examples/octave/contract/runme.m b/Examples/octave/contract/runme.m
index 62b72320b..fa36bbe10 100644
--- a/Examples/octave/contract/runme.m
+++ b/Examples/octave/contract/runme.m
@@ -1,22 +1,21 @@
# file: runme.m
-example
+swigexample
# Call our gcd() function
x = 42;
y = 105;
-g = example.gcd(x,y);
+g = swigexample.gcd(x,y);
printf("The gcd of %d and %d is %d\n",x,y,g);
# Manipulate the Foo global variable
# Output its current value
-printf("Foo = %f\n", example.cvar.Foo);
+printf("Foo = %f\n", swigexample.cvar.Foo);
# Change its value
-example.cvar.Foo = 3.1415926;
+swigexample.cvar.Foo = 3.1415926;
# See if the change took effect
-printf("Foo = %f\n", example.cvar.Foo);
-
+printf("Foo = %f\n", swigexample.cvar.Foo);