Remove no-unused-parameter compilation flag. Fix some errors. 02/73502/6
authorDariusz Michaluk <d.michaluk@samsung.com>
Wed, 8 Jun 2016 09:18:18 +0000 (11:18 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Wed, 8 Jun 2016 12:32:07 +0000 (14:32 +0200)
Change-Id: Ic091bff6f4936608cfb6d9a32b20e93fc59849b8

CMakeLists.txt
examples/key_password.c
src/crypto.c
src/digest.c
src/internal.h
src/key.c
src/sign.c

index e2b5e35..7b9cb1b 100644 (file)
@@ -59,8 +59,6 @@ ADD_DEFINITIONS("-fPIC")   # Position Independent Code
 ADD_DEFINITIONS("-Werror") # Make all warnings into errors
 ADD_DEFINITIONS("-Wall")   # Generate all warnings
 ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
-# TODO Remove 'no-unused-parameter' after API implementation
-ADD_DEFINITIONS("-Wno-unused-parameter") # Supress unused parameter warning
 ADD_DEFINITIONS("-pedantic") # Be pedantic
 ADD_DEFINITIONS("-pedantic-errors") # Make pedantic warnings into errors
 ADD_DEFINITIONS(-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
index 829797c..ef40fa2 100644 (file)
@@ -76,7 +76,7 @@ exit:
        yaca_key_destroy(lkey);
 }
 
-int main(int argc, char *argv[])
+int main()
 {
        int ret;
        yaca_key_h key = YACA_KEY_NULL;
index 99fa1db..fc48c9e 100644 (file)
@@ -37,7 +37,7 @@
 
 static pthread_mutex_t *mutexes = NULL;
 
-static void locking_callback(int mode, int type, const char *file, int line)
+static void locking_callback(int mode, int type, UNUSED const char *file, UNUSED int line)
 {
        /* Ignore NULL mutexes and lock/unlock error codes as we can't do anything
         * about them. */
index 0191e96..235a0a2 100644 (file)
@@ -50,7 +50,9 @@ static struct yaca_digest_ctx_s *get_digest_ctx(const yaca_context_h ctx)
        }
 }
 
-static int get_digest_output_length(const yaca_context_h ctx, size_t input_len, size_t *output_len)
+static int get_digest_output_length(const yaca_context_h ctx,
+                                    UNUSED size_t input_len,
+                                    size_t *output_len)
 {
        struct yaca_digest_ctx_s *c = get_digest_ctx(ctx);
 
index d9cea2e..62aa8fd 100644 (file)
@@ -32,6 +32,7 @@
 #include <yaca_types.h>
 
 #define API __attribute__ ((visibility("default")))
+#define UNUSED __attribute__((unused))
 
 enum yaca_ctx_type_e {
        YACA_CTX_INVALID = 0,
index 8f02b3c..7abd5ff 100644 (file)
--- a/src/key.c
+++ b/src/key.c
@@ -42,7 +42,7 @@
 /* This callback only exists to block the default OpenSSL one and
  * allow us to check for a proper error code when the key is encrypted
  */
-int password_dummy_cb(char *buf, int size, int rwflag, void *u)
+int password_dummy_cb(char *buf, UNUSED int size, UNUSED int rwflag, UNUSED void *u)
 {
        const char empty[] = "";
 
index afaaec0..7be2005 100644 (file)
@@ -64,7 +64,7 @@ static struct yaca_sign_ctx_s *get_sign_ctx(const yaca_context_h ctx)
 }
 
 static int get_sign_output_length(const yaca_context_h ctx,
-                                  size_t input_len,
+                                  UNUSED size_t input_len,
                                   size_t *output_len)
 {
        struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);