Skip to content

Commit

Permalink
refactor: added const usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jeezab committed Sep 28, 2024
1 parent c2bf094 commit a70ce0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/whotype/whotype.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "whotype.h"

int isDigit(char c) { return c >= '0' && c <= '9'; }
int isDigit(char const c) { return c >= '0' && c <= '9'; }

int isLetter(char c) {
int isLetter(char const c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}

int isSpace(char c) { return c == ' ' || c == '\t' || c == '\n'; }
int isSpace(char const c) { return c == ' ' || c == '\t' || c == '\n'; }

int isOperator(char c) {
int isOperator(char const c) {
return c == '+' || c == '-' || c == '*' || c == '/' || c == '^' || c == '~';
}
10 changes: 5 additions & 5 deletions src/whotype/whotype.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef WHOTYPE_H
#define WHOTYPE_H

int isDigit(char c);
int isAlpha(char c);
int isLetter(char c);
int isSpace(char c);
int isOperator(char c);
int isDigit(char const c);
int isAlpha(char const c);
int isLetter(char const c);
int isSpace(char const c);
int isOperator(char const c);

#endif // WHOTYPE_H

0 comments on commit a70ce0a

Please sign in to comment.