# HG changeset patch # User jwe # Date 1051817087 0 # Node ID 868983234164835313270232a56112e41f451b82 # Parent 018fb50a84e95b0005accaf5acf7115b009c1850 [project @ 2003-05-01 19:24:47 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,7 @@ * load-save.cc (save_ascii_data): If saving a range with non-integer base, limit, or increment, save as matrix instead. + (get_save_type): Avoid unsigned types. 2003-04-30 John W. Eaton diff --git a/src/load-save.cc b/src/load-save.cc --- a/src/load-save.cc +++ b/src/load-save.cc @@ -3484,7 +3484,7 @@ if (open) return true; continue; - + case '\\': if (i == len - 1) return false; @@ -3505,13 +3505,19 @@ { save_type st = LS_DOUBLE; - if (max_val < 256 && min_val > -1) - st = LS_U_CHAR; - else if (max_val < 65536 && min_val > -1) - st = LS_U_SHORT; - else if (max_val < 4294967295UL && min_val > -1) - st = LS_U_INT; - else if (max_val < 128 && min_val >= -128) + // Matlab doesn't seem to load the UINT32 type correctly, so let's + // avoid it (and the other unsigned types, even though they may not + // have the same problem. + + // if (max_val < 256 && min_val > -1) + // st = LS_U_CHAR; + // else if (max_val < 65536 && min_val > -1) + // st = LS_U_SHORT; + // else if (max_val < 4294967295UL && min_val > -1) + // st = LS_U_INT; + // else + + if (max_val < 128 && min_val >= -128) st = LS_CHAR; else if (max_val < 32768 && min_val >= -32768) st = LS_SHORT;