On 08/02/16 13:37, Iván Matellanes wrote:
+static istream* istream_internal_read_unsigned_integer(istream *this, void *p, int size) +{
- /* size: 0 => short, 1 => int, 2 => long */
- ios *base = istream_get_ios(this);
- char buffer[16];
- int num_base;
- LONG min_value[3] = {SHRT_MIN, INT_MIN, LONG_MIN};
- ULONG umax_value[3] = {USHRT_MAX, UINT_MAX, ULONG_MAX}, tmp;
Shouldn't min_value be equal to 0?
How about changing the helper functions to have following prototypes: static LONG istream_internal_read_integer(istream *this, LONG min_value, LONG max_value); and static ULONG istream_internal_read_unsigned_integer(istream *this, ULONG max_value);
I think the code will be nicer this way.
Thanks, Piotr