comparison libinterp/octave-value/ov-struct.cc @ 18384:bd9d34f28b0f stable

Use std::ostream::fail instead of unsafe implicit bool conversion (bug #41335) * ls-mat4.cc (save_mat_binary_data): Use std::ostream::fail to return stream status instead of unsafe implicit bool conversion. * ov-cell.cc (octave_cell::save_ascii) Likewise. * ov-class.cc (octave_class::save_ascii, octave_class::save_binary) Likewise. * ov-fcn-handle.cc (octave_fcn_handle::save_ascii, octave_fcn_handle::save_binary) Likewise. * ov-struct.cc (octave_struct::save_ascii, octave_struct::save_binary, octave_scalar_struct::save_ascii, octave_scalar_struct::save_binary) Likewise.
author Mike Miller <mtmiller@ieee.org>
date Sat, 25 Jan 2014 01:02:12 -0500
parents 175b392e91fe
children bcd71a2531d3 ea0d4dea1a17
comparison
equal deleted inserted replaced
18383:abc78c10acb6 18384:bd9d34f28b0f
767 octave_value val = map.contents (key); 767 octave_value val = map.contents (key);
768 768
769 bool b = save_ascii_data (os, val, key, false, 0); 769 bool b = save_ascii_data (os, val, key, false, 0);
770 770
771 if (! b) 771 if (! b)
772 return os; 772 return ! os.fail ();
773 } 773 }
774 774
775 return true; 775 return true;
776 } 776 }
777 777
892 octave_value val = map.contents (key); 892 octave_value val = map.contents (key);
893 893
894 bool b = save_binary_data (os, val, key, "", 0, save_as_floats); 894 bool b = save_binary_data (os, val, key, "", 0, save_as_floats);
895 895
896 if (! b) 896 if (! b)
897 return os; 897 return ! os.fail ();
898 } 898 }
899 899
900 return true; 900 return true;
901 } 901 }
902 902
1469 octave_value val = map.contents (key); 1469 octave_value val = map.contents (key);
1470 1470
1471 bool b = save_ascii_data (os, val, key, false, 0); 1471 bool b = save_ascii_data (os, val, key, false, 0);
1472 1472
1473 if (! b) 1473 if (! b)
1474 return os; 1474 return ! os.fail ();
1475 } 1475 }
1476 1476
1477 return true; 1477 return true;
1478 } 1478 }
1479 1479
1553 octave_value val = map.contents (key); 1553 octave_value val = map.contents (key);
1554 1554
1555 bool b = save_binary_data (os, val, key, "", 0, save_as_floats); 1555 bool b = save_binary_data (os, val, key, "", 0, save_as_floats);
1556 1556
1557 if (! b) 1557 if (! b)
1558 return os; 1558 return ! os.fail ();
1559 } 1559 }
1560 1560
1561 return true; 1561 return true;
1562 } 1562 }
1563 1563