提交 691e4c17 编写于 作者: S Shengliang Guan

Merge branch 'feature/os' of https://github.com/taosdata/TDengine into feature/os

......@@ -27,7 +27,7 @@ ELSEIF (TD_WINDOWS_64)
#INSTALL(TARGETS taos RUNTIME DESTINATION driver)
#INSTALL(TARGETS shell RUNTIME DESTINATION .)
IF (TD_MVN_INSTALLED)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-1.0.2-dist.jar DESTINATION connector/jdbc)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.0-dist.jar DESTINATION connector/jdbc)
ENDIF ()
ELSE ()
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libtaos.dll DESTINATION driver)
......
......@@ -360,7 +360,7 @@ find_shared_library_fullname ()
ungetc (c, fp);
shared_library_fullname = NULL; size = 0;
len = getline (&shared_library_fullname, &size, fp);
len = taosGetline(&shared_library_fullname, &size, fp);
if (len >= 0)
{
/* Success: filled shared_library_fullname. */
......
......@@ -1931,6 +1931,7 @@ int16_t tscGetJoinTagColIdByUid(STagCond* pTagCond, uint64_t uid) {
return pTagCond->joinInfo.right.tagColId;
} else {
assert(0);
return -1;
}
}
......
......@@ -62,7 +62,7 @@ void printHelp() {
exit(EXIT_SUCCESS);
}
void shellParseArgument(int argc, char *argv[], struct arguments *arguments) {
void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
wordexp_t full_path;
for (int i = 1; i < argc; i++) {
// for host
......
......@@ -577,7 +577,7 @@ static int verticalPrintResult(TAOS_RES* tres) {
int maxColNameLen = 0;
for (int col = 0; col < num_fields; col++) {
int len = strlen(fields[col].name);
int len = (int)strlen(fields[col].name);
if (len > maxColNameLen) {
maxColNameLen = len;
}
......@@ -604,9 +604,8 @@ static int verticalPrintResult(TAOS_RES* tres) {
return numOfRows;
}
static int calcColWidth(TAOS_FIELD* field, int precision) {
int width = strlen(field->name);
int width = (int)strlen(field->name);
switch (field->type) {
case TSDB_DATA_TYPE_BOOL:
......@@ -741,7 +740,7 @@ void read_history() {
return;
}
while ((read_size = getline(&line, &line_size, f)) != -1) {
while ((read_size = taosGetline(&line, &line_size, f)) != -1) {
line[read_size - 1] = '\0';
history.hist[history.hend] = strdup(line);
......@@ -822,7 +821,7 @@ void source_file(TAOS *con, char *fptr) {
return;
}
while ((read_len = getline(&line, &line_len, f)) != -1) {
while ((read_len = taosGetline(&line, &line_len, f)) != -1) {
if (read_len >= tsMaxSQLStringLen) continue;
line[--read_len] = '\0';
......
......@@ -9,12 +9,16 @@
*
* ****************************************************************/
#include "shell.h"
#include <assert.h>
#include <regex.h>
#include <stdio.h>
#include "os.h"
#include "shell.h"
#include "taos.h"
#include "shellCommand.h"
extern char configDir[];
void printHelp() {
char indent[10] = " ";
printf("taos shell is used to test the TDEngine database\n");
......@@ -43,7 +47,7 @@ void printHelp() {
exit(EXIT_SUCCESS);
}
void shellParseArgument(int argc, char *argv[], struct arguments *arguments) {
void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
for (int i = 1; i < argc; i++) {
// for host
if (strcmp(argv[i], "-h") == 0) {
......@@ -81,7 +85,7 @@ void shellParseArgument(int argc, char *argv[], struct arguments *arguments) {
fprintf(stderr, "config file path: %s overflow max len %d\n", argv[i], TSDB_FILENAME_LEN - 1);
exit(EXIT_FAILURE);
}
strcpy(configDir, argv[i]);
strcpy(configDir, argv[++i]);
} else {
fprintf(stderr, "Option -c requires an argument\n");
exit(EXIT_FAILURE);
......
......@@ -13,5 +13,8 @@ IF (TD_LINUX)
# ELSE ()
# TARGET_LINK_LIBRARIES(taosdemo taos_static)
# ENDIF ()
ELSEIF (TD_WINDOWS)
AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdemo ${SRC})
TARGET_LINK_LIBRARIES(taosdemo taos_static)
ENDIF ()
此差异已折叠。
......@@ -42,6 +42,7 @@
#include "msvcProcess.h"
#include "msvcDirect.h"
#include "msvcFcntl.h"
#include "msvcStdio.h"
#include "sys/msvcStat.h"
#include "sys/msvcTypes.h"
......@@ -145,6 +146,7 @@ int flock(int fd, int option);
int fsync(int filedes);
char * strndup(const char *s, size_t n);
char * dirname(char *pszPathname);
int gettimeofday(struct timeval *ptv, void *pTimeZone);
// for access function in io.h
#define F_OK 00 //Existence only
......
......@@ -16,6 +16,18 @@
#include <time.h>
#include <winsock2.h>
int gettimeofday(struct timeval *tv, struct timezone *tz) {
time_t t;
t = time(NULL);
SYSTEMTIME st;
GetLocalTime(&st);
tv->tv_sec = (long)t;
tv->tv_usec = st.wMilliseconds * 1000;
return 0;
}
struct tm *localtime_r(const time_t *timep, struct tm *result) {
localtime_s(result, timep);
return result;
......
......@@ -56,6 +56,7 @@ static FORCE_INLINE int tsCompressTinyint(const char *const input, int inputSize
return tsCompressStringImp(buffer, len, output, outputSize);
} else {
assert(0);
return -1;
}
}
......@@ -68,6 +69,7 @@ static FORCE_INLINE int tsDecompressTinyint(const char *const input, int compres
return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_TINYINT);
} else {
assert(0);
return -1;
}
}
......@@ -80,6 +82,7 @@ static FORCE_INLINE int tsCompressSmallint(const char *const input, int inputSiz
return tsCompressStringImp(buffer, len, output, outputSize);
} else {
assert(0);
return -1;
}
}
......@@ -92,6 +95,7 @@ static FORCE_INLINE int tsDecompressSmallint(const char *const input, int compre
return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_SMALLINT);
} else {
assert(0);
return -1;
}
}
......@@ -104,6 +108,7 @@ static FORCE_INLINE int tsCompressInt(const char *const input, int inputSize, co
return tsCompressStringImp(buffer, len, output, outputSize);
} else {
assert(0);
return -1;
}
}
......@@ -116,6 +121,7 @@ static FORCE_INLINE int tsDecompressInt(const char *const input, int compressedS
return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_INT);
} else {
assert(0);
return -1;
}
}
......@@ -128,6 +134,7 @@ static FORCE_INLINE int tsCompressBigint(const char *const input, int inputSize,
return tsCompressStringImp(buffer, len, output, outputSize);
} else {
assert(0);
return -1;
}
}
......@@ -140,6 +147,7 @@ static FORCE_INLINE int tsDecompressBigint(const char *const input, int compress
return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_BIGINT);
} else {
assert(0);
return -1;
}
}
......@@ -152,6 +160,7 @@ static FORCE_INLINE int tsCompressBool(const char *const input, int inputSize, c
return tsCompressStringImp(buffer, len, output, outputSize);
} else {
assert(0);
return -1;
}
}
......@@ -164,6 +173,7 @@ static FORCE_INLINE int tsDecompressBool(const char *const input, int compressed
return tsDecompressBoolImp(buffer, nelements, output);
} else {
assert(0);
return -1;
}
}
......@@ -186,6 +196,7 @@ static FORCE_INLINE int tsCompressFloat(const char *const input, int inputSize,
return tsCompressStringImp(buffer, len, output, outputSize);
} else {
assert(0);
return -1;
}
}
......@@ -198,6 +209,7 @@ static FORCE_INLINE int tsDecompressFloat(const char *const input, int compresse
return tsDecompressFloatImp(buffer, nelements, output);
} else {
assert(0);
return -1;
}
}
......@@ -210,6 +222,7 @@ static FORCE_INLINE int tsCompressDouble(const char *const input, int inputSize,
return tsCompressStringImp(buffer, len, output, outputSize);
} else {
assert(0);
return -1;
}
}
......@@ -222,6 +235,7 @@ static FORCE_INLINE int tsDecompressDouble(const char *const input, int compress
return tsDecompressDoubleImp(buffer, nelements, output);
} else {
assert(0);
return -1;
}
}
......@@ -234,6 +248,7 @@ static FORCE_INLINE int tsCompressTimestamp(const char *const input, int inputSi
return tsCompressStringImp(buffer, len, output, outputSize);
} else {
assert(0);
return -1;
}
}
......@@ -246,6 +261,7 @@ static FORCE_INLINE int tsDecompressTimestamp(const char *const input, int compr
return tsDecompressTimestampImp(buffer, nelements, output);
} else {
assert(0);
return -1;
}
}
......
......@@ -591,6 +591,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char
} else {
assert(0);
return -1;
}
}
/* --------------------------------------------Double Compression
......
......@@ -4,10 +4,6 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc)
INCLUDE_DIRECTORIES(inc)
IF (TD_WINDOWS)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread)
ENDIF ()
AUX_SOURCE_DIRECTORY(src SRC)
ADD_EXECUTABLE(tsim ${SRC})
TARGET_LINK_LIBRARIES(tsim taos_static trpc tutil pthread cJson)
......@@ -313,7 +313,9 @@ bool simExecuteSystemCmd(SScript *script, char *option) {
simError("script:%s, failed to execute %s , code %d, errno:%d %s, repeatTimes:%d",
script->fileName, buf, code, errno, strerror(errno), repeatTimes);
taosMsleep(1000);
#ifdef LINUX
signal(SIGCHLD, SIG_DFL);
#endif
if (repeatTimes++ >= 10) {
exit(0);
}
......@@ -418,14 +420,14 @@ void simVisuallizeOption(SScript *script, char *src, char *dst) {
var = strchr(src, '$');
if (var == NULL) break;
if (var && ((var - src - 1) > 0) && *(var - 1) == '\\') {
srcLen = var - src - 1;
srcLen = (int)(var - src - 1);
memcpy(dst + dstLen, src, srcLen);
dstLen += srcLen;
src = var;
break;
}
srcLen = var - src;
srcLen = (int)(var - src);
memcpy(dst + dstLen, src, srcLen);
dstLen += srcLen;
......@@ -433,7 +435,7 @@ void simVisuallizeOption(SScript *script, char *src, char *dst) {
value = simGetVariable(script, token, tokenLen);
strcpy(dst + dstLen, value);
dstLen += strlen(value);
dstLen += (int)strlen(value);
}
strcpy(dst + dstLen, src);
......@@ -455,9 +457,9 @@ void simCloseNativeConnect(SScript *script) {
void simCloseTaosdConnect(SScript *script) {
if (simAsyncQuery) {
return simCloseRestFulConnect(script);
simCloseRestFulConnect(script);
} else {
return simCloseNativeConnect(script);
simCloseNativeConnect(script);
}
}
// {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}
......@@ -575,7 +577,7 @@ int simExecuteRestFulCommand(SScript *script, char *command) {
while (!feof(fp)) {
int availSize = mallocSize - alreadyReadSize;
int len = fread(content + alreadyReadSize, 1, availSize, fp);
int len = (int)fread(content + alreadyReadSize, 1, availSize, fp);
if (len >= availSize) {
alreadyReadSize += len;
mallocSize *= 2;
......
......@@ -105,7 +105,7 @@ void simAddCmdIntoHash(SCommand *pCmd) {
int hash;
SCommand *node;
hash = simHashCmd(pCmd->name, strlen(pCmd->name));
hash = simHashCmd(pCmd->name, (int)strlen(pCmd->name));
node = cmdHashList[hash];
pCmd->next = node;
cmdHashList[hash] = pCmd;
......@@ -199,7 +199,7 @@ SScript *simParseScript(char *fileName) {
if (fgets(buffer, sizeof(buffer), fd) == NULL) continue;
lineNum++;
int cmdlen = strlen(buffer);
int cmdlen = (int)strlen(buffer);
if (buffer[cmdlen - 1] == '\r' || buffer[cmdlen - 1] == '\n')
buffer[cmdlen - 1] = 0;
rest = buffer;
......@@ -294,10 +294,10 @@ int simCheckExpression(char *exp) {
rest = paGetToken(rest, &op, &opLen);
if (opLen == 0) return rest - exp;
if (opLen == 0) return (int)(rest - exp);
/* if it is key word "then" */
if (strncmp(op, "then", 4) == 0) return op - exp;
if (strncmp(op, "then", 4) == 0) return (int)(op - exp);
rest = paGetToken(rest, &op2, &op2Len);
if (op2Len == 0) {
......@@ -312,7 +312,7 @@ int simCheckExpression(char *exp) {
if (op[0] == '+' || op[0] == '-' || op[0] == '*' || op[0] == '/' ||
op[0] == '.') {
return rest - exp;
return (int)(rest - exp);
}
return -1;
......@@ -655,7 +655,7 @@ bool simParsePrintCmd(char *rest, SCommand *pCmd, int lineNum) {
cmdLine[numOfLines].cmdno = SIM_CMD_PRINT;
cmdLine[numOfLines].lineNum = lineNum;
cmdLine[numOfLines].optionOffset = optionOffset;
expLen = strlen(rest);
expLen = (int)strlen(rest);
memcpy(optionBuffer + optionOffset, rest, expLen);
optionOffset += expLen + 1;
*(optionBuffer + optionOffset - 1) = 0;
......@@ -690,7 +690,7 @@ bool simParseSqlCmd(char *rest, SCommand *pCmd, int lineNum) {
cmdLine[numOfLines].cmdno = SIM_CMD_SQL;
cmdLine[numOfLines].lineNum = lineNum;
cmdLine[numOfLines].optionOffset = optionOffset;
expLen = strlen(rest);
expLen = (int)strlen(rest);
memcpy(optionBuffer + optionOffset, rest, expLen);
optionOffset += expLen + 1;
*(optionBuffer + optionOffset - 1) = 0;
......@@ -706,7 +706,7 @@ bool simParseSqlErrorCmd(char *rest, SCommand *pCmd, int lineNum) {
cmdLine[numOfLines].cmdno = SIM_CMD_SQL_ERROR;
cmdLine[numOfLines].lineNum = lineNum;
cmdLine[numOfLines].optionOffset = optionOffset;
expLen = strlen(rest);
expLen = (int)strlen(rest);
memcpy(optionBuffer + optionOffset, rest, expLen);
optionOffset += expLen + 1;
*(optionBuffer + optionOffset - 1) = 0;
......@@ -728,7 +728,7 @@ bool simParseSystemCmd(char *rest, SCommand *pCmd, int lineNum) {
cmdLine[numOfLines].cmdno = SIM_CMD_SYSTEM;
cmdLine[numOfLines].lineNum = lineNum;
cmdLine[numOfLines].optionOffset = optionOffset;
expLen = strlen(rest);
expLen = (int)strlen(rest);
memcpy(optionBuffer + optionOffset, rest, expLen);
optionOffset += expLen + 1;
*(optionBuffer + optionOffset - 1) = 0;
......@@ -840,14 +840,14 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_EXP;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "exp");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = NULL;
simCmdList[cmdno].executeCmd = simExecuteExpCmd;
cmdno = SIM_CMD_IF;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "if");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseIfCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -855,7 +855,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_ELIF;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "elif");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseElifCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -863,7 +863,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_ELSE;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "else");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseElseCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -871,7 +871,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_ENDI;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "endi");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseEndiCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -879,7 +879,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_WHILE;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "while");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseWhileCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -887,7 +887,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_ENDW;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "endw");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseEndwCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -895,7 +895,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_SWITCH;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "switch");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseSwitchCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -903,7 +903,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_CASE;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "case");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseCaseCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -911,7 +911,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_DEFAULT;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "default");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseDefaultCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -919,7 +919,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_BREAK;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "break");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseBreakCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -927,7 +927,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_CONTINUE;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "continue");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseContinueCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -935,7 +935,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_ENDS;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "ends");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseEndsCmd;
simCmdList[cmdno].executeCmd = NULL;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -943,7 +943,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_SLEEP;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "sleep");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseSleepCmd;
simCmdList[cmdno].executeCmd = simExecuteSleepCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -951,7 +951,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_GOTO;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "goto");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseGotoCmd;
simCmdList[cmdno].executeCmd = simExecuteGotoCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -959,7 +959,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_RUN;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "run");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseRunCmd;
simCmdList[cmdno].executeCmd = simExecuteRunCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -967,7 +967,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_RUN_BACK;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "run_back");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseRunBackCmd;
simCmdList[cmdno].executeCmd = simExecuteRunBackCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -975,7 +975,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_SYSTEM;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "system");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseSystemCmd;
simCmdList[cmdno].executeCmd = simExecuteSystemCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -983,7 +983,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_SYSTEM_CONTENT;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "system_content");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseSystemContentCmd;
simCmdList[cmdno].executeCmd = simExecuteSystemContentCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -991,7 +991,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_PRINT;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "print");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParsePrintCmd;
simCmdList[cmdno].executeCmd = simExecutePrintCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -999,7 +999,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_SQL;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "sql");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseSqlCmd;
simCmdList[cmdno].executeCmd = simExecuteSqlCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -1007,7 +1007,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_SQL_ERROR;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "sql_error");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseSqlErrorCmd;
simCmdList[cmdno].executeCmd = simExecuteSqlErrorCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -1015,7 +1015,7 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_SQL_SLOW;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "sql_slow");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseSqlSlowCmd;
simCmdList[cmdno].executeCmd = simExecuteSqlSlowCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......@@ -1024,14 +1024,14 @@ void simInitsimCmdList() {
cmdno = SIM_CMD_TEST;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "test");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = NULL;
simCmdList[cmdno].executeCmd = simExecuteTestCmd;
cmdno = SIM_CMD_RETURN;
simCmdList[cmdno].cmdno = cmdno;
strcpy(simCmdList[cmdno].name, "return");
simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name);
simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name);
simCmdList[cmdno].parseCmd = simParseReturnCmd;
simCmdList[cmdno].executeCmd = simExecuteReturnCmd;
simAddCmdIntoHash(&(simCmdList[cmdno]));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册