fix: typos

This commit is contained in:
Shuduo Sang 2023-01-05 21:25:31 +08:00
parent f7169103c8
commit c85da8dc3a
4 changed files with 15 additions and 15 deletions

View File

@ -24,13 +24,13 @@ void pressTabKey(SShellCmd* cmd);
// press othr key // press othr key
void pressOtherKey(char c); void pressOtherKey(char c);
// init shell auto funciton , shell start call once // init shell auto function , shell start call once
bool shellAutoInit(); bool shellAutoInit();
// set conn // set conn
void shellSetConn(TAOS* conn); void shellSetConn(TAOS* conn);
// exit shell auto funciton, shell exit call once // exit shell auto function, shell exit call once
void shellAutoExit(); void shellAutoExit();
// callback autotab module // callback autotab module

View File

@ -19,7 +19,7 @@
// //
// The prefix search tree is a efficient storage words and search words tree, it support 95 visible ascii code character // The prefix search tree is a efficient storage words and search words tree, it support 95 visible ascii code character
// //
#define FIRST_ASCII 40 // first visiable char is '0' #define FIRST_ASCII 40 // first visible char is '0'
#define LAST_ASCII 122 // last visilbe char is 'z' #define LAST_ASCII 122 // last visilbe char is 'z'
// capacity save char is 95 // capacity save char is 95

View File

@ -264,7 +264,7 @@ char* key_tags[] = {"tags("};
char* key_select[] = {"select "}; char* key_select[] = {"select "};
// //
// ------- gobal variant define --------- // ------- global variant define ---------
// //
int32_t firstMatchIndex = -1; // first match shellCommands index int32_t firstMatchIndex = -1; // first match shellCommands index
int32_t lastMatchIndex = -1; // last match shellCommands index int32_t lastMatchIndex = -1; // last match shellCommands index
@ -603,7 +603,7 @@ void GenerateVarType(int type, char** p, int count) {
// -------------------- shell auto ---------------- // -------------------- shell auto ----------------
// //
// init shell auto funciton , shell start call once // init shell auto function , shell start call once
bool shellAutoInit() { bool shellAutoInit() {
// command // command
int32_t count = SHELL_COMMAND_COUNT(); int32_t count = SHELL_COMMAND_COUNT();
@ -636,7 +636,7 @@ bool shellAutoInit() {
// set conn // set conn
void shellSetConn(TAOS* conn) { varCon = conn; } void shellSetConn(TAOS* conn) { varCon = conn; }
// exit shell auto funciton, shell exit call once // exit shell auto function, shell exit call once
void shellAutoExit() { void shellAutoExit() {
// free command // free command
int32_t count = SHELL_COMMAND_COUNT(); int32_t count = SHELL_COMMAND_COUNT();
@ -653,7 +653,7 @@ void shellAutoExit() {
} }
} }
taosThreadMutexUnlock(&tiresMutex); taosThreadMutexUnlock(&tiresMutex);
// destory // destroy
taosThreadMutexDestroy(&tiresMutex); taosThreadMutexDestroy(&tiresMutex);
// free threads // free threads
@ -674,7 +674,7 @@ void shellAutoExit() {
// //
// ------------------- auto ptr for tires -------------------------- // ------------------- auto ptr for tires --------------------------
// //
bool setNewAuotPtr(int type, STire* pNew) { bool setNewAutoPtr(int type, STire* pNew) {
if (pNew == NULL) return false; if (pNew == NULL) return false;
taosThreadMutexLock(&tiresMutex); taosThreadMutexLock(&tiresMutex);
@ -717,7 +717,7 @@ void putBackAutoPtr(int type, STire* tire) {
if (tires[type] != tire) { if (tires[type] != tire) {
// update by out, can't put back , so free // update by out, can't put back , so free
if (--tire->ref == 1) { if (--tire->ref == 1) {
// support multi thread getAuotPtr // support multi thread getAutoPtr
freeTire(tire); freeTire(tire);
} }
@ -775,7 +775,7 @@ int writeVarNames(int type, TAOS_RES* tres) {
} while (row != NULL); } while (row != NULL);
// replace old tire // replace old tire
setNewAuotPtr(type, tire); setNewAutoPtr(type, tire);
return numOfRows; return numOfRows;
} }
@ -1043,7 +1043,7 @@ SWords* matchCommand(SWords* input, bool continueSearch) {
for (int32_t i = 0; i < count; i++) { for (int32_t i = 0; i < count; i++) {
SWords* shellCommand = shellCommands + i; SWords* shellCommand = shellCommands + i;
if (continueSearch && lastMatchIndex != -1 && i <= lastMatchIndex) { if (continueSearch && lastMatchIndex != -1 && i <= lastMatchIndex) {
// new match must greate than lastMatchIndex // new match must greater than lastMatchIndex
if (varMode && i == lastMatchIndex) { if (varMode && i == lastMatchIndex) {
// do nothing, var match on lastMatchIndex // do nothing, var match on lastMatchIndex
} else { } else {
@ -1172,7 +1172,7 @@ void createInputFromFirst(SWords* input, SWords* firstMatch) {
for (int i = 0; i < firstMatch->matchIndex && word; i++) { for (int i = 0; i < firstMatch->matchIndex && word; i++) {
// combine source from each word // combine source from each word
strncpy(input->source + input->source_len, word->word, word->len); strncpy(input->source + input->source_len, word->word, word->len);
strcat(input->source, " "); // append blank splite strcat(input->source, " "); // append blank space
input->source_len += word->len + 1; // 1 is blank length input->source_len += word->len + 1; // 1 is blank length
// move next // move next
word = word->next; word = word->next;
@ -1401,7 +1401,7 @@ bool appendAfterSelect(TAOS* con, SShellCmd* cmd, char* sql, int32_t len) {
return true; return true;
} }
// fill funciton // fill function
if (fieldEnd) { if (fieldEnd) {
// fields is end , need match keyword // fields is end , need match keyword
ret = fillWithType(con, cmd, last, WT_VAR_KEYWORD); ret = fillWithType(con, cmd, last, WT_VAR_KEYWORD);
@ -1584,7 +1584,7 @@ bool matchCreateTable(TAOS* con, SShellCmd* cmd) {
// tb options // tb options
if (!ret) { if (!ret) {
// find like create talbe st (...) tags(..) <here is fill tb option area> // find like create table st (...) tags(..) <here is fill tb option area>
char* p1 = strchr(ps, ')'); // first ')' end char* p1 = strchr(ps, ')'); // first ')' end
if (p1) { if (p1) {
if (strchr(p1 + 1, ')')) { // second ')' end if (strchr(p1 + 1, ')')) { // second ')' end

View File

@ -1128,7 +1128,7 @@ int32_t shellExecute() {
} }
if (tsem_init(&shell.cancelSem, 0, 0) != 0) { if (tsem_init(&shell.cancelSem, 0, 0) != 0) {
printf("failed to create cancel semphore\r\n"); printf("failed to create cancel semaphore\r\n");
return -1; return -1;
} }