summaryrefslogtreecommitdiff
path: root/audio/adplug
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2011-09-03 23:40:47 +0000
committerdholland <dholland@pkgsrc.org>2011-09-03 23:40:47 +0000
commit60545ad77a9d1ec194678a005e9085a57adb41fe (patch)
tree12f82f3e6d03aeb2f5387d3903803a56cbeb1bdb /audio/adplug
parentba9407407527cfc4726cf87ce53c8991894052d9 (diff)
downloadpkgsrc-60545ad77a9d1ec194678a005e9085a57adb41fe.tar.gz
const correctness, required by clang
Diffstat (limited to 'audio/adplug')
-rw-r--r--audio/adplug/distinfo3
-rw-r--r--audio/adplug/patches/patch-adplugdb_adplugdb_cpp51
2 files changed, 53 insertions, 1 deletions
diff --git a/audio/adplug/distinfo b/audio/adplug/distinfo
index 27a0bf232dd..206ab7b7f0b 100644
--- a/audio/adplug/distinfo
+++ b/audio/adplug/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.1.1.1 2007/09/10 16:02:26 xtraeme Exp $
+$NetBSD: distinfo,v 1.2 2011/09/03 23:40:47 dholland Exp $
SHA1 (adplug-2.1.tar.bz2) = 49dd798467f194ece1863f18019912f8089cb9df
RMD160 (adplug-2.1.tar.bz2) = 8788c174507fe39d3415f36e1ac60df6b84c889f
Size (adplug-2.1.tar.bz2) = 730686 bytes
+SHA1 (patch-adplugdb_adplugdb_cpp) = 06471351d5b263e515b115960ec0e3d3564dbd16
diff --git a/audio/adplug/patches/patch-adplugdb_adplugdb_cpp b/audio/adplug/patches/patch-adplugdb_adplugdb_cpp
new file mode 100644
index 00000000000..49cb16ad341
--- /dev/null
+++ b/audio/adplug/patches/patch-adplugdb_adplugdb_cpp
@@ -0,0 +1,51 @@
+$NetBSD: patch-adplugdb_adplugdb_cpp,v 1.1 2011/09/03 23:40:47 dholland Exp $
+
+const correctness, required by clang
+
+--- adplugdb/adplugdb.cpp.orig 2006-05-17 12:47:21.000000000 +0000
++++ adplugdb/adplugdb.cpp
+@@ -99,13 +99,15 @@ static const struct {
+ };
+
+ static struct {
+- char *db_file;
++ const char *db_file;
++ char *freeable_db_file;
+ CAdPlugDatabase::CRecord::RecordType rtype;
+ int message_level;
+ bool usedefaultdb, usercomment, cmdkeys;
+ const char *homedir;
+ } cfg = {
+ ADPLUGDB_PATH,
++ NULL,
+ CAdPlugDatabase::CRecord::Plain,
+ MSG_NOTE,
+ false, false, false,
+@@ -297,7 +299,7 @@ static void db_save(void)
+ static void shutdown(void)
+ {
+ // Free userdb variable, if applicable
+- if(cfg.homedir && !cfg.usedefaultdb) free(cfg.db_file);
++ if(cfg.homedir && !cfg.usedefaultdb) free(cfg.freeable_db_file);
+ }
+
+ /***** Main program *****/
+@@ -355,11 +357,14 @@ int main(int argc, char *argv[])
+ // Try user's home directory first, before trying the default location.
+ cfg.homedir = getenv("HOME");
+ if(cfg.homedir && !cfg.usedefaultdb) {
+- cfg.db_file = (char *)malloc(strlen(cfg.homedir) + strlen(ADPLUG_CONFDIR) +
++ char *s;
++ s = (char *)malloc(strlen(cfg.homedir) + strlen(ADPLUG_CONFDIR) +
+ strlen(ADPLUGDB_FILE) + 3);
+- strcpy(cfg.db_file, cfg.homedir);
+- strcat(cfg.db_file, "/" ADPLUG_CONFDIR "/");
+- strcat(cfg.db_file, ADPLUGDB_FILE);
++ strcpy(s, cfg.homedir);
++ strcat(s, "/" ADPLUG_CONFDIR "/");
++ strcat(s, ADPLUGDB_FILE);
++ cfg.freeable_db_file = s;
++ cfg.db_file = s;
+ }
+
+ // Load database file