RecordingSet::~RecordingSet() { clearTemp(); //try to remove temp directory; This will of course fail if there are files in there //so it will only clean the directory if it is not needed anymore; QDir().rmdir(getBaseDirectory()); }
BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask) { BOOL returnVal = FALSE; if (!mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && !isAnyPathToolModKeys(pMask)) { gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING); } if (!mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask)) { gViewerWindow->setCursor(isPointAModKeys(pMask) ? (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_START) : (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_END)); computeTempPoints(pX, pY, pMask); returnVal = TRUE; } else { clearTemp(); computeFinalPath(); } return returnVal; }
void setTemp() { //initalises temp, get sensor readings and sets the local temp to a normalised neural vector clearTemp(); setLeft(); setCentre(); setRight(); normaliseTemp(); }
//----Gets local view and processes ready for comparison----// void setTemp() { //initalises temp, get sensor readings and sets the local temp to a normalised neural vector clearTemp(); float rightSonarValue = SensorValue(rightSonar); //obvious float leftSonarValue = SensorValue(leftSonar); float centreSonarValue = SensorValue(centreSonar); setLeft(leftSonarValue); setCentre(centreSonarValue); setRight(rightSonarValue); normaliseTemp(); }
PUBLIC void closeStartScanf(TTY* p_tty) { p_tty->startScanf=0; clearTemp(p_tty); }
PUBLIC void openStartScanf(TTY* p_tty) { p_tty->startScanf=1; clearTemp(p_tty); }
RecordingSet::RecordingSet() : m_isNull(true) { clearTemp(); }
void LLPathfindingPathTool::clearPath() { clearFinal(); clearTemp(); computeFinalPath(); }
Value* tokenize(char* expression){ Value* head = NULL; char* temp = malloc(256 * sizeof(char)); temp = memset(temp, 0, (256 * sizeof(char))); int j = 0; int stringFlag = 0; int i; for (i=0; expression[i]; i++){ switch(expression[i]){ case '(': if (strlen(temp) == 0){ temp[0] = '('; head = insertToken(temp, head); clearTemp(temp, 1); } else { head = insertToken(temp, head); if (head == NULL){ printf("Untokenizable input: %s \n", temp); return NULL; } clearTemp(temp, j); temp[0] = '('; head = insertToken(temp, head); clearTemp(temp, 1); j=0; } break; case ')': if (strlen(temp) == 0){ temp[0] = ')'; head = insertToken(temp, head); clearTemp(temp, 1); } else { head = insertToken(temp, head); if (head == NULL){ printf("Untokenizable input: %s \n", temp); return NULL; } clearTemp(temp, j); temp[0] = ')'; head = insertToken(temp, head); clearTemp(temp, 1); j=0; } break; case ' ': if (stringFlag){ temp[j] = expression[i]; j++; break; } if (strlen(temp) > 0){ head = insertToken(temp, head); if (head == NULL){ printf("Untokenizable input: %s \n", temp); return NULL; } clearTemp(temp, j); j=0; } break; case '\t': if (stringFlag){ temp[j] = expression[i]; j++; break; } if (strlen(temp) > 0){ head = insertToken(temp, head); if (head == NULL){ printf("Untokenizable input: %s \n", temp); return NULL; } clearTemp(temp, j); j=0; } break; case '\n': if (strlen(temp) > 0){ head = insertToken(temp, head); if (head == NULL){ printf("Untokenizable input: %s \n", temp); return NULL; } clearTemp(temp, j); j=0; } break; case ';': return NULL; default: if (expression[i] == '\"') stringFlag = (stringFlag + 1) % 2; temp[j] = expression[i]; j++; break; } } // check if it's greater than one because it will have a '\n' from pressing the enter key. if (strlen(temp) > 1){ printf("Invalid input, boy!\n"); } free(temp); head = reverseList(head); return head; }