Permalink
Browse files

Disabled -Wunused-parameter and removed the numerous workarounds for …

…its presence.
  • Loading branch information...
1 parent 2e162d5 commit 187c5319a00acc80cd5099dd4ba6af157bf6f1af @Ralith Ralith committed Feb 25, 2012
View
@@ -20,7 +20,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake/modules)
# validation
-add_definitions(-Wall -Wextra -std=c99 -Werror -pedantic)
+add_definitions(-Wall -Wextra -std=c99 -Werror -pedantic -Wno-unused-parameter)
# hardening
add_definitions(
View
@@ -209,8 +209,6 @@ struct ChildContext
static void incomingFromParent(evutil_socket_t socket, short eventType, void* vcontext)
{
struct ChildContext* context = (struct ChildContext*) vcontext;
- eventType = eventType;
- socket = socket;
errno = 0;
ssize_t amount = read(context->inFd, context->buffer, MAX_API_REQUEST_SIZE);
@@ -241,7 +239,6 @@ static void incomingFromClient(evutil_socket_t socket, short eventType, void* vc
{
struct Connection* conn = (struct Connection*) vconn;
struct ChildContext* context = conn->context;
- eventType = eventType;
errno = 0;
char buf[MAX_API_REQUEST_SIZE];
ssize_t result = recv(socket, buf, MAX_API_REQUEST_SIZE, 0);
View
@@ -165,7 +165,6 @@ static void fileHandler(struct evhttp_request* req, void* vcontext)
static void apiHandler(struct evhttp_request* req, void* vcontext)
{
struct Context* context = (struct Context*) vcontext;
- context=context;
const char* uri = evhttp_decode_uri(evhttp_request_get_uri(req));
#define KEY "/?q="
@@ -60,7 +60,6 @@ static char* userObj = "This represents a user";
static uint8_t sendMessageToIf2(struct Message* message, struct Interface* iface)
{
- iface=iface;
uint32_t nonce = Endian_bigEndianToHost32(((uint32_t*)message->bytes)[0]);
printf("sent message --> nonce=%d\n", nonce);
assert(message->length + message->padding <= BUFFER_SIZE);
@@ -70,7 +69,6 @@ static uint8_t sendMessageToIf2(struct Message* message, struct Interface* iface
static uint8_t sendMessageToIf1(struct Message* message, struct Interface* iface)
{
- iface=iface;
uint32_t nonce = Endian_bigEndianToHost32(((uint32_t*)message->bytes)[0]);
printf("sent message <-- nonce=%d\n", nonce);
assert(message->length + message->padding <= BUFFER_SIZE);
@@ -80,15 +78,13 @@ static uint8_t sendMessageToIf1(struct Message* message, struct Interface* iface
static uint8_t recvMessageOnIf1(struct Message* message, struct Interface* iface)
{
- iface = iface;
printf("if1 got message! %s\n", message->bytes);
if1Msg = message->bytes;
return Error_NONE;
}
static uint8_t recvMessageOnIf2(struct Message* message, struct Interface* iface)
{
- iface = iface;
printf("if2 got message! %s\n", message->bytes);
if2Msg = message->bytes;
return Error_NONE;
View
@@ -70,9 +70,6 @@ static int handleIncoming(struct DHTMessage* message, void* vcontext)
static int handleOutgoing(struct DHTMessage* message, void* vcontext)
{
- // unused
- vcontext = vcontext;
-
if (message->replyTo != NULL) {
if (message->asDict == NULL) {
message->asDict = Dict_new(message->allocator);
@@ -66,7 +66,6 @@ void SerializationModule_register(struct DHTModuleRegistry* registry,
static int handleOutgoing(struct DHTMessage* message,
void* vcontext)
{
- vcontext = vcontext;
struct Writer* writer =
ArrayWriter_new(message->bytes, DHTModules_MAX_MESSAGE_SIZE, message->allocator);
@@ -86,7 +85,6 @@ static int handleIncoming(struct DHTMessage* message,
{
message->asDict = message->allocator->malloc(sizeof(Dict), message->allocator);
- vcontext = vcontext;
struct Reader* reader =
ArrayReader_new(message->bytes, DHTModules_MAX_MESSAGE_SIZE, message->allocator);
View
@@ -66,8 +66,6 @@ struct Janitor
static bool searchStepCallback(void* callbackContext, struct DHTMessage* result)
{
- callbackContext = callbackContext;
- result = result;
return false;
}
View
@@ -328,8 +328,6 @@ struct NodeList* NodeStore_getClosestNodes(struct NodeStore* store,
const struct Allocator* allocator)
{
// LinkStateNodeCollector strictly requires that allowNodesFartherThanUs be true.
- allowNodesFartherThanUs = allowNodesFartherThanUs;
-
struct NodeCollector* collector = NodeCollector_new(targetAddress,
count,
store->thisNodeAddress,
View
@@ -21,7 +21,6 @@
/** Internal callback, please use AbortHandler_INSTANCE instead. */
static void AbortHandler_callback(char* message, int code, struct ExceptionHandler* handler)
{
- handler = handler;
fprintf(stderr, "Error: %s (code: %d)\n", message, code);
abort();
}
View
@@ -82,8 +82,6 @@ static void closeInterface(void* vcontext)
static void handleEvent(evutil_socket_t socket, short eventType, void* vcontext)
{
- eventType = eventType;
-
// 292 bytes of extra padding to build headers back from for better efficiency.
uint8_t messageBuffer[MAX_PACKET_SIZE + PADDING_SPACE];
View
@@ -319,9 +319,6 @@ static void freeEvent(void* vevent)
static void handleEvent(evutil_socket_t socket, short eventType, void* vcontext)
{
- // We don't care about this, there's only one event registered under this socket.
- eventType = eventType;
-
struct UDPInterface* context = (struct UDPInterface*) vcontext;
struct Message message =
View
@@ -194,7 +194,6 @@ static void freeAllocator(const struct Allocator* allocator)
/** Fake freeAllocator so that child allocators don't get freed. */
static void doNothing(const struct Allocator* allocator)
{
- allocator = allocator;
}
/** @see Allocator->onFree() */
View
@@ -38,10 +38,6 @@ static void handleEvent(evutil_socket_t socket,
short eventType,
void* vcontext)
{
- // unused
- socket = socket;
- eventType = eventType;
-
struct Timeout* timeout = (struct Timeout*) vcontext;
timeout->callback(timeout->callbackContext);
}

0 comments on commit 187c531

Please sign in to comment.