From e294e986f1a0bfff3da82512cbda5a3fad3193f2 Mon Sep 17 00:00:00 2001
From: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
Date: Fri, 20 Jul 2018 20:13:45 +0200
Subject: [PATCH] Fix compilation error: duplicate 'const' declaration
specifier
In file included from error.c:22:
error.h:39:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *nxt_str_error(nxt_error_t err);
^~~~~
error.c:24:19: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
static const char const *err_str[] = {
^~~~~
error.c:37:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *
^~~~~
---
error.c | 4 ++--
error.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/error.c b/error.c
index fd45100..36027ab 100644
--- a/error.c
+++ b/error.c
@@ -21,7 +21,7 @@
#include "error.h"
-static const char const *err_str[] = {
+static const char * const err_str[] = {
"Success",
"NXT not found on USB bus",
"Error trying to configure the NXT USB link",
@@ -34,7 +34,7 @@ static const char const *err_str[] = {
"Invalid firmware image",
};
-const char const *
+const char * const
nxt_str_error(nxt_error_t err)
{
return err_str[err];
diff --git a/error.h b/error.h
index 6d6c681..bb0f163 100644
--- a/error.h
+++ b/error.h
@@ -36,7 +36,7 @@ typedef enum
NXT_INVALID_FIRMWARE = 9,
} nxt_error_t;
-const char const *nxt_str_error(nxt_error_t err);
+const char * const nxt_str_error(nxt_error_t err);
#define NXT_ERR(expr) \
do { \
--
2.17.1