Fix 64bit compilation issue (and remove questionably casting of void* to
PATCH 1/1 Fix 64bit compilation issue (and remove questionably casting of void* to
int).
---
libsepol/tests/test-hashtab.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
libsepol/tests/test-hashtab.c +5 -4
@@ -42,13 +42,14 @@ static void test_hashtab_iter(void)struct sepol_iter *iter;int ret, i;char *strings[] = {"foo" ,"bar" ,"baz" }; +int ints[] = {0 ,1 ,2 }; h =hashtab_create (sepol_symhash, sepol_symcmp,64 );CU_ASSERT (h !=NULL ); - ret =hashtab_insert (h, strings[0 ], (void *)0 ); - ret =hashtab_insert (h, strings[1 ], (void *)1 ); - ret =hashtab_insert (h, strings[2 ], (void *)2 ); + ret =hashtab_insert (h, strings[0 ], &ints[0 ]); + ret =hashtab_insert (h, strings[1 ], &ints[1 ]); + ret =hashtab_insert (h, strings[2 ], &ints[2 ]); ret =sepol_iter_create (NULL , &iter);CU_ASSERT (ret ==SEPOL_OK );
@@ -57,7 +58,7 @@ static void test_hashtab_iter(void)while (ret ==SEPOL_OK ) { cur = (hashtab_ptr_t )sepol_iter_get_data (NULL , iter);CU_ASSERT (cur !=NULL ); - i = (int )cur->datum; + i = *(int *)cur->datum;CU_ASSERT (i <3 );CU_ASSERT (strcmp (strings[i], (char *)cur->key) ==0 ); ret =sepol_iter_next (NULL , iter);
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Karl MacMillan
int).
Signed-off-by Karl MacMillan <[email protected]>
Merge at will.
Quoted 42 lines
---
libsepol/tests/test-hashtab.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)libsepol/tests/test-hashtab.c +5
-5@@ -42,13 +42,14 @@ static void test_hashtab_iter(void)struct sepol_iter *iter;int ret, i;char *strings[] = {"foo" ,"bar" ,"baz" }; +int ints[] = {0 ,1 ,2 }; h =hashtab_create (sepol_symhash, sepol_symcmp,64 );CU_ASSERT (h !=NULL ); - ret =hashtab_insert (h, strings[0 ], (void *)0 ); - ret =hashtab_insert (h, strings[1 ], (void *)1 ); - ret =hashtab_insert (h, strings[2 ], (void *)2 ); + ret =hashtab_insert (h, strings[0 ], &ints[0 ]); + ret =hashtab_insert (h, strings[1 ], &ints[1 ]); + ret =hashtab_insert (h, strings[2 ], &ints[2 ]); ret =sepol_iter_create (NULL , &iter);CU_ASSERT (ret ==SEPOL_OK );@@ -57,7 +58,7 @@ static void test_hashtab_iter(void)while (ret ==SEPOL_OK ) { cur = (hashtab_ptr_t )sepol_iter_get_data (NULL , iter);CU_ASSERT (cur !=NULL ); - i = (int )cur->datum; + i = *(int *)cur->datum;CU_ASSERT (i <3 );CU_ASSERT (strcmp (strings[i], (char *)cur->key) ==0 ); ret =sepol_iter_next (NULL , iter); --This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Karl MacMillan
AppliedQuoted 9 lines · Stephen Smalley
Quoted 3 lines · Karl MacMillan
int).
Signed-off-by Karl MacMillan <[email protected]>Acked-by Stephen Smalley <[email protected]>Merge at will.
Merged into policyrep branch.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.