add sproto double type (#1221)

Co-authored-by: zixun <lvzxiun@gmail.com>
This commit is contained in:
子熏
2020-07-27 17:57:55 +08:00
committed by GitHub
parent f2b1bd7319
commit bfc19ee7b9
4 changed files with 29 additions and 2 deletions

View File

@@ -944,6 +944,7 @@ sproto_encode(const struct sproto_type *st, void * buffer, int size, sproto_call
args.type = type;
args.index = 0;
switch(type) {
case SPROTO_DOUBLE:
case SPROTO_TINTEGER:
case SPROTO_TBOOLEAN: {
union {
@@ -1177,6 +1178,7 @@ sproto_decode(const struct sproto_type *st, const void * data, int size, sproto_
}
} else {
switch (f->type) {
case SPROTO_DOUBLE:
case SPROTO_TINTEGER: {
uint32_t sz = todword(currentdata);
if (sz == SIZEOF_INT32) {