From e65b3cf236864304899633e0351320ffbd84a5e7 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Thu, 22 Oct 2015 03:23:08 -0400 Subject: [PATCH] Remove unnecessary null exprs from end of cases Signed-off-by: Collin J. Doering --- lcdLib.c | 16 ---------------- lcdOutput.c | 5 ----- 2 files changed, 21 deletions(-) diff --git a/lcdLib.c b/lcdLib.c index ee84e65..d28ef5d 100644 --- a/lcdLib.c +++ b/lcdLib.c @@ -203,10 +203,8 @@ void writeCharToLCD(char c) { currentLineChars = 0; } break; - ; case '\a': // Alarm break; - ; case '\b': // Backspace (non-destructive) if (currentLineChars == 0 && currentLineNum == 0) { // At first line, first column; there is no where to move; do nothing @@ -221,16 +219,13 @@ void writeCharToLCD(char c) { } break; - ; case '\r': // Carriage return writeLCDInstr(INSTR_DDRAM_ADDR | lineBeginnings[currentLineNum]); currentLineChars = 0; break; - ; case '\f': // Form feed clearDisplay(); break; - ; default: if (currentLineChars == LCD_CHARACTERS_PER_LINE - 1 && currentLineNum == LCD_NUMBER_OF_LINES - 1) { clearDisplay(); @@ -245,7 +240,6 @@ void writeCharToLCD(char c) { writeCharToLCD_(c); currentLineChars++; } - ; } } @@ -302,10 +296,8 @@ void writeStringToLCD(char* str) { num1 = fnd1 ? num1 : 1; setCursorPosition(num0, num1); break; - ;; default: // Invalid control character break; - ;; } } else if (*str != '\0') { // Read control character (between 0x40 - 0x7e) for single argument sequences @@ -314,41 +306,33 @@ void writeStringToLCD(char* str) { num0 = fnd0 ? num0 : 1; moveCursorUp(num0); break; - ;; case 'B': // CUD - Cursor down num0 = fnd0 ? num0 : 1; moveCursorDown(num0); break; - ;; case 'C': // CUF - Cursor forward num0 = fnd0 ? num0 : 1; moveCursorForward(num0); break; - ;; case 'D': // CUB - Cursor back num0 = fnd0 ? num0 : 1; moveCursorBackward(num0); break; - ;; case 'E': // CNL - Cursor next line num0 = fnd0 ? num0 : 1; moveCursorNextLine(num0); break; - ;; case 'F': // CPL - Cursor previous line num0 = fnd0 ? num0 : 1; moveCursorPreviousLine(num0); break; - ;; case 'G': // CHA - Cursor horizontal absolute num0 = fnd0 ? num0 : 1; moveCursorToColumn(num0); break; - ;; default: // Invalid control character writeCharToLCD(*str); break; - ;; } } else { return; // Invalid escape sequence (terminated early) diff --git a/lcdOutput.c b/lcdOutput.c index 9aad904..57da653 100644 --- a/lcdOutput.c +++ b/lcdOutput.c @@ -73,17 +73,14 @@ int main(void) { writeStringToLCD("\r\n"); transmitString("\n" CNL(1) "\r"); break; - ;; case '\f': writeCharToLCD(serialChar); transmitString(ED(2) CUP(1,1)); break; - ;; case 0x7f: // Backspace (sent as delete) writeStringToLCD("\b \b"); transmitString(CUB(1) " " CUB(1)); break; - ;; case '\e': // Beginning of ANSI escape { char j = receiveByte(); @@ -100,11 +97,9 @@ int main(void) { } break; } - ;; default: writeCharToLCD(serialChar); transmitByte(serialChar); // Echo character back to serial console - ;; } }