Fix -Wunused-parameter

This commit is contained in:
Alex Hultman
2020-12-01 01:10:00 +01:00
parent cb582461b9
commit ad1d6fac08
14 changed files with 61 additions and 58 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ private:
/* Init the HttpContext by registering libusockets event handlers */
HttpContext<SSL> *init() {
/* Handle socket connections */
us_socket_context_on_open(SSL, getSocketContext(), [](us_socket_t *s, int is_client, char *ip, int ip_length) {
us_socket_context_on_open(SSL, getSocketContext(), [](us_socket_t *s, int /*is_client*/, char */*ip*/, int /*ip_length*/) {
/* Any connected socket should timeout until it has a request */
us_socket_timeout(SSL, s, HTTP_IDLE_TIMEOUT_S);
@@ -79,7 +79,7 @@ private:
});
/* Handle socket disconnections */
us_socket_context_on_close(SSL, getSocketContext(), [](us_socket_t *s, int code, void *reason) {
us_socket_context_on_close(SSL, getSocketContext(), [](us_socket_t *s, int /*code*/, void */*reason*/) {
/* Get socket ext */
HttpResponseData<SSL> *httpResponseData = (HttpResponseData<SSL> *) us_socket_ext(SSL, s);
+5 -2
View File
@@ -157,7 +157,7 @@ private:
return unsignedIntegerValue;
}
static unsigned int getHeaders(char *postPaddedBuffer, char *end, struct HttpRequest::Header *headers, BloomFilter *bf) {
static unsigned int getHeaders(char *postPaddedBuffer, char *end, struct HttpRequest::Header *headers) {
char *preliminaryKey, *preliminaryValue, *start = postPaddedBuffer;
for (unsigned int i = 0; i < HttpRequest::MAX_HEADERS; i++) {
@@ -207,12 +207,15 @@ private:
length -= offset;
consumedTotal += offset;
}
#else
/* This one is unused */
(void) reserved;
#endif
/* Fence one byte past end of our buffer (buffer has post padded margins) */
data[length] = '\r';
for (unsigned int consumed; length && (consumed = getHeaders(data, data + length, req->headers, &req->bf)); ) {
for (unsigned int consumed; length && (consumed = getHeaders(data, data + length, req->headers)); ) {
data += consumed;
length -= consumed;
consumedTotal += consumed;
+4 -4
View File
@@ -41,7 +41,7 @@ private:
}
/* If we have negotiated compression, set this frame compressed */
static bool setCompressed(uWS::WebSocketState<isServer> *wState, void *s) {
static bool setCompressed(uWS::WebSocketState<isServer> */*wState*/, void *s) {
WebSocketData *webSocketData = (WebSocketData *) us_socket_ext(SSL, (us_socket_t *) s);
if (webSocketData->compressionStatus == WebSocketData::CompressionStatus::ENABLED) {
@@ -52,7 +52,7 @@ private:
}
}
static void forceClose(uWS::WebSocketState<isServer> *wState, void *s, std::string_view reason = {}) {
static void forceClose(uWS::WebSocketState<isServer> */*wState*/, void *s, std::string_view reason = {}) {
us_socket_close(SSL, (us_socket_t *) s, (int) reason.length(), (void *) reason.data());
}
@@ -224,7 +224,7 @@ private:
return false;
}
static bool refusePayloadLength(uint64_t length, uWS::WebSocketState<isServer> *wState, void *s) {
static bool refusePayloadLength(uint64_t length, uWS::WebSocketState<isServer> */*wState*/, void *s) {
auto *webSocketContextData = (WebSocketContextData<SSL> *) us_socket_context_ext(SSL, us_socket_context(SSL, (us_socket_t *) s));
/* Return true for refuse, false for accept */
@@ -378,7 +378,7 @@ private:
public:
/* WebSocket contexts are always child contexts to a HTTP context so no SSL options are needed as they are inherited */
static WebSocketContext *create(Loop *loop, us_socket_context_t *parentSocketContext) {
static WebSocketContext *create(Loop */*loop*/, us_socket_context_t *parentSocketContext) {
WebSocketContext *webSocketContext = (WebSocketContext *) us_create_child_socket_context(SSL, parentSocketContext, sizeof(WebSocketContextData<SSL>));
if (!webSocketContext) {
return nullptr;
+2 -2
View File
@@ -147,12 +147,12 @@ public:
return 0;
}) {
/* We empty for both pre and post just to make sure */
Loop::get()->addPostHandler(this, [this](Loop *loop) {
Loop::get()->addPostHandler(this, [this](Loop */*loop*/) {
/* Commit pub/sub batches every loop iteration */
topicTree.drain();
});
Loop::get()->addPreHandler(this, [this](Loop *loop) {
Loop::get()->addPreHandler(this, [this](Loop */*loop*/) {
/* Commit pub/sub batches every loop iteration */
topicTree.drain();
});
+1 -1
View File
@@ -34,7 +34,7 @@ struct WebSocketHandshake {
template <typename T>
struct static_for<0, T> {
void operator()(uint32_t *a, uint32_t *hash) {}
void operator()(uint32_t */*a*/, uint32_t */*hash*/) {}
};
static inline uint32_t rol(uint32_t value, size_t bits) {return (value << bits) | (value >> (32 - bits));}