Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/pkg_install/dist/create Use __UNCONST() rather ...



details:   https://anonhg.NetBSD.org/src/rev/35ba4519aa0b
branches:  trunk
changeset: 455558:35ba4519aa0b
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Apr 06 08:29:01 2019 +0000

description:
Use __UNCONST() rather than a simple cast to free a const char *
while avoiding gcc noise.

diffstat:

 external/bsd/pkg_install/dist/create/util.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r 29bfad2a26f0 -r 35ba4519aa0b external/bsd/pkg_install/dist/create/util.c
--- a/external/bsd/pkg_install/dist/create/util.c       Sat Apr 06 07:57:04 2019 +0000
+++ b/external/bsd/pkg_install/dist/create/util.c       Sat Apr 06 08:29:01 2019 +0000
@@ -147,8 +147,8 @@
 free_memory_file(struct memory_file *file)
 {
        if (file != NULL) {
-               free((char *)file->owner);
-               free((char *)file->group);
+               free(__UNCONST(file->owner));
+               free(__UNCONST(file->group));
                free(file->data);
                free(file);
        }



Home | Main Index | Thread Index | Old Index