1
|
1 // gripes.cc -*- C++ -*- |
|
2 /* |
|
3 |
1009
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
1
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
21 |
|
22 */ |
|
23 |
240
|
24 #ifdef HAVE_CONFIG_H |
1192
|
25 #include <config.h> |
1
|
26 #endif |
|
27 |
1352
|
28 #include "error.h" |
1
|
29 #include "gripes.h" |
1742
|
30 #include "pt-const.h" |
1
|
31 |
|
32 void |
|
33 gripe_string_invalid (void) |
|
34 { |
|
35 error ("string constant used in invalid context"); |
|
36 } |
|
37 |
|
38 void |
|
39 gripe_range_invalid (void) |
|
40 { |
|
41 error ("range constant used in invalid context"); |
|
42 } |
|
43 |
|
44 void |
|
45 gripe_nonconformant (void) |
|
46 { |
|
47 error ("nonconformant matrices"); |
|
48 } |
|
49 |
|
50 void |
143
|
51 gripe_nonconformant (int r1, int c1, int r2, int c2) |
|
52 { |
|
53 error ("nonconformant matrices (op1 is %dx%d, op2 is %dx%d)", |
|
54 r1, c1, r2, c2); |
|
55 } |
|
56 |
|
57 void |
1
|
58 gripe_empty_arg (const char *name, int is_error) |
|
59 { |
|
60 if (is_error) |
|
61 error ("%s: empty matrix is invalid as an argument", name); |
|
62 else |
|
63 warning ("%s: argument is empty matrix", name); |
|
64 } |
|
65 |
|
66 void |
|
67 gripe_square_matrix_required (const char *name) |
|
68 { |
|
69 error ("%s: argument must be a square matrix", name); |
|
70 } |
|
71 |
|
72 void |
|
73 gripe_user_supplied_eval (const char *name) |
|
74 { |
|
75 error ("%s: evaluation of user-supplied function failed", name); |
|
76 } |
|
77 |
|
78 void |
|
79 gripe_user_returned_invalid (const char *name) |
|
80 { |
|
81 error ("%s: user-supplied function returned invalid value", name); |
|
82 } |
|
83 |
628
|
84 void |
|
85 gripe_invalid_conversion (const char *from, const char *to) |
|
86 { |
|
87 error ("invalid conversion from %s to %s", from, to); |
|
88 } |
|
89 |
777
|
90 void |
1416
|
91 gripe_invalid_value_specified (const char *name) |
|
92 { |
|
93 warning ("invalid value specified for `%s'", name); |
|
94 } |
|
95 |
|
96 void |
777
|
97 gripe_2_or_3_dim_plot (void) |
|
98 { |
|
99 error ("plot: can only plot in 2 or 3 dimensions"); |
|
100 } |
|
101 |
|
102 void |
|
103 gripe_unrecognized_float_fmt (void) |
|
104 { |
|
105 error ("unrecognized floating point format requested"); |
|
106 } |
|
107 |
|
108 void |
|
109 gripe_unrecognized_data_fmt (const char *warn_for) |
|
110 { |
|
111 error ("%s: unrecognized data format requested", warn_for); |
|
112 } |
|
113 |
|
114 void |
|
115 gripe_data_conversion (const char *from, const char *to) |
|
116 { |
|
117 error ("unable to convert from %s to %s format", from, to); |
|
118 } |
|
119 |
|
120 void |
|
121 gripe_wrong_type_arg (const char *name, const tree_constant& tc) |
|
122 { |
|
123 error ("%s: wrong type argument `%s'", name, tc.type_as_string ()); |
|
124 } |
|
125 |
|
126 void |
|
127 gripe_wrong_type_arg_for_unary_op (const tree_constant& op) |
|
128 { |
|
129 error ("invalid operand `%s' for unary operator", op.type_as_string ()); |
|
130 } |
|
131 |
|
132 void |
|
133 gripe_wrong_type_arg_for_binary_op (const tree_constant& op) |
|
134 { |
|
135 error ("invalid operand `%s' for binary operator", op.type_as_string ()); |
|
136 } |
|
137 |
1
|
138 /* |
|
139 ;;; Local Variables: *** |
|
140 ;;; mode: C++ *** |
|
141 ;;; page-delimiter: "^/\\*" *** |
|
142 ;;; End: *** |
|
143 */ |