annotate src/gripes.cc @ 15466:d174210ce1ec stable

use ' instead of ` in error messages, warnings and most comments * intro.txi, io.txi, munge-texi.cc, octave.texi, cmd-edit.cc, data-conv.cc, file-ops.cc, glob-match.h, kpse.cc, oct-env.cc, oct-locbuf.h, oct-md5.cc, oct-rand.cc, general/interp2.m, doc.m, get_first_help_sentence.m, help.m, print_usage.m, __additional_help_message__.m, type.m, unimplemented.m, which.m, cast.m, dir.m, license.m, mkoctfile.m, recycle.m, tempdir.m, optimset.m, pkg/pkg.m, closereq.m, colstyle.m, __fltk_print__.m, __gnuplot_print__.m, __go_draw_figure__.m, __pie__.m, __pltopt__.m, __print_parse_opts__.m, uigetdir.m, uigetfile.m, uiputfile.m, stft.m, mean.m, anova.m, cor_test.m, t_test_regression.m, __magick_read__.cc, dlmread.cc, schur.cc, data.cc, debug.cc, defun-dld.h, defun.cc, defun.h, dynamic-ld.cc, error.cc, error.h, gl-render.cc, graphics.cc, gripes.cc, input.cc, lex.ll, load-path.cc, load-save.cc, ls-hdf5.cc, ls-mat-ascii.cc, ls-mat4.cc, ls-mat5.cc, ls-oct-ascii.cc, ls-oct-binary.cc, oct-hist.cc, oct-parse.yy, oct-stream.cc, oct-stream.h, octave.cc, ov-base-diag.cc, ov-base.cc, ov-class.cc, ov-colon.h, ov-struct.cc, ov-typeinfo.cc, ov.cc, pager.cc, pr-output.cc, pt-binop.cc, pt-eval.cc, pt-id.cc, pt-idx.cc, pt-misc.cc, pt-unop.cc, symtab.cc, symtab.h, toplev.cc, txt-eng-ft.cc, utils.cc, variables.cc, test_eval-catch.m, test_try.m: Use ' instead of ` in error messages, warnings, and most comments.
author John W. Eaton <jwe@octave.org>
date Mon, 01 Oct 2012 17:18:49 -0400
parents 72c96de7a403
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 11590
diff changeset
3 Copyright (C) 1993-2012 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 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: 6890
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: 6890
diff changeset
10 option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 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: 6890
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: 6890
diff changeset
19 <http://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
240
a99f28f5e351 [project @ 1993-11-30 20:24:36 by jwe]
jwe
parents: 143
diff changeset
23 #ifdef HAVE_CONFIG_H
1192
b6360f2d4fa6 [project @ 1995-03-30 21:38:35 by jwe]
jwe
parents: 1009
diff changeset
24 #include <config.h>
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26
5755
ca40a52804f4 [project @ 2006-04-12 18:27:47 by jwe]
jwe
parents: 5602
diff changeset
27 #include "defun.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1315
diff changeset
28 #include "error.h"
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
29 #include "gripes.h"
4055
7690958e7726 [project @ 2002-08-18 01:56:58 by jwe]
jwe
parents: 3523
diff changeset
30 #include "oct-obj.h"
5755
ca40a52804f4 [project @ 2006-04-12 18:27:47 by jwe]
jwe
parents: 5602
diff changeset
31 #include "utils.h"
ca40a52804f4 [project @ 2006-04-12 18:27:47 by jwe]
jwe
parents: 5602
diff changeset
32
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
33 void
2078
4d43f960f2cc [project @ 1996-04-24 01:12:59 by jwe]
jwe
parents: 1996
diff changeset
34 gripe_not_supported (const char *fcn)
4d43f960f2cc [project @ 1996-04-24 01:12:59 by jwe]
jwe
parents: 1996
diff changeset
35 {
4d43f960f2cc [project @ 1996-04-24 01:12:59 by jwe]
jwe
parents: 1996
diff changeset
36 error ("%s: not supported on this system", fcn);
4d43f960f2cc [project @ 1996-04-24 01:12:59 by jwe]
jwe
parents: 1996
diff changeset
37 }
4d43f960f2cc [project @ 1996-04-24 01:12:59 by jwe]
jwe
parents: 1996
diff changeset
38
4d43f960f2cc [project @ 1996-04-24 01:12:59 by jwe]
jwe
parents: 1996
diff changeset
39 void
6890
b2b7526a5772 [project @ 2007-09-12 20:14:35 by jwe]
jwe
parents: 5943
diff changeset
40 gripe_not_implemented (const char *fcn)
b2b7526a5772 [project @ 2007-09-12 20:14:35 by jwe]
jwe
parents: 5943
diff changeset
41 {
b2b7526a5772 [project @ 2007-09-12 20:14:35 by jwe]
jwe
parents: 5943
diff changeset
42 error ("%s: not implemented", fcn);
b2b7526a5772 [project @ 2007-09-12 20:14:35 by jwe]
jwe
parents: 5943
diff changeset
43 }
b2b7526a5772 [project @ 2007-09-12 20:14:35 by jwe]
jwe
parents: 5943
diff changeset
44
b2b7526a5772 [project @ 2007-09-12 20:14:35 by jwe]
jwe
parents: 5943
diff changeset
45 void
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
46 gripe_string_invalid (void)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
47 {
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2847
diff changeset
48 error ("std::string constant used in invalid context");
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
49 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
50
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
51 void
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
52 gripe_range_invalid (void)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
53 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
54 error ("range constant used in invalid context");
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
55 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
56
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
57 void
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
58 gripe_nonconformant (void)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
59 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
60 error ("nonconformant matrices");
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
61 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
62
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
63 void
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 4452
diff changeset
64 gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2)
143
7849db4b6dbc [project @ 1993-10-04 02:36:45 by jwe]
jwe
parents: 1
diff changeset
65 {
7849db4b6dbc [project @ 1993-10-04 02:36:45 by jwe]
jwe
parents: 1
diff changeset
66 error ("nonconformant matrices (op1 is %dx%d, op2 is %dx%d)",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
67 r1, c1, r2, c2);
143
7849db4b6dbc [project @ 1993-10-04 02:36:45 by jwe]
jwe
parents: 1
diff changeset
68 }
7849db4b6dbc [project @ 1993-10-04 02:36:45 by jwe]
jwe
parents: 1
diff changeset
69
7849db4b6dbc [project @ 1993-10-04 02:36:45 by jwe]
jwe
parents: 1
diff changeset
70 void
2799
d77a29e4387f [project @ 1997-03-08 08:35:56 by jwe]
jwe
parents: 2676
diff changeset
71 gripe_empty_arg (const char *name, bool is_error)
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
72 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
73 if (is_error)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
74 error ("%s: empty matrix is invalid as an argument", name);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
75 else
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
76 warning ("%s: argument is empty matrix", name);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
77 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
78
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
79 void
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
80 gripe_square_matrix_required (const char *name)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
81 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
82 error ("%s: argument must be a square matrix", name);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
83 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
84
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
85 void
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
86 gripe_user_supplied_eval (const char *name)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
87 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
88 error ("%s: evaluation of user-supplied function failed", name);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
89 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
90
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
91 void
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
92 gripe_user_returned_invalid (const char *name)
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
93 {
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
94 error ("%s: user-supplied function returned invalid value", name);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
95 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
96
628
aecbe369233b [project @ 1994-08-19 13:27:51 by jwe]
jwe
parents: 620
diff changeset
97 void
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2847
diff changeset
98 gripe_invalid_conversion (const std::string& from, const std::string& to)
628
aecbe369233b [project @ 1994-08-19 13:27:51 by jwe]
jwe
parents: 620
diff changeset
99 {
2374
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
100 error ("invalid conversion from %s to %s", from.c_str (), to.c_str ());
628
aecbe369233b [project @ 1994-08-19 13:27:51 by jwe]
jwe
parents: 620
diff changeset
101 }
aecbe369233b [project @ 1994-08-19 13:27:51 by jwe]
jwe
parents: 620
diff changeset
102
777
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
103 void
1416
8b976f7c0aa8 [project @ 1995-09-15 10:17:34 by jwe]
jwe
parents: 1352
diff changeset
104 gripe_invalid_value_specified (const char *name)
8b976f7c0aa8 [project @ 1995-09-15 10:17:34 by jwe]
jwe
parents: 1352
diff changeset
105 {
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
106 warning ("invalid value specified for '%s'", name);
1416
8b976f7c0aa8 [project @ 1995-09-15 10:17:34 by jwe]
jwe
parents: 1352
diff changeset
107 }
8b976f7c0aa8 [project @ 1995-09-15 10:17:34 by jwe]
jwe
parents: 1352
diff changeset
108
8b976f7c0aa8 [project @ 1995-09-15 10:17:34 by jwe]
jwe
parents: 1352
diff changeset
109 void
777
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
110 gripe_2_or_3_dim_plot (void)
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
111 {
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
112 error ("plot: can only plot in 2 or 3 dimensions");
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
113 }
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
114
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
115 void
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
116 gripe_unrecognized_float_fmt (void)
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
117 {
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
118 error ("unrecognized floating point format requested");
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
119 }
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
120
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
121 void
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
122 gripe_unrecognized_data_fmt (const char *warn_for)
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
123 {
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
124 error ("%s: unrecognized data format requested", warn_for);
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
125 }
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
126
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
127 void
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
128 gripe_data_conversion (const char *from, const char *to)
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
129 {
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
130 error ("unable to convert from %s to %s format", from, to);
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
131 }
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
132
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
133 void
5602
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5307
diff changeset
134 gripe_wrong_type_arg (const char *name, const char *s, bool is_error)
2668
0d865ef7478f [project @ 1997-02-13 18:21:47 by jwe]
jwe
parents: 2374
diff changeset
135 {
2799
d77a29e4387f [project @ 1997-03-08 08:35:56 by jwe]
jwe
parents: 2676
diff changeset
136 if (is_error)
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
137 error ("%s: wrong type argument '%s'", name, s);
2799
d77a29e4387f [project @ 1997-03-08 08:35:56 by jwe]
jwe
parents: 2676
diff changeset
138 else
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
139 warning ("%s: wrong type argument '%s'", name, s);
5602
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5307
diff changeset
140 }
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5307
diff changeset
141
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5307
diff changeset
142 void
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5307
diff changeset
143 gripe_wrong_type_arg (const char *name, const std::string& s, bool is_error)
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5307
diff changeset
144 {
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5307
diff changeset
145 gripe_wrong_type_arg (name, s.c_str (), is_error);
2668
0d865ef7478f [project @ 1997-02-13 18:21:47 by jwe]
jwe
parents: 2374
diff changeset
146 }
0d865ef7478f [project @ 1997-02-13 18:21:47 by jwe]
jwe
parents: 2374
diff changeset
147
0d865ef7478f [project @ 1997-02-13 18:21:47 by jwe]
jwe
parents: 2374
diff changeset
148 void
2799
d77a29e4387f [project @ 1997-03-08 08:35:56 by jwe]
jwe
parents: 2676
diff changeset
149 gripe_wrong_type_arg (const char *name, const octave_value& tc,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
150 bool is_error)
777
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
151 {
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2847
diff changeset
152 std::string type = tc.type_name ();
2799
d77a29e4387f [project @ 1997-03-08 08:35:56 by jwe]
jwe
parents: 2676
diff changeset
153
5602
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5307
diff changeset
154 gripe_wrong_type_arg (name, type, is_error);
777
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
155 }
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
156
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
157 void
7352
fab9bc33b949 [project @ 2008-01-07 18:54:45 by jwe]
jwe
parents: 7017
diff changeset
158 gripe_wrong_type_arg (const std::string& name, const octave_value& tc,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
159 bool is_error)
7352
fab9bc33b949 [project @ 2008-01-07 18:54:45 by jwe]
jwe
parents: 7017
diff changeset
160 {
fab9bc33b949 [project @ 2008-01-07 18:54:45 by jwe]
jwe
parents: 7017
diff changeset
161 gripe_wrong_type_arg (name.c_str (), tc, is_error);
fab9bc33b949 [project @ 2008-01-07 18:54:45 by jwe]
jwe
parents: 7017
diff changeset
162 }
fab9bc33b949 [project @ 2008-01-07 18:54:45 by jwe]
jwe
parents: 7017
diff changeset
163
fab9bc33b949 [project @ 2008-01-07 18:54:45 by jwe]
jwe
parents: 7017
diff changeset
164 void
2086
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 2078
diff changeset
165 gripe_wrong_type_arg_for_unary_op (const octave_value& op)
777
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
166 {
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2847
diff changeset
167 std::string type = op.type_name ();
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
168 error ("invalid operand '%s' for unary operator", type.c_str ());
777
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
169 }
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
170
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
171 void
2086
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 2078
diff changeset
172 gripe_wrong_type_arg_for_binary_op (const octave_value& op)
777
a2f9d3fd720c [project @ 1994-10-07 14:01:53 by jwe]
jwe
parents: 628
diff changeset
173 {
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2847
diff changeset
174 std::string type = op.type_name ();
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
175 error ("invalid operand '%s' for binary operator", type.c_str ());
2374
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
176 }
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
177
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
178 void
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5758
diff changeset
179 gripe_implicit_conversion (const char *id, const char *from, const char *to)
2374
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
180 {
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5758
diff changeset
181 warning_with_id (id, "implicit conversion from %s to %s", from, to);
2374
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
182 }
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
183
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
184 void
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5758
diff changeset
185 gripe_implicit_conversion (const std::string& id,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
186 const std::string& from, const std::string& to)
4452
f3c21a1d1c62 [project @ 2003-07-09 23:20:18 by jwe]
jwe
parents: 4055
diff changeset
187 {
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5758
diff changeset
188 warning_with_id (id.c_str (),
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
189 "implicit conversion from %s to %s",
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
190 from.c_str (), to.c_str ());
4452
f3c21a1d1c62 [project @ 2003-07-09 23:20:18 by jwe]
jwe
parents: 4055
diff changeset
191 }
f3c21a1d1c62 [project @ 2003-07-09 23:20:18 by jwe]
jwe
parents: 4055
diff changeset
192
f3c21a1d1c62 [project @ 2003-07-09 23:20:18 by jwe]
jwe
parents: 4055
diff changeset
193 void
2374
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
194 gripe_divide_by_zero (void)
67a18ae969d4 [project @ 1996-10-12 00:27:01 by jwe]
jwe
parents: 2086
diff changeset
195 {
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5758
diff changeset
196 warning_with_id ("Octave:divide-by-zero", "division by zero");
5755
ca40a52804f4 [project @ 2006-04-12 18:27:47 by jwe]
jwe
parents: 5602
diff changeset
197 }
ca40a52804f4 [project @ 2006-04-12 18:27:47 by jwe]
jwe
parents: 5602
diff changeset
198
8012
63dbb85452cc fix extern decls in .cc files
John W. Eaton <jwe@octave.org>
parents: 8011
diff changeset
199 void
5943
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5781
diff changeset
200 gripe_logical_conversion (void)
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5781
diff changeset
201 {
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5781
diff changeset
202 warning_with_id ("Octave:logical-conversion",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
203 "value not equal to 1 or 0 converted to logical 1");
5943
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5781
diff changeset
204 }
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5781
diff changeset
205
8012
63dbb85452cc fix extern decls in .cc files
John W. Eaton <jwe@octave.org>
parents: 8011
diff changeset
206 void
8011
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7998
diff changeset
207 gripe_library_execution_error (void)
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7998
diff changeset
208 {
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7998
diff changeset
209 octave_exception_state = octave_no_exception;
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7998
diff changeset
210
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7998
diff changeset
211 if (! error_state)
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7998
diff changeset
212 error ("caught execution error in library function");
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7998
diff changeset
213 }
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7998
diff changeset
214
8039
cd90e2842080 Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents: 8012
diff changeset
215 void
8579
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
216 gripe_invalid_inquiry_subscript (void)
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
217 {
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
218 error ("invalid dimension inquiry of a non-existent value");
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
219 }
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
220
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
221 void
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
222 gripe_indexed_cs_list (void)
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
223 {
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
224 error ("a cs-list cannot be further indexed");
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
225 }
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8039
diff changeset
226
9588
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
227 void
10030
83bb2a78c07d improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents: 9588
diff changeset
228 gripe_nonbraced_cs_list_assignment (void)
83bb2a78c07d improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents: 9588
diff changeset
229 {
11590
4ced6b90fffb style fixes for warning and error messages in source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
230 error ("invalid assignment to cs-list outside multiple assignment");
10030
83bb2a78c07d improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents: 9588
diff changeset
231 }
83bb2a78c07d improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents: 9588
diff changeset
232
83bb2a78c07d improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents: 9588
diff changeset
233 void
9588
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
234 gripe_warn_complex_cmp (void)
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
235 {
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
236 warning_with_id ("Octave:matlab-incompatible",
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
237 "potential Matlab compatibility problem: comparing complex numbers");
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
238 }