| @@ -1,59 +1,60 @@ | | | @@ -1,59 +1,60 @@ |
1 | $NetBSD: patch-cddb_c,v 1.1 2011/10/02 01:20:55 dholland Exp $ | | 1 | $NetBSD: patch-cddb_c,v 1.2 2011/12/14 02:54:27 sbd Exp $ |
2 | | | 2 | |
3 | - fix include silliness | | 3 | - fix include silliness |
4 | - fix LP64 problems | | 4 | - fix LP64 problems |
5 | | | 5 | |
6 | --- cddb.c.orig 2001-10-28 11:41:51.000000000 +0000 | | 6 | --- cddb.c.orig 2001-10-28 11:41:51.000000000 +0000 |
7 | +++ cddb.c | | 7 | +++ cddb.c |
8 | @@ -45,10 +45,7 @@ | | 8 | @@ -45,11 +45,8 @@ |
9 | #include <stdlib.h> | | 9 | #include <stdlib.h> |
10 | #include <sys/socket.h> | | 10 | #include <sys/socket.h> |
11 | #include <sys/types.h> | | 11 | #include <sys/types.h> |
12 | -#ifndef __FreeBSD__ | | 12 | -#ifndef __FreeBSD__ |
13 | # include <arpa/inet.h> | | 13 | # include <arpa/inet.h> |
14 | -#else | | 14 | -#else |
15 | # include <netinet/in.h> | | 15 | # include <netinet/in.h> |
16 | -#endif | | 16 | -#endif |
17 | #include <netdb.h> | | 17 | #include <netdb.h> |
18 | #include <string.h> | | 18 | #include <string.h> |
19 | @@ -431,7 +431,7 @@ GList *cddb_serverrequest(gchar *server, | | 19 | #include <unistd.h> |
| | | 20 | @@ -431,7 +428,7 @@ GList *cddb_serverrequest(gchar *server, |
20 | if (result==210) | | 21 | if (result==210) |
21 | { | | 22 | { |
22 | /* the first line is the corresponding cddb_key */ | | 23 | /* the first line is the corresponding cddb_key */ |
23 | - entry=g_list_append(entry,(gpointer)es->cddb_key); | | 24 | - entry=g_list_append(entry,(gpointer)es->cddb_key); |
24 | + entry=g_list_append(entry,(gpointer)(intptr_t)es->cddb_key); | | 25 | + entry=g_list_append(entry,(gpointer)(intptr_t)es->cddb_key); |
25 | /* store a response line */ | | 26 | /* store a response line */ |
26 | while (cddb_poll(cddb_sfd,resstr)) | | 27 | while (cddb_poll(cddb_sfd,resstr)) |
27 | entry=g_list_append(entry,g_strdup(resstr)); | | 28 | entry=g_list_append(entry,g_strdup(resstr)); |
28 | @@ -458,7 +458,7 @@ GList *cddb_cachelookup(cddb_essentials | | 29 | @@ -458,7 +455,7 @@ GList *cddb_cachelookup(cddb_essentials |
29 | while ((current!=NULL)&&(result==NULL)) | | 30 | while ((current!=NULL)&&(result==NULL)) |
30 | { | | 31 | { |
31 | GList *entry=(GList*)current->data; | | 32 | GList *entry=(GList*)current->data; |
32 | - if ((int)entry->data==es->cddb_key) | | 33 | - if ((int)entry->data==es->cddb_key) |
33 | + if ((int)(intptr_t)entry->data==es->cddb_key) | | 34 | + if ((int)(intptr_t)entry->data==es->cddb_key) |
34 | result=entry; | | 35 | result=entry; |
35 | current=current->next; | | 36 | current=current->next; |
36 | }; | | 37 | }; |
37 | @@ -754,7 +754,7 @@ void *cddb_commthread(void *s) | | 38 | @@ -754,7 +751,7 @@ void *cddb_commthread(void *s) |
38 | * cancelled. | | 39 | * cancelled. |
39 | * data can point to additional informations passed to the callback | | 40 | * data can point to additional informations passed to the callback |
40 | * but may otherwise safely be set to NULL */ | | 41 | * but may otherwise safely be set to NULL */ |
41 | -int cddb_lookup(cddb_essentials *es, | | 42 | -int cddb_lookup(cddb_essentials *es, |
42 | +cddb_infostruct *cddb_lookup(cddb_essentials *es, | | 43 | +cddb_infostruct *cddb_lookup(cddb_essentials *es, |
43 | int tracknum, | | 44 | int tracknum, |
44 | cddb_datahandler callback, | | 45 | cddb_datahandler callback, |
45 | gpointer data) | | 46 | gpointer data) |
46 | @@ -786,12 +786,12 @@ int cddb_lookup(cddb_essentials *es, | | 47 | @@ -786,12 +783,12 @@ int cddb_lookup(cddb_essentials *es, |
47 | pthread_mutex_unlock(&cddb_sem); | | 48 | pthread_mutex_unlock(&cddb_sem); |
48 | | | 49 | |
49 | }; | | 50 | }; |
50 | - return (int)info; | | 51 | - return (int)info; |
51 | + return info; | | 52 | + return info; |
52 | }; | | 53 | }; |
53 | | | 54 | |
54 | /* kill a cddb lookup job. this is done e.g. in tracks.c when the last reference | | 55 | /* kill a cddb lookup job. this is done e.g. in tracks.c when the last reference |
55 | * to a track has been cleared and the track is about to be deleted */ | | 56 | * to a track has been cleared and the track is about to be deleted */ |
56 | -void cddb_killjob(int jobid) | | 57 | -void cddb_killjob(int jobid) |
57 | +void cddb_killjob(cddb_infostruct *jobid) | | 58 | +void cddb_killjob(cddb_infostruct *jobid) |
58 | { | | 59 | { |
59 | if (jobid) | | 60 | if (jobid) |