diff --git a/include/util/tbuffer.h b/include/util/tbuffer.h index c0c3fd59aadae162f9b7186261ccd4a829ea6a7f..2ed1b7326bdb27ffe182b30d67a9369680898d23 100644 --- a/include/util/tbuffer.h +++ b/include/util/tbuffer.h @@ -28,7 +28,7 @@ extern "C" { #include #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 diff --git a/include/util/tdef.h b/include/util/tdef.h index d17e5be99e7fe5eb6cfe06d42fa08bde48e062da..1a5c07d75aec3a8c48e617f9ceb17b8da749f116 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -407,9 +407,9 @@ enum { TRANS_STAT_INIT = 0, TRANS_STAT_EXECUTING, TRANS_STAT_EXECUTED, TRANS_STA enum { TRANS_OPER_INIT = 0, TRANS_OPER_EXECUTE, TRANS_OPER_ROLLBACK }; typedef struct { - char dir[TSDB_FILENAME_LEN]; - int level; - int primary; + char dir[TSDB_FILENAME_LEN]; + int32_t level; + int32_t primary; } SDiskCfg; #ifdef __cplusplus diff --git a/include/util/tutil.h b/include/util/tutil.h index e4123d585bf4d2681dd417951914b556f5f51d5b..e0f92be76a90d5abbfa22366d8513f3e06facbbd 100644 --- a/include/util/tutil.h +++ b/include/util/tutil.h @@ -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], diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index 5ea745d924b63d039d23d7241df51bed27e583bc..98e5bf1346b38ca8cd8c3e1504c8832cb04e82af 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -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"); diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 2ed8d6e347357f458e3035b6e877717cda669d50..87e3a410734ab26f54ef7289b59dd12f647b955a 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -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();