comparison libinterp/octave-value/ov-struct.cc @ 20619:eef93a493ce3

use new cell_value method to handle value extraction errors * cellfun.cc, ov-class.cc, ov-struct.cc, ov-usr-fcn.cc: Use new cell_value method.
author John W. Eaton <jwe@octave.org>
date Fri, 09 Oct 2015 14:43:36 -0400
parents c41595061186
children
comparison
equal deleted inserted replaced
20618:e5986cba4ca8 20619:eef93a493ce3
797 = read_text_data (is, std::string (), dummy, t2, j); 797 = read_text_data (is, std::string (), dummy, t2, j);
798 798
799 if (!is) 799 if (!is)
800 break; 800 break;
801 801
802 Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); 802 Cell tcell = t2.is_cell () ? t2.cell_value ("load: internal error loading struct elements") : Cell (t2);
803
804 if (error_state)
805 {
806 error ("load: internal error loading struct elements");
807 return false;
808 }
809 803
810 m.setfield (nm, tcell); 804 m.setfield (nm, tcell);
811 } 805 }
812 806
813 if (is) 807 if (is)
925 dummy, t2, doc); 919 dummy, t2, doc);
926 920
927 if (!is) 921 if (!is)
928 break; 922 break;
929 923
930 Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); 924 Cell tcell = t2.is_cell () ? t2.cell_value ("load: internal error loading struct elements") : Cell (t2);
931
932 if (error_state)
933 {
934 error ("load: internal error loading struct elements");
935 return false;
936 }
937 925
938 m.setfield (nm, tcell); 926 m.setfield (nm, tcell);
939 } 927 }
940 928
941 if (is) 929 if (is)
1028 && (retval2 = H5Giterate (loc_id, name, &current_item, 1016 && (retval2 = H5Giterate (loc_id, name, &current_item,
1029 hdf5_read_next_data, &dsub)) > 0) 1017 hdf5_read_next_data, &dsub)) > 0)
1030 { 1018 {
1031 octave_value t2 = dsub.tc; 1019 octave_value t2 = dsub.tc;
1032 1020
1033 Cell tcell = t2.is_cell () ? t2.cell_value () : Cell (t2); 1021 Cell tcell = t2.is_cell () ? t2.cell_value ("load: internal error loading struct elements") : Cell (t2);
1034
1035 if (error_state)
1036 {
1037 error ("load: internal error loading struct elements");
1038 return false;
1039 }
1040 1022
1041 m.setfield (dsub.name, tcell); 1023 m.setfield (dsub.name, tcell);
1042 1024
1043 } 1025 }
1044 1026