Skip to content

Commit

Permalink
Merge pull request #101 from lasselukkari/remove-size
Browse files Browse the repository at this point in the history
Remove unnecessary SIZE macro
  • Loading branch information
lasselukkari authored Feb 17, 2021
2 parents 9109e68 + 5497652 commit 6c2f06f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=aWOT
version=3.2.2
version=3.2.3
author=Lasse Lukkari <lasse.lukkari@gmail.com>
maintainer=Lasse Lukkari <lasse.lukkari@gmail.com>
sentence=Arduino web server library.
Expand Down
6 changes: 3 additions & 3 deletions src/aWOT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void Response::sendStatus(int code) {
}

void Response::set(const char *name, const char *value) {
if (m_headersCount >= SIZE(m_headers)) {
if (m_headersCount >= SERVER_MAX_HEADERS) {
return;
}

Expand Down Expand Up @@ -827,8 +827,8 @@ void Request::push(uint8_t ch) {
m_pushback[m_pushbackDepth++] = ch;

// can't raise error here, so just replace last char over and over
if (m_pushbackDepth == SIZE(m_pushback)) {
m_pushbackDepth = SIZE(m_pushback) - 1;
if (m_pushbackDepth == SERVER_PUSHBACK_BUFFER_SIZE) {
m_pushbackDepth = SERVER_PUSHBACK_BUFFER_SIZE - 1;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/aWOT.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
#endif

#define P(name) static const unsigned char name[] PROGMEM
#define SIZE(array) (sizeof(array) / sizeof(*array))

class StreamClient : public Client {
private:
Expand Down

0 comments on commit 6c2f06f

Please sign in to comment.