Mercurial > octave
comparison libinterp/corefcn/xpow.cc @ 21024:6176560b03d9
maint: Remove return stmts after gripe function calls.
* gripes.h: Mark gripe functions which call error() wwith GCC_ATTR_NORETURN.
* jit-typeinfo.cc (gripe_bad_result): Mark function with GCC_ATTR_NORETURN.
* load-save.cc (gripe_file_open): Mark function with GCC_ATTR_NORETURN.
* ov-base.cc (gripe_indexed_assignment, gripe_assign_conversion_failed,
gripe_no_conversion): Mark functions with GCC_ATTR_NORETURN.
* ov-class.cc (gripe_invalid_index1, gripe_invalid_index_for_assignment,
gripe_invalid_index_type): Mark functions with GCC_ATTR_NORETURN.
* ov-classdef.h (gripe_invalid_object): Mark function with GCC_ATTR_NORETURN.
* ov.cc (gripe_cat_op, gripe_cat_op_conv): Mark functions with
GCC_ATTR_NORETURN.
* balance.cc, det.cc, eig.cc, hess.cc, inv.cc, jit-typeinfo.cc, load-save.cc,
qz.cc, schur.cc, sparse-xdiv.cc, sparse-xpow.cc, sylvester.cc, xdiv.cc,
xpow.cc, symrcm.cc, ov-base.cc, ov-classdef.h, ov-cs-list.cc, ov-flt-re-mat.cc,
ov-re-mat.cc, ov-re-sparse.cc, ov.cc, op-int.h, op-fs-fs.cc, ops.h:
Remove statements that occur after a gripe function which does not return.
* op-cs-cs.cc, op-dms-template.cc, op-fcs-fcs.cc, op-s-s.cc : Add newline
between gripe and return statement for readability.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 01 Jan 2016 13:58:45 -0800 |
parents | b9d4c3615e89 |
children | 5e00ed38a58b |
comparison
equal
deleted
inserted
replaced
21023:ec532a439c6f | 21024:6176560b03d9 |
---|---|
811 | 811 |
812 octave_idx_type b_nr = b.rows (); | 812 octave_idx_type b_nr = b.rows (); |
813 octave_idx_type b_nc = b.cols (); | 813 octave_idx_type b_nc = b.cols (); |
814 | 814 |
815 if (nr != b_nr || nc != b_nc) | 815 if (nr != b_nr || nc != b_nc) |
816 { | 816 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); |
817 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); | |
818 return octave_value (); | |
819 } | |
820 | 817 |
821 int convert_to_complex = 0; | 818 int convert_to_complex = 0; |
822 for (octave_idx_type j = 0; j < nc; j++) | 819 for (octave_idx_type j = 0; j < nc; j++) |
823 for (octave_idx_type i = 0; i < nr; i++) | 820 for (octave_idx_type i = 0; i < nr; i++) |
824 { | 821 { |
894 | 891 |
895 octave_idx_type b_nr = b.rows (); | 892 octave_idx_type b_nr = b.rows (); |
896 octave_idx_type b_nc = b.cols (); | 893 octave_idx_type b_nc = b.cols (); |
897 | 894 |
898 if (nr != b_nr || nc != b_nc) | 895 if (nr != b_nr || nc != b_nc) |
899 { | 896 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); |
900 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); | |
901 return octave_value (); | |
902 } | |
903 | 897 |
904 ComplexMatrix result (nr, nc); | 898 ComplexMatrix result (nr, nc); |
905 | 899 |
906 for (octave_idx_type j = 0; j < nc; j++) | 900 for (octave_idx_type j = 0; j < nc; j++) |
907 for (octave_idx_type i = 0; i < nr; i++) | 901 for (octave_idx_type i = 0; i < nr; i++) |
1035 | 1029 |
1036 octave_idx_type b_nr = b.rows (); | 1030 octave_idx_type b_nr = b.rows (); |
1037 octave_idx_type b_nc = b.cols (); | 1031 octave_idx_type b_nc = b.cols (); |
1038 | 1032 |
1039 if (nr != b_nr || nc != b_nc) | 1033 if (nr != b_nr || nc != b_nc) |
1040 { | 1034 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); |
1041 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); | |
1042 return octave_value (); | |
1043 } | |
1044 | 1035 |
1045 ComplexMatrix result (nr, nc); | 1036 ComplexMatrix result (nr, nc); |
1046 | 1037 |
1047 for (octave_idx_type j = 0; j < nc; j++) | 1038 for (octave_idx_type j = 0; j < nc; j++) |
1048 for (octave_idx_type i = 0; i < nr; i++) | 1039 for (octave_idx_type i = 0; i < nr; i++) |
1086 | 1077 |
1087 octave_idx_type b_nr = b.rows (); | 1078 octave_idx_type b_nr = b.rows (); |
1088 octave_idx_type b_nc = b.cols (); | 1079 octave_idx_type b_nc = b.cols (); |
1089 | 1080 |
1090 if (nr != b_nr || nc != b_nc) | 1081 if (nr != b_nr || nc != b_nc) |
1091 { | 1082 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); |
1092 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); | |
1093 return octave_value (); | |
1094 } | |
1095 | 1083 |
1096 ComplexMatrix result (nr, nc); | 1084 ComplexMatrix result (nr, nc); |
1097 | 1085 |
1098 for (octave_idx_type j = 0; j < nc; j++) | 1086 for (octave_idx_type j = 0; j < nc; j++) |
1099 for (octave_idx_type i = 0; i < nr; i++) | 1087 for (octave_idx_type i = 0; i < nr; i++) |
1271 return octave_value (bsxfun_pow (ComplexNDArray (xa), xb)); | 1259 return octave_value (bsxfun_pow (ComplexNDArray (xa), xb)); |
1272 else | 1260 else |
1273 return octave_value (bsxfun_pow (xa, xb)); | 1261 return octave_value (bsxfun_pow (xa, xb)); |
1274 } | 1262 } |
1275 else | 1263 else |
1276 { | 1264 gripe_nonconformant ("operator .^", a_dims, b_dims); |
1277 gripe_nonconformant ("operator .^", a_dims, b_dims); | |
1278 return octave_value (); | |
1279 } | |
1280 } | 1265 } |
1281 | 1266 |
1282 int len = a.numel (); | 1267 int len = a.numel (); |
1283 | 1268 |
1284 bool convert_to_complex = false; | 1269 bool convert_to_complex = false; |
1353 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) | 1338 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) |
1354 { | 1339 { |
1355 return bsxfun_pow (a, b); | 1340 return bsxfun_pow (a, b); |
1356 } | 1341 } |
1357 else | 1342 else |
1358 { | 1343 gripe_nonconformant ("operator .^", a_dims, b_dims); |
1359 gripe_nonconformant ("operator .^", a_dims, b_dims); | |
1360 return octave_value (); | |
1361 } | |
1362 } | 1344 } |
1363 | 1345 |
1364 ComplexNDArray result (a_dims); | 1346 ComplexNDArray result (a_dims); |
1365 | 1347 |
1366 for (octave_idx_type i = 0; i < a.numel (); i++) | 1348 for (octave_idx_type i = 0; i < a.numel (); i++) |
1452 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) | 1434 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) |
1453 { | 1435 { |
1454 return bsxfun_pow (a, b); | 1436 return bsxfun_pow (a, b); |
1455 } | 1437 } |
1456 else | 1438 else |
1457 { | 1439 gripe_nonconformant ("operator .^", a_dims, b_dims); |
1458 gripe_nonconformant ("operator .^", a_dims, b_dims); | |
1459 return octave_value (); | |
1460 } | |
1461 } | 1440 } |
1462 | 1441 |
1463 ComplexNDArray result (a_dims); | 1442 ComplexNDArray result (a_dims); |
1464 | 1443 |
1465 for (octave_idx_type i = 0; i < a.numel (); i++) | 1444 for (octave_idx_type i = 0; i < a.numel (); i++) |
1502 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) | 1481 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) |
1503 { | 1482 { |
1504 return bsxfun_pow (a, b); | 1483 return bsxfun_pow (a, b); |
1505 } | 1484 } |
1506 else | 1485 else |
1507 { | 1486 gripe_nonconformant ("operator .^", a_dims, b_dims); |
1508 gripe_nonconformant ("operator .^", a_dims, b_dims); | |
1509 return octave_value (); | |
1510 } | |
1511 } | 1487 } |
1512 | 1488 |
1513 ComplexNDArray result (a_dims); | 1489 ComplexNDArray result (a_dims); |
1514 | 1490 |
1515 for (octave_idx_type i = 0; i < a.numel (); i++) | 1491 for (octave_idx_type i = 0; i < a.numel (); i++) |
2217 | 2193 |
2218 octave_idx_type b_nr = b.rows (); | 2194 octave_idx_type b_nr = b.rows (); |
2219 octave_idx_type b_nc = b.cols (); | 2195 octave_idx_type b_nc = b.cols (); |
2220 | 2196 |
2221 if (nr != b_nr || nc != b_nc) | 2197 if (nr != b_nr || nc != b_nc) |
2222 { | 2198 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); |
2223 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); | |
2224 return octave_value (); | |
2225 } | |
2226 | 2199 |
2227 int convert_to_complex = 0; | 2200 int convert_to_complex = 0; |
2228 for (octave_idx_type j = 0; j < nc; j++) | 2201 for (octave_idx_type j = 0; j < nc; j++) |
2229 for (octave_idx_type i = 0; i < nr; i++) | 2202 for (octave_idx_type i = 0; i < nr; i++) |
2230 { | 2203 { |
2300 | 2273 |
2301 octave_idx_type b_nr = b.rows (); | 2274 octave_idx_type b_nr = b.rows (); |
2302 octave_idx_type b_nc = b.cols (); | 2275 octave_idx_type b_nc = b.cols (); |
2303 | 2276 |
2304 if (nr != b_nr || nc != b_nc) | 2277 if (nr != b_nr || nc != b_nc) |
2305 { | 2278 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); |
2306 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); | |
2307 return octave_value (); | |
2308 } | |
2309 | 2279 |
2310 FloatComplexMatrix result (nr, nc); | 2280 FloatComplexMatrix result (nr, nc); |
2311 | 2281 |
2312 for (octave_idx_type j = 0; j < nc; j++) | 2282 for (octave_idx_type j = 0; j < nc; j++) |
2313 for (octave_idx_type i = 0; i < nr; i++) | 2283 for (octave_idx_type i = 0; i < nr; i++) |
2401 | 2371 |
2402 octave_idx_type b_nr = b.rows (); | 2372 octave_idx_type b_nr = b.rows (); |
2403 octave_idx_type b_nc = b.cols (); | 2373 octave_idx_type b_nc = b.cols (); |
2404 | 2374 |
2405 if (nr != b_nr || nc != b_nc) | 2375 if (nr != b_nr || nc != b_nc) |
2406 { | 2376 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); |
2407 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); | |
2408 return octave_value (); | |
2409 } | |
2410 | 2377 |
2411 FloatComplexMatrix result (nr, nc); | 2378 FloatComplexMatrix result (nr, nc); |
2412 | 2379 |
2413 for (octave_idx_type j = 0; j < nc; j++) | 2380 for (octave_idx_type j = 0; j < nc; j++) |
2414 for (octave_idx_type i = 0; i < nr; i++) | 2381 for (octave_idx_type i = 0; i < nr; i++) |
2452 | 2419 |
2453 octave_idx_type b_nr = b.rows (); | 2420 octave_idx_type b_nr = b.rows (); |
2454 octave_idx_type b_nc = b.cols (); | 2421 octave_idx_type b_nc = b.cols (); |
2455 | 2422 |
2456 if (nr != b_nr || nc != b_nc) | 2423 if (nr != b_nr || nc != b_nc) |
2457 { | 2424 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); |
2458 gripe_nonconformant ("operator .^", nr, nc, b_nr, b_nc); | |
2459 return octave_value (); | |
2460 } | |
2461 | 2425 |
2462 FloatComplexMatrix result (nr, nc); | 2426 FloatComplexMatrix result (nr, nc); |
2463 | 2427 |
2464 for (octave_idx_type j = 0; j < nc; j++) | 2428 for (octave_idx_type j = 0; j < nc; j++) |
2465 for (octave_idx_type i = 0; i < nr; i++) | 2429 for (octave_idx_type i = 0; i < nr; i++) |
2637 return octave_value (bsxfun_pow (FloatComplexNDArray (xa), xb)); | 2601 return octave_value (bsxfun_pow (FloatComplexNDArray (xa), xb)); |
2638 else | 2602 else |
2639 return octave_value (bsxfun_pow (xa, xb)); | 2603 return octave_value (bsxfun_pow (xa, xb)); |
2640 } | 2604 } |
2641 else | 2605 else |
2642 { | 2606 gripe_nonconformant ("operator .^", a_dims, b_dims); |
2643 gripe_nonconformant ("operator .^", a_dims, b_dims); | |
2644 return octave_value (); | |
2645 } | |
2646 } | 2607 } |
2647 | 2608 |
2648 int len = a.numel (); | 2609 int len = a.numel (); |
2649 | 2610 |
2650 bool convert_to_complex = false; | 2611 bool convert_to_complex = false; |
2719 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) | 2680 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) |
2720 { | 2681 { |
2721 return bsxfun_pow (a, b); | 2682 return bsxfun_pow (a, b); |
2722 } | 2683 } |
2723 else | 2684 else |
2724 { | 2685 gripe_nonconformant ("operator .^", a_dims, b_dims); |
2725 gripe_nonconformant ("operator .^", a_dims, b_dims); | |
2726 return octave_value (); | |
2727 } | |
2728 } | 2686 } |
2729 | 2687 |
2730 FloatComplexNDArray result (a_dims); | 2688 FloatComplexNDArray result (a_dims); |
2731 | 2689 |
2732 for (octave_idx_type i = 0; i < a.numel (); i++) | 2690 for (octave_idx_type i = 0; i < a.numel (); i++) |
2818 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) | 2776 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) |
2819 { | 2777 { |
2820 return bsxfun_pow (a, b); | 2778 return bsxfun_pow (a, b); |
2821 } | 2779 } |
2822 else | 2780 else |
2823 { | 2781 gripe_nonconformant ("operator .^", a_dims, b_dims); |
2824 gripe_nonconformant ("operator .^", a_dims, b_dims); | |
2825 return octave_value (); | |
2826 } | |
2827 } | 2782 } |
2828 | 2783 |
2829 FloatComplexNDArray result (a_dims); | 2784 FloatComplexNDArray result (a_dims); |
2830 | 2785 |
2831 for (octave_idx_type i = 0; i < a.numel (); i++) | 2786 for (octave_idx_type i = 0; i < a.numel (); i++) |
2868 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) | 2823 if (is_valid_bsxfun ("operator .^", a_dims, b_dims)) |
2869 { | 2824 { |
2870 return bsxfun_pow (a, b); | 2825 return bsxfun_pow (a, b); |
2871 } | 2826 } |
2872 else | 2827 else |
2873 { | 2828 gripe_nonconformant ("operator .^", a_dims, b_dims); |
2874 gripe_nonconformant ("operator .^", a_dims, b_dims); | |
2875 return octave_value (); | |
2876 } | |
2877 } | 2829 } |
2878 | 2830 |
2879 FloatComplexNDArray result (a_dims); | 2831 FloatComplexNDArray result (a_dims); |
2880 | 2832 |
2881 for (octave_idx_type i = 0; i < a.numel (); i++) | 2833 for (octave_idx_type i = 0; i < a.numel (); i++) |