提交 cebd77b6 编写于 作者: S Shengliang Guan

minor changes

上级 87b63a9f
......@@ -28,7 +28,7 @@ extern "C" {
#include <stdio.h>
#include "texception.h"
int main( int argc, char** argv ) {
int32_t main( int32_t argc, char** argv ) {
SBufferWriter bw = tbufInitWriter( NULL, false );
TRY( 1 ) {
......@@ -39,7 +39,7 @@ int main( int argc, char** argv ) {
// reserve space for the interger count
size_t pos = tbufReserve( &bw, sizeof(int32_t) );
// write 5 integers to the buffer
for( int i = 0; i < 5; i++) {
for( int32_t i = 0; i < 5; i++) {
tbufWriteInt32( &bw, i );
}
// 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 );
// read & print out all integers
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) );
}
// read & print out a string
......
......@@ -408,8 +408,8 @@ enum { TRANS_OPER_INIT = 0, TRANS_OPER_EXECUTE, TRANS_OPER_ROLLBACK };
typedef struct {
char dir[TSDB_FILENAME_LEN];
int level;
int primary;
int32_t level;
int32_t primary;
} SDiskCfg;
#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) {
T_MD5_CTX context;
tMD5Init(&context);
tMD5Update(&context, inBuf, (unsigned int)inLen);
tMD5Update(&context, inBuf, (uint32_t)inLen);
tMD5Final(&context);
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) {
T_MD5_CTX context;
tMD5Init(&context);
tMD5Update(&context, inBuf, (unsigned int)len);
tMD5Update(&context, inBuf, (uint32_t)len);
tMD5Final(&context);
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) {
char *line = NULL, *name, *value, *value2, *value3;
int olen, vlen, vlen2, vlen3;
int32_t olen, vlen, vlen2, vlen3;
ssize_t _bytes = 0;
// FILE *fp = fopen(filepath, "r");
......
......@@ -113,7 +113,7 @@ static int32_t taosStartLog() {
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;
osUpdate();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册