This commit is contained in:
Hongze Cheng 2022-01-02 09:42:57 +00:00
parent e4252065d1
commit ec03a0eb8f
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,11 @@
#include "encode.h" #include "encode.h"
#if __STDC_VERSION__ >= 201112L
static_assert(sizeof(float) == sizeof(uint32_t), "sizeof(float) must equal to sizeof(uint32_t)");
static_assert(sizeof(double) == sizeof(uint64_t), "sizeof(double) must equal to sizeof(uint64_t)");
#endif
void tCoderInit(SCoder* pCoder, td_endian_t endian, uint8_t* data, int32_t size, td_coder_t type) { void tCoderInit(SCoder* pCoder, td_endian_t endian, uint8_t* data, int32_t size, td_coder_t type) {
if (type == TD_ENCODER) { if (type == TD_ENCODER) {
if (data == NULL) size = 0; if (data == NULL) size = 0;