annotate liboctave/cruft/misc/f77-fcn.c @ 20595:c1a6c31ac29a

eliminate more simple uses of error_state * ov-classdef.cc: Eliminate simple uses of error_state.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Oct 2015 00:20:02 -0400
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2544
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
1 /*
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
3 Copyright (C) 1996-2015 John W. Eaton
2544
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
4
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
6
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
10 option) any later version.
2544
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
11
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
15 for more details.
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
16
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
19 <http://www.gnu.org/licenses/>.
2544
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
20
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
21 */
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
22
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
24 #include <config.h>
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
25 #endif
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
26
3808
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
27 #include <stdlib.h>
2544
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
28 #include <string.h>
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
29
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
30 #include "f77-fcn.h"
4153
6b96ce9f5743 [project @ 2002-11-06 20:38:49 by jwe]
jwe
parents: 3963
diff changeset
31 #include "quit.h"
3808
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
32 #include "lo-error.h"
2544
a33bbd3fadd7 [project @ 1996-11-20 05:09:29 by jwe]
jwe
parents:
diff changeset
33
3808
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
34 /* All the STOP statements in the Fortran routines have been replaced
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
35 with a call to XSTOPX.
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
36
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
37 XSTOPX jumps back to the entry point for the Fortran function that
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
38 called us. Then the calling function should do whatever cleanup
3809
ec80db02d436 [project @ 2001-03-28 14:03:16 by jwe]
jwe
parents: 3808
diff changeset
39 is necessary. */
3808
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
40
4552
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4153
diff changeset
41 F77_RET_T
4801
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
42 #if defined (F77_USES_CRAY_CALLING_CONVENTION)
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
43 F77_FUNC (xstopx, XSTOPX) (octave_cray_ftn_ch_dsc desc)
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
44 #elif defined (F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION)
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
45 F77_FUNC (xstopx, XSTOPX) (const char *s, int slen)
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
46 #else
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
47 F77_FUNC (xstopx, XSTOPX) (const char *s, long slen)
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
48 #endif
3808
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
49 {
4801
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
50 #if defined (F77_USES_CRAY_CALLING_CONVENTION)
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
51 const char *s = desc.const_ptr = ptr_arg;
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
52 unsigned long slen = desc.mask.len;
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
53 #endif
b022780ac0b4 [project @ 2004-02-25 04:40:54 by jwe]
jwe
parents: 4552
diff changeset
54
4153
6b96ce9f5743 [project @ 2002-11-06 20:38:49 by jwe]
jwe
parents: 3963
diff changeset
55 f77_exception_encountered = 1;
6b96ce9f5743 [project @ 2002-11-06 20:38:49 by jwe]
jwe
parents: 3963
diff changeset
56
3809
ec80db02d436 [project @ 2001-03-28 14:03:16 by jwe]
jwe
parents: 3808
diff changeset
57 /* Skip printing message if it is just a single blank character. */
ec80db02d436 [project @ 2001-03-28 14:03:16 by jwe]
jwe
parents: 3808
diff changeset
58 if (s && slen > 0 && ! (slen == 1 && *s == ' '))
3963
05485f532599 [project @ 2002-06-27 15:31:39 by jwe]
jwe
parents: 3950
diff changeset
59 (*current_liboctave_error_handler) ("%.*s", slen, s);
3808
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
60
4153
6b96ce9f5743 [project @ 2002-11-06 20:38:49 by jwe]
jwe
parents: 3963
diff changeset
61 octave_jump_to_enclosing_context ();
4552
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4153
diff changeset
62
15127
87411930d6c4 avoid "function declared 'noreturn' has a return statement" warning.
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
63 F77_NORETURN (0)
3808
885b296ef83a [project @ 2001-03-27 19:12:58 by jwe]
jwe
parents: 2847
diff changeset
64 }