Mercurial > hg > octave-nkf
annotate examples/unwinddemo.cc @ 16626:4adf3c4bd80b
GUI compilation fixes for MSVC.
* libgui/src/dialog.cc (ACTIVE_ESCAPE, RICH_TEXT): Define to 1 instead of
"true".
(LINE_EDIT_FOLLOWS_PROMPT): Define to 0 instead of "false".
*libgui/src/settings-dialog.cc (settings_dialog::read_lexer_settings,
settings_dialog::read_workspace_colors,
settings_dialog::read_terminal_colors): Use QVector instead of C99
non-constant arrays.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Mon, 06 May 2013 20:02:08 -0400 |
parents | 1b48b209a8d6 |
children | be41c30bcb44 |
rev | line source |
---|---|
6572 | 1 #include <octave/oct.h> |
2 #include <octave/unwind-prot.h> | |
3 | |
4 void | |
5 err_hand (const char *fmt, ...) | |
6 { | |
7 // Do nothing!! | |
8 } | |
9 | |
10 DEFUN_DLD (unwinddemo, args, nargout, "Unwind Demo") | |
11 { | |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
12 int nargin = args.length (); |
6572 | 13 octave_value retval; |
14 if (nargin < 2) | |
15 print_usage (); | |
16 else | |
17 { | |
18 NDArray a = args(0).array_value (); | |
19 NDArray b = args(1).array_value (); | |
20 | |
21 if (! error_state) | |
22 { | |
23 unwind_protect::begin_frame ("Funwinddemo"); | |
12174 | 24 unwind_protect_ptr (current_liboctave_warning_handler); |
14855
1b48b209a8d6
maint: Use Octave coding conventions for coddling parentheses in examples directory
Rik <octave@nomad.inbox5.com>
parents:
14846
diff
changeset
|
25 set_liboctave_warning_handler (err_hand); |
6572 | 26 retval = octave_value (quotient (a, b)); |
27 unwind_protect::run_frame ("Funwinddemo"); | |
28 } | |
29 } | |
30 return retval; | |
31 } |