Mercurial > hg > octave-nkf
comparison src/ls-utils.cc @ 11468:e1edf0ba3bcb
Yet another single precision matlab file fix
author | David Bateman <dbateman@free.fr> |
---|---|
date | Sun, 09 Jan 2011 21:24:43 +0100 |
parents | cd96d29c5efa |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11467:7aab48b6e903 | 11468:e1edf0ba3bcb |
---|---|
56 // else if (max_val <= 2147483647L && min_val >= -2147483647L) | 56 // else if (max_val <= 2147483647L && min_val >= -2147483647L) |
57 // st = LS_INT; | 57 // st = LS_INT; |
58 | 58 |
59 return st; | 59 return st; |
60 } | 60 } |
61 | |
62 save_type | |
63 get_save_type (float /* max_val */, float /* min_val */) | |
64 { | |
65 save_type st = LS_FLOAT; | |
66 | |
67 // Matlab doesn't seem to load the UINT32 type correctly, so let's | |
68 // avoid it (and the other unsigned types, even though they may not | |
69 // have the same problem. And apparently, there are problems with | |
70 // other smaller types as well. If we avoid them all, then maybe we | |
71 // will avoid problems. Unfortunately, we won't be able to save | |
72 // space... | |
73 | |
74 // if (max_val < 256 && min_val > -1) | |
75 // st = LS_U_CHAR; | |
76 // else if (max_val < 65536 && min_val > -1) | |
77 // st = LS_U_SHORT; | |
78 // else if (max_val < 4294967295UL && min_val > -1) | |
79 // st = LS_U_INT; | |
80 // else if (max_val < 128 && min_val >= -128) | |
81 // st = LS_CHAR; | |
82 // else if (max_val < 32768 && min_val >= -32768) | |
83 // st = LS_SHORT; | |
84 // else if (max_val <= 2147483647L && min_val >= -2147483647L) | |
85 // st = LS_INT; | |
86 | |
87 return st; | |
88 } |