From 963624735f0a1f7d1e7fed0fa7b22dd52e920113 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 8 Apr 2019 06:27:55 +0000 Subject: [PATCH] SW: Fix -Wcast-qual in grpscan git-svn-id: https://svn.eduke32.com/eduke32@7528 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/sw/src/grpscan.cpp | 10 +++++----- source/sw/src/grpscan.h | 11 +++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/source/sw/src/grpscan.cpp b/source/sw/src/grpscan.cpp index 0863cb60f..b7bd24222 100644 --- a/source/sw/src/grpscan.cpp +++ b/source/sw/src/grpscan.cpp @@ -30,11 +30,11 @@ #include "grpscan.h" -grpfile grpfiles[numgrpfiles] = +internalgrpfile grpfiles[numgrpfiles] = { - { "Registered Version", 0x7545319Fu, 47536148, NULL }, - { "Shareware Version", 0x08A7FA1Fu, 26056769, NULL }, - { "Wanton Destruction (Addon)", 0xA9AAA7B7u, 48698128, NULL }, + { "Registered Version", 0x7545319Fu, 47536148 }, + { "Shareware Version", 0x08A7FA1Fu, 26056769 }, + { "Wanton Destruction (Addon)", 0xA9AAA7B7u, 48698128 }, }; grpfile *foundgrps = NULL; @@ -204,7 +204,7 @@ void FreeGroups(void) while (foundgrps) { fg = foundgrps->next; - free((char *)foundgrps->name); + free(foundgrps->name); free(foundgrps); foundgrps = fg; } diff --git a/source/sw/src/grpscan.h b/source/sw/src/grpscan.h index 7e9e31ec0..782102a40 100644 --- a/source/sw/src/grpscan.h +++ b/source/sw/src/grpscan.h @@ -26,15 +26,22 @@ // List of internally-known GRP files #define numgrpfiles 3 -struct grpfile +struct internalgrpfile { const char *name; unsigned int crcval; int size; +}; +struct grpfile +{ + char *name; + unsigned int crcval; + int size; struct grpfile *next; }; -extern grpfile grpfiles[numgrpfiles], *foundgrps; +extern internalgrpfile grpfiles[numgrpfiles]; +extern grpfile *foundgrps; int ScanGroups(void); void FreeGroups(void);