提交 4cbfc4f8 编写于 作者: S Shengliang Guan

minor changes

上级 869d3c17
......@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_VERSION_H
#define _TD_UTIL_VERSION_H
#ifndef _TD_UTIL_VERSION_H_
#define _TD_UTIL_VERSION_H_
#ifdef __cplusplus
extern "C" {
......@@ -28,4 +28,4 @@ int32_t taosCheckVersionCompatible(int32_t clientVer, int32_t serverVer, int32_t
}
#endif
#endif /*_TD_UTIL_VERSION_H*/
#endif /*_TD_UTIL_VERSION_H_*/
......@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_WORKER_H
#define _TD_UTIL_WORKER_H
#ifndef _TD_UTIL_WORKER_H_
#define _TD_UTIL_WORKER_H_
#include "tqueue.h"
#ifdef __cplusplus
......@@ -34,25 +34,25 @@ typedef struct SQWorkerPool {
int32_t max; // max number of workers
int32_t min; // min number of workers
int32_t num; // current number of workers
STaosQset * qset;
const char * name;
SQWorker * workers;
STaosQset *qset;
const char *name;
SQWorker *workers;
pthread_mutex_t mutex;
} SQWorkerPool, SFWorkerPool;
typedef struct SWWorker {
int32_t id; // worker id
pthread_t thread; // thread
STaosQall * qall;
STaosQset * qset; // queue set
STaosQall *qall;
STaosQset *qset; // queue set
SWWorkerPool *pool;
} SWWorker;
typedef struct SWWorkerPool {
int32_t max; // max number of workers
int32_t nextId; // from 0 to max-1, cyclic
const char * name;
SWWorker * workers;
const char *name;
SWWorker *workers;
pthread_mutex_t mutex;
} SWWorkerPool;
......@@ -75,4 +75,4 @@ void tWWorkerFreeQueue(SWWorkerPool *pool, STaosQueue *queue);
}
#endif
#endif /*_TD_UTIL_WORKER_H*/
#endif /*_TD_UTIL_WORKER_H_*/
......@@ -22,14 +22,14 @@
extern "C" {
#endif
#define GET_INT8_VAL(x) (*(int8_t *)(x))
#define GET_INT16_VAL(x) (*(int16_t *)(x))
#define GET_INT32_VAL(x) (*(int32_t *)(x))
#define GET_INT64_VAL(x) (*(int64_t *)(x))
#define GET_UINT8_VAL(x) (*(uint8_t*) (x))
#define GET_UINT16_VAL(x) (*(uint16_t *)(x))
#define GET_UINT32_VAL(x) (*(uint32_t *)(x))
#define GET_UINT64_VAL(x) (*(uint64_t *)(x))
#define GET_INT8_VAL(x) (*(int8_t *)(x))
#define GET_INT16_VAL(x) (*(int16_t *)(x))
#define GET_INT32_VAL(x) (*(int32_t *)(x))
#define GET_INT64_VAL(x) (*(int64_t *)(x))
#define GET_UINT8_VAL(x) (*(uint8_t *)(x))
#define GET_UINT16_VAL(x) (*(uint16_t *)(x))
#define GET_UINT32_VAL(x) (*(uint32_t *)(x))
#define GET_UINT64_VAL(x) (*(uint64_t *)(x))
static FORCE_INLINE float taos_align_get_float(const char *pBuf) {
#if __STDC_VERSION__ >= 201112L
......@@ -64,17 +64,22 @@ static FORCE_INLINE double taos_align_get_double(const char *pBuf) {
// #define SET_FLOAT_PTR(x, y) { (*(int32_t*) x = *(int32_t*)y); }
// #define SET_DOUBLE_PTR(x, y) { (*(int64_t*) x = *(int64_t*)y); }
// #else
#define GET_FLOAT_VAL(x) (*(float *)(x))
#define GET_DOUBLE_VAL(x) (*(double *)(x))
#define SET_BIGINT_VAL(x, y) { (*(int64_t *)(x)) = (int64_t)(y); }
#define SET_FLOAT_VAL(x, y) { (*(float *)(x)) = (float)(y); }
#define SET_DOUBLE_VAL(x, y) { (*(double *)(x)) = (double)(y); }
#define SET_FLOAT_PTR(x, y) { (*(float *)(x)) = (*(float *)(y)); }
#define SET_DOUBLE_PTR(x, y) { (*(double *)(x)) = (*(double *)(y)); }
#define GET_FLOAT_VAL(x) (*(float *)(x))
#define GET_DOUBLE_VAL(x) (*(double *)(x))
#define SET_BIGINT_VAL(x, y) \
{ (*(int64_t *)(x)) = (int64_t)(y); }
#define SET_FLOAT_VAL(x, y) \
{ (*(float *)(x)) = (float)(y); }
#define SET_DOUBLE_VAL(x, y) \
{ (*(double *)(x)) = (double)(y); }
#define SET_FLOAT_PTR(x, y) \
{ (*(float *)(x)) = (*(float *)(y)); }
#define SET_DOUBLE_PTR(x, y) \
{ (*(double *)(x)) = (*(double *)(y)); }
// #endif
typedef uint16_t VarDataLenT; // maxVarDataLen: 32767
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
typedef uint16_t VarDataLenT; // maxVarDataLen: 32767
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
#define varDataLen(v) ((VarDataLenT *)(v))[0]
#define varDataVal(v) ((void *)((char *)v + VARSTR_HEADER_SIZE))
......
......@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_VERSION_H
#define _TD_UTIL_VERSION_H
#ifndef _TD_UTIL_VERSION_H_
#define _TD_UTIL_VERSION_H_
#ifdef __cplusplus
extern "C" {
......@@ -30,4 +30,4 @@ extern char buildinfo[];
}
#endif
#endif /*_TD_UTIL_VERSION_H*/
#endif /*_TD_UTIL_VERSION_H_*/
......@@ -71,8 +71,8 @@ static void *tQWorkerThreadFp(SQWorker *worker) {
SQWorkerPool *pool = worker->pool;
FItem fp = NULL;
void * msg = NULL;
void * ahandle = NULL;
void *msg = NULL;
void *ahandle = NULL;
int32_t code = 0;
taosBlockSIGPIPE();
......@@ -151,8 +151,8 @@ static void *tFWorkerThreadFp(SQWorker *worker) {
SQWorkerPool *pool = worker->pool;
FItem fp = NULL;
void * msg = NULL;
void * ahandle = NULL;
void *msg = NULL;
void *ahandle = NULL;
int32_t code = 0;
taosBlockSIGPIPE();
......@@ -240,8 +240,8 @@ static void *tWWorkerThreadFp(SWWorker *worker) {
SWWorkerPool *pool = worker->pool;
FItems fp = NULL;
void * msg = NULL;
void * ahandle = NULL;
void *msg = NULL;
void *ahandle = NULL;
int32_t numOfMsgs = 0;
int32_t qtype = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册