rename file
This commit is contained in:
parent
40ba2bd866
commit
3f5f6b9f2e
|
@ -20,7 +20,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "encode.h"
|
||||
#include "tencode.h"
|
||||
#include "taosdef.h"
|
||||
#include "taoserror.h"
|
||||
#include "tarray.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#ifndef _TD_UTIL_ENCODE_H_
|
||||
#define _TD_UTIL_ENCODE_H_
|
||||
|
||||
#include "tfreelist.h"
|
||||
#include "tcoding.h"
|
||||
#include "tfreelist.h"
|
||||
#include "tmacro.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -71,11 +71,11 @@ typedef struct {
|
|||
TD_SLIST(SCoderNode) stack;
|
||||
} SCoder;
|
||||
|
||||
#define TD_CODER_POS(CODER) ((CODER)->pos)
|
||||
#define TD_CODER_CURRENT(CODER) ((CODER)->data + (CODER)->pos)
|
||||
#define TD_CODER_MOVE_POS(CODER, MOVE) ((CODER)->pos += (MOVE))
|
||||
#define TD_CODER_POS(CODER) ((CODER)->pos)
|
||||
#define TD_CODER_CURRENT(CODER) ((CODER)->data + (CODER)->pos)
|
||||
#define TD_CODER_MOVE_POS(CODER, MOVE) ((CODER)->pos += (MOVE))
|
||||
#define TD_CODER_CHECK_CAPACITY_FAILED(CODER, EXPSIZE) (((CODER)->size - (CODER)->pos) < (EXPSIZE))
|
||||
#define TCODER_MALLOC(SIZE, CODER) TFL_MALLOC(SIZE, &((CODER)->fl))
|
||||
#define TCODER_MALLOC(SIZE, CODER) TFL_MALLOC(SIZE, &((CODER)->fl))
|
||||
|
||||
void tCoderInit(SCoder* pCoder, td_endian_t endian, uint8_t* data, int32_t size, td_coder_t type);
|
||||
void tCoderClear(SCoder* pCoder);
|
|
@ -31,21 +31,21 @@ typedef struct SCleanupAction {
|
|||
uint16_t reserved;
|
||||
void* func;
|
||||
union {
|
||||
void* Ptr;
|
||||
bool Bool;
|
||||
char Char;
|
||||
int8_t Int8;
|
||||
uint8_t Uint8;
|
||||
int16_t Int16;
|
||||
uint16_t Uint16;
|
||||
int Int;
|
||||
unsigned int Uint;
|
||||
int32_t Int32;
|
||||
uint32_t Uint32;
|
||||
int64_t Int64;
|
||||
uint64_t Uint64;
|
||||
float Float;
|
||||
double Double;
|
||||
void* Ptr;
|
||||
bool Bool;
|
||||
char Char;
|
||||
int8_t Int8;
|
||||
uint8_t Uint8;
|
||||
int16_t Int16;
|
||||
uint16_t Uint16;
|
||||
int32_t Int;
|
||||
uint32_t Uint;
|
||||
int32_t Int32;
|
||||
uint32_t Uint32;
|
||||
int64_t Int64;
|
||||
uint64_t Uint64;
|
||||
float Float;
|
||||
double Double;
|
||||
} arg1, arg2;
|
||||
} SCleanupAction;
|
||||
|
||||
|
@ -67,7 +67,7 @@ typedef struct SExceptionNode {
|
|||
void cleanupPush_void_ptr_ptr(bool failOnly, void* func, void* arg1, void* arg2);
|
||||
void cleanupPush_void_ptr_bool(bool failOnly, void* func, void* arg1, bool arg2);
|
||||
void cleanupPush_void_ptr(bool failOnly, void* func, void* arg);
|
||||
void cleanupPush_int_int(bool failOnly, void* func, int arg);
|
||||
void cleanupPush_int_int(bool failOnly, void* func, int32_t arg);
|
||||
void cleanupPush_void(bool failOnly, void* func);
|
||||
void cleanupPush_int_ptr(bool failOnly, void* func, void* arg);
|
||||
|
||||
|
@ -81,11 +81,11 @@ bool cleanupExceedLimit();
|
|||
#define CLEANUP_PUSH_VOID_PTR_BOOL(failOnly, func, arg1, arg2) \
|
||||
cleanupPush_void_ptr_bool((failOnly), (void*)(func), (void*)(arg1), (bool)(arg2))
|
||||
#define CLEANUP_PUSH_VOID_PTR(failOnly, func, arg) cleanupPush_void_ptr((failOnly), (void*)(func), (void*)(arg))
|
||||
#define CLEANUP_PUSH_INT_INT(failOnly, func, arg) cleanupPush_void_ptr((failOnly), (void*)(func), (int)(arg))
|
||||
#define CLEANUP_PUSH_INT_INT(failOnly, func, arg) cleanupPush_void_ptr((failOnly), (void*)(func), (int32_t)(arg))
|
||||
#define CLEANUP_PUSH_VOID(failOnly, func) cleanupPush_void((failOnly), (void*)(func))
|
||||
#define CLEANUP_PUSH_INT_PTR(failOnly, func, arg) cleanupPush_int_ptr((failOnly), (void*)(func), (void*)(arg))
|
||||
#define CLEANUP_PUSH_FREE(failOnly, arg) cleanupPush_void_ptr((failOnly), free, (void*)(arg))
|
||||
#define CLEANUP_PUSH_CLOSE(failOnly, arg) cleanupPush_int_int((failOnly), close, (int)(arg))
|
||||
#define CLEANUP_PUSH_CLOSE(failOnly, arg) cleanupPush_int_int((failOnly), close, (int32_t)(arg))
|
||||
#define CLEANUP_PUSH_FCLOSE(failOnly, arg) cleanupPush_int_ptr((failOnly), fclose, (void*)(arg))
|
||||
|
||||
#define CLEANUP_GET_ANCHOR() cleanupGetActionCount()
|
||||
|
@ -106,7 +106,7 @@ void exceptionThrow(int32_t code);
|
|||
exceptionNode.maxCleanupAction = (maxCleanupActions) > 0 ? (maxCleanupActions) : 1; \
|
||||
exceptionNode.cleanupActions = cleanupActions; \
|
||||
exceptionPushNode(&exceptionNode); \
|
||||
int caughtException = setjmp(exceptionNode.jb); \
|
||||
int32_t caughtException = setjmp(exceptionNode.jb); \
|
||||
if (caughtException == 0)
|
||||
|
||||
#define CATCH(code) \
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "encode.h"
|
||||
#include "tencode.h"
|
||||
|
||||
#if __STDC_VERSION__ >= 201112L
|
||||
static_assert(sizeof(float) == sizeof(uint32_t), "sizeof(float) must equal to sizeof(uint32_t)");
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "encode.h"
|
||||
#include "tencode.h"
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wshift-count-overflow"
|
||||
|
|
Loading…
Reference in New Issue