summaryrefslogtreecommitdiff
path: root/audio/gmodplay/patches/patch-ag
blob: 493e3ebd80f9887e9d69477539bb9329199c0eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$NetBSD: patch-ag,v 1.1.1.1 2001/03/19 19:35:52 wiz Exp $

--- common/playlist.cpp.orig	Sun Jan 28 11:22:24 2001
+++ common/playlist.cpp	Sun Jan 28 11:26:25 2001
@@ -13,7 +13,7 @@
 
 #include "playlist.h"
 
-gint CompareNames(gconstpointer a, gconstpointer b);
+gint CompareNames(const gpointer a, const gpointer b);
 
 PlayList *
 CreatePlayList(char *Name)
@@ -56,7 +56,7 @@
 	int i = 1;
 	char *item;
 	
-	while ((item = g_list_nth_data(List->modfiles, i++)) != NULL) {
+	while ((item = (char *)g_list_nth_data(List->modfiles, i++)) != NULL) {
 		delete item;
 	}
 	g_list_free(List->modfiles);
@@ -80,8 +80,8 @@
 int
 RemoveModFile(char *ModFile, PlayList * List)
 {
-	char *name = (char *) g_list_find_custom(List->modfiles, (gpointer) ModFile,
-						 CompareNames);
+	char *name = new char[strlen(ModFile) + 1];
+	strcpy(name, ModFile);
 
 	if (name == NULL)
 		return -1;
@@ -151,13 +151,12 @@
 bool
 IsOnList(char *ModFile, PlayList * List)
 {
-	char *name = (char *) g_list_find_custom(List->modfiles, (gpointer) ModFile,
-						 CompareNames);
+	char *name = (char *) g_list_find(List->modfiles, (gpointer) ModFile);
 	return (name == NULL) ? false : true;
 }
 
 gint
-CompareNames(gconstpointer a, gconstpointer b)
+CompareNames(const gpointer a, const gpointer b)
 {
 	if (strcmp((const char *) a, (const char *) b) == 0)
 		return true;