Declare all read only data structures as const

By analysing objdump output some read only structures were found in
.data section. To help compiler further optimize code declare these
as const.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
This commit is contained in:
Mikael Kanstrup 2015-04-24 09:19:53 +02:00 committed by Jouni Malinen
parent fd4fb28179
commit 8b423edbd3
32 changed files with 93 additions and 92 deletions

View file

@ -17,7 +17,7 @@ struct wps_attr_parse_test {
int extra;
};
struct wps_attr_parse_test wps_attr_parse_test_cases[] = {
const struct wps_attr_parse_test wps_attr_parse_test_cases[] = {
/* Empty message */
{ "", 0, 0 },
/* Truncated attribute header */
@ -271,7 +271,7 @@ static int wps_attr_parse_tests(void)
for (i = 0; i < ARRAY_SIZE(wps_attr_parse_test_cases); i++) {
struct wpabuf *buf;
size_t len;
struct wps_attr_parse_test *test =
const struct wps_attr_parse_test *test =
&wps_attr_parse_test_cases[i];
len = os_strlen(test->data) / 2;