minor changes
This commit is contained in:
parent
87b63a9fbe
commit
cebd77b6ad
|
@ -28,7 +28,7 @@ extern "C" {
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "texception.h"
|
#include "texception.h"
|
||||||
|
|
||||||
int main( int argc, char** argv ) {
|
int32_t main( int32_t argc, char** argv ) {
|
||||||
SBufferWriter bw = tbufInitWriter( NULL, false );
|
SBufferWriter bw = tbufInitWriter( NULL, false );
|
||||||
|
|
||||||
TRY( 1 ) {
|
TRY( 1 ) {
|
||||||
|
@ -39,7 +39,7 @@ int main( int argc, char** argv ) {
|
||||||
// reserve space for the interger count
|
// reserve space for the interger count
|
||||||
size_t pos = tbufReserve( &bw, sizeof(int32_t) );
|
size_t pos = tbufReserve( &bw, sizeof(int32_t) );
|
||||||
// write 5 integers to the buffer
|
// write 5 integers to the buffer
|
||||||
for( int i = 0; i < 5; i++) {
|
for( int32_t i = 0; i < 5; i++) {
|
||||||
tbufWriteInt32( &bw, i );
|
tbufWriteInt32( &bw, i );
|
||||||
}
|
}
|
||||||
// write the integer count to buffer at reserved position
|
// write the integer count to buffer at reserved position
|
||||||
|
@ -55,7 +55,7 @@ int main( int argc, char** argv ) {
|
||||||
SBufferReader br = tbufInitReader( data, size, false );
|
SBufferReader br = tbufInitReader( data, size, false );
|
||||||
// read & print out all integers
|
// read & print out all integers
|
||||||
int32_t count = tbufReadInt32( &br );
|
int32_t count = tbufReadInt32( &br );
|
||||||
for( int i = 0; i < count; i++ ) {
|
for( int32_t i = 0; i < count; i++ ) {
|
||||||
printf( "%d\n", tbufReadInt32(&br) );
|
printf( "%d\n", tbufReadInt32(&br) );
|
||||||
}
|
}
|
||||||
// read & print out a string
|
// read & print out a string
|
||||||
|
|
|
@ -408,8 +408,8 @@ enum { TRANS_OPER_INIT = 0, TRANS_OPER_EXECUTE, TRANS_OPER_ROLLBACK };
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char dir[TSDB_FILENAME_LEN];
|
char dir[TSDB_FILENAME_LEN];
|
||||||
int level;
|
int32_t level;
|
||||||
int primary;
|
int32_t primary;
|
||||||
} SDiskCfg;
|
} SDiskCfg;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -49,7 +49,7 @@ void taosIpPort2String(uint32_t ip, uint16_t port, char *str);
|
||||||
static FORCE_INLINE void taosEncryptPass(uint8_t *inBuf, size_t inLen, char *target) {
|
static FORCE_INLINE void taosEncryptPass(uint8_t *inBuf, size_t inLen, char *target) {
|
||||||
T_MD5_CTX context;
|
T_MD5_CTX context;
|
||||||
tMD5Init(&context);
|
tMD5Init(&context);
|
||||||
tMD5Update(&context, inBuf, (unsigned int)inLen);
|
tMD5Update(&context, inBuf, (uint32_t)inLen);
|
||||||
tMD5Final(&context);
|
tMD5Final(&context);
|
||||||
memcpy(target, context.digest, tListLen(context.digest));
|
memcpy(target, context.digest, tListLen(context.digest));
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ static FORCE_INLINE void taosEncryptPass(uint8_t *inBuf, size_t inLen, char *tar
|
||||||
static FORCE_INLINE void taosEncryptPass_c(uint8_t *inBuf, size_t len, char *target) {
|
static FORCE_INLINE void taosEncryptPass_c(uint8_t *inBuf, size_t len, char *target) {
|
||||||
T_MD5_CTX context;
|
T_MD5_CTX context;
|
||||||
tMD5Init(&context);
|
tMD5Init(&context);
|
||||||
tMD5Update(&context, inBuf, (unsigned int)len);
|
tMD5Update(&context, inBuf, (uint32_t)len);
|
||||||
tMD5Final(&context);
|
tMD5Final(&context);
|
||||||
|
|
||||||
sprintf(target, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", context.digest[0],
|
sprintf(target, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", context.digest[0],
|
||||||
|
|
|
@ -618,7 +618,7 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *filepath) {
|
||||||
|
|
||||||
int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
|
int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
|
||||||
char *line = NULL, *name, *value, *value2, *value3;
|
char *line = NULL, *name, *value, *value2, *value3;
|
||||||
int olen, vlen, vlen2, vlen3;
|
int32_t olen, vlen, vlen2, vlen3;
|
||||||
ssize_t _bytes = 0;
|
ssize_t _bytes = 0;
|
||||||
|
|
||||||
// FILE *fp = fopen(filepath, "r");
|
// FILE *fp = fopen(filepath, "r");
|
||||||
|
|
|
@ -113,7 +113,7 @@ static int32_t taosStartLog() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t taosInitLog(const char *logName, int maxFiles) {
|
int32_t taosInitLog(const char *logName, int32_t maxFiles) {
|
||||||
if (atomic_val_compare_exchange_8(&tsLogInited, 0, 1) != 0) return 0;
|
if (atomic_val_compare_exchange_8(&tsLogInited, 0, 1) != 0) return 0;
|
||||||
osUpdate();
|
osUpdate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue