소스 검색

explicit consts

Aaro Saila 2 년 전
부모
커밋
47d72e2df1
1개의 변경된 파일과 2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      main.c

+ 2 - 2
main.c

@@ -15,7 +15,7 @@ char board[BRD_SIZE_Y][BRD_SIZE_X];
 const char SNAKE_VIS = '#';
 
 int main() {
-  clock_t initClock = clock();
+  const clock_t initClock = clock();
 
   // Termios setup
   struct termios attr;
@@ -49,7 +49,7 @@ int main() {
 
   int points = 0;
   int gameSpeed = 0;
-  int sleepInterval = 200 - gameSpeed;
+  const int sleepInterval = 200;
 
   // Snake head setup
   snakePart* snakeHead = (snakePart*) malloc(sizeof(snakePart));