aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-14 17:48:49 -0400
committerDeterminant <[email protected]>2019-06-14 17:48:49 -0400
commitdeb478812b259cdf586ab5105284ae227fe42680 (patch)
tree27c4958c02656a53347d155593f06c69cb99716f
parenta9005311f51a250db26c966ce5fd4a7ba7d76fab (diff)
...
-rw-r--r--src/stream.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/stream.cpp b/src/stream.cpp
index fe715f1..1d88785 100644
--- a/src/stream.cpp
+++ b/src/stream.cpp
@@ -79,15 +79,15 @@ bool datastream_put_data(datastream_t *self, const uint8_t *base, size_t size) {
return true;
}
-uint8_t datastream_get_u8(datastream_t *self, bool *succ) { uint8_t val; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
-uint16_t datastream_get_u16(datastream_t *self, bool *succ) { uint16_t val; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
-uint32_t datastream_get_u32(datastream_t *self, bool *succ) { uint32_t val; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
-uint64_t datastream_get_u64(datastream_t *self, bool *succ) { uint64_t val; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
-
-int8_t datastream_get_i8(datastream_t *self, bool *succ) {int8_t val; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
-int16_t datastream_get_i16(datastream_t *self, bool *succ) {int16_t val; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
-int32_t datastream_get_i32(datastream_t *self, bool *succ) {int32_t val; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
-int64_t datastream_get_i64(datastream_t *self, bool *succ) {int64_t val; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
+uint8_t datastream_get_u8(datastream_t *self, bool *succ) { uint8_t val = 0; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
+uint16_t datastream_get_u16(datastream_t *self, bool *succ) { uint16_t val = 0; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
+uint32_t datastream_get_u32(datastream_t *self, bool *succ) { uint32_t val = 0; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
+uint64_t datastream_get_u64(datastream_t *self, bool *succ) { uint64_t val = 0; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
+
+int8_t datastream_get_i8(datastream_t *self, bool *succ) {int8_t val = 0; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
+int16_t datastream_get_i16(datastream_t *self, bool *succ) {int16_t val = 0; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
+int32_t datastream_get_i32(datastream_t *self, bool *succ) {int32_t val = 0; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
+int64_t datastream_get_i64(datastream_t *self, bool *succ) {int64_t val = 0; try {*self >> val;} catch (...) {*succ = false;} *succ = true; return val; }
const uint8_t *datastream_get_data_inplace(datastream_t *self, size_t len) {
try {