Mercurial > hg > octave-jordi
comparison src/ov-cx-mat.cc @ 5828:22e23bee74c8
[project @ 2006-05-23 06:05:14 by jwe]
author | jwe |
---|---|
date | Tue, 23 May 2006 06:05:14 +0000 |
parents | faafc2d98b8d |
children | c20eb7330d13 |
comparison
equal
deleted
inserted
replaced
5827:1fe78adb91bc | 5828:22e23bee74c8 |
---|---|
380 dim_vector d = dims (); | 380 dim_vector d = dims (); |
381 if (d.length() < 1) | 381 if (d.length() < 1) |
382 return false; | 382 return false; |
383 | 383 |
384 // Use negative value for ndims to differentiate with old format!! | 384 // Use negative value for ndims to differentiate with old format!! |
385 FOUR_BYTE_INT tmp = - d.length(); | 385 int32_t tmp = - d.length(); |
386 os.write (reinterpret_cast<char *> (&tmp), 4); | 386 os.write (reinterpret_cast<char *> (&tmp), 4); |
387 for (int i = 0; i < d.length (); i++) | 387 for (int i = 0; i < d.length (); i++) |
388 { | 388 { |
389 tmp = d(i); | 389 tmp = d(i); |
390 os.write (reinterpret_cast<char *> (&tmp), 4); | 390 os.write (reinterpret_cast<char *> (&tmp), 4); |
419 bool | 419 bool |
420 octave_complex_matrix::load_binary (std::istream& is, bool swap, | 420 octave_complex_matrix::load_binary (std::istream& is, bool swap, |
421 oct_mach_info::float_format fmt) | 421 oct_mach_info::float_format fmt) |
422 { | 422 { |
423 char tmp; | 423 char tmp; |
424 FOUR_BYTE_INT mdims; | 424 int32_t mdims; |
425 if (! is.read (reinterpret_cast<char *> (&mdims), 4)) | 425 if (! is.read (reinterpret_cast<char *> (&mdims), 4)) |
426 return false; | 426 return false; |
427 if (swap) | 427 if (swap) |
428 swap_bytes<4> (&mdims); | 428 swap_bytes<4> (&mdims); |
429 if (mdims < 0) | 429 if (mdims < 0) |
430 { | 430 { |
431 mdims = - mdims; | 431 mdims = - mdims; |
432 FOUR_BYTE_INT di; | 432 int32_t di; |
433 dim_vector dv; | 433 dim_vector dv; |
434 dv.resize (mdims); | 434 dv.resize (mdims); |
435 | 435 |
436 for (int i = 0; i < mdims; i++) | 436 for (int i = 0; i < mdims; i++) |
437 { | 437 { |
465 return false; | 465 return false; |
466 matrix = m; | 466 matrix = m; |
467 } | 467 } |
468 else | 468 else |
469 { | 469 { |
470 FOUR_BYTE_INT nr, nc; | 470 int32_t nr, nc; |
471 nr = mdims; | 471 nr = mdims; |
472 if (! is.read (reinterpret_cast<char *> (&nc), 4)) | 472 if (! is.read (reinterpret_cast<char *> (&nc), 4)) |
473 return false; | 473 return false; |
474 if (swap) | 474 if (swap) |
475 swap_bytes<4> (&nc); | 475 swap_bytes<4> (&nc); |