Arne Goedeke wrote:
- support for reading/writing signed integers. Not sure about the api,
maybe the current methods should could be renamed read_uint/add_uint instead? The -1 return value also would not work for the read_ methods. The add_int variants actually work fine for signed ints already, due to the cast to unsigned. sprintf()/sscanf() could be used currently but are quite slow.
Why not simply let the read_int*() functions return all signed values instead? This would: - Increase the chance of the return value fitting into the native int type. - Still allow easy reading of unsigned values (if one insists) by masking the output at the reader end by the appriopriate amount of bits (which is more efficient in Pike than creating a signed from an unsigned).