comparison src/ls-mat4.cc @ 9377:610bf90fce2a

update unwind_protect usage everywhere
author Jaroslav Hajek <highegg@gmail.com>
date Tue, 23 Jun 2009 08:22:13 +0200
parents eb63fbe60fab
children 2cd940306a06
comparison
equal deleted inserted replaced
9376:d58086453171 9377:610bf90fce2a
490 os.write (reinterpret_cast<char *> (&name_len), 4); 490 os.write (reinterpret_cast<char *> (&name_len), 4);
491 os << name << '\0'; 491 os << name << '\0';
492 492
493 if (tc.is_string ()) 493 if (tc.is_string ())
494 { 494 {
495 unwind_protect::begin_frame ("save_mat_binary_data"); 495 unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame ();
496 496
497 charMatrix chm = tc.char_matrix_value (); 497 charMatrix chm = tc.char_matrix_value ();
498 498
499 octave_idx_type nrow = chm.rows (); 499 octave_idx_type nrow = chm.rows ();
500 octave_idx_type ncol = chm.cols (); 500 octave_idx_type ncol = chm.cols ();
509 for (octave_idx_type j = 0; j < ncol; j++) 509 for (octave_idx_type j = 0; j < ncol; j++)
510 buf[j*nrow+i] = static_cast<double> (*s++ & 0x00FF); 510 buf[j*nrow+i] = static_cast<double> (*s++ & 0x00FF);
511 } 511 }
512 os.write (reinterpret_cast<char *> (buf), nrow*ncol*sizeof(double)); 512 os.write (reinterpret_cast<char *> (buf), nrow*ncol*sizeof(double));
513 513
514 unwind_protect::run_frame ("save_mat_binary_data"); 514 unwind_protect::run_frame (uwp_frame);
515 } 515 }
516 else if (tc.is_range ()) 516 else if (tc.is_range ())
517 { 517 {
518 Range r = tc.range_value (); 518 Range r = tc.range_value ();
519 double base = r.base (); 519 double base = r.base ();