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 $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp
static:
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myoctave' INTERFACE='$(INTERFACE)' octave_cpp_static
clean:
$(MAKE) -f $(TOP)/Makefile octave_clean

View file

@ -1,5 +1,5 @@
/* File : example.i */
%module example
%module swigexample
/* A few preprocessor macros */
@ -23,5 +23,3 @@
%constant int iconst = 37;
%constant double fconst = 3.14;

View file

@ -1,29 +1,25 @@
# file: runme.m
example
swigexample
printf("ICONST = %i (should be 42)\n", example.ICONST);
printf("FCONST = %f (should be 2.1828)\n", example.FCONST);
printf("CCONST = %s (should be 'x')\n", example.CCONST);
printf("CCONST2 = %s (this should be on a new line)\n", example.CCONST2);
printf("SCONST = %s (should be 'Hello World')\n", example.SCONST);
printf("SCONST2 = %s (should be '\"Hello World\"')\n", example.SCONST2);
printf("EXPR = %f (should be 48.5484)\n", example.EXPR);
printf("iconst = %i (should be 37)\n", example.iconst);
printf("fconst = %f (should be 3.14)\n", example.fconst);
printf("ICONST = %i (should be 42)\n", swigexample.ICONST);
printf("FCONST = %f (should be 2.1828)\n", swigexample.FCONST);
printf("CCONST = %s (should be 'x')\n", swigexample.CCONST);
printf("CCONST2 = %s (this should be on a new line)\n", swigexample.CCONST2);
printf("SCONST = %s (should be 'Hello World')\n", swigexample.SCONST);
printf("SCONST2 = %s (should be '\"Hello World\"')\n", swigexample.SCONST2);
printf("EXPR = %f (should be 48.5484)\n", swigexample.EXPR);
printf("iconst = %i (should be 37)\n", swigexample.iconst);
printf("fconst = %f (should be 3.14)\n", swigexample.fconst);
try
printf("EXTERN = %s (Arg! This shouldn't printf(anything)\n", example.EXTERN);
printf("EXTERN = %s (Arg! This shouldn't printf(anything)\n", swigexample.EXTERN);
catch
printf("EXTERN isn't defined (good)\n");
end_try_catch
try
printf("FOO = %i (Arg! This shouldn't printf(anything)\n", example.FOO);
printf("FOO = %i (Arg! This shouldn't printf(anything)\n", swigexample.FOO);
catch
printf("FOO isn't defined (good)\n");
end_try_catch