diff options
author | green <green@FreeBSD.org> | 2004-09-01 09:48:06 +0800 |
---|---|---|
committer | green <green@FreeBSD.org> | 2004-09-01 09:48:06 +0800 |
commit | 9992ce61542d7d8ecd6888d7fa50f5c5aea596cf (patch) | |
tree | b0933f60aad9d138f5220cd697eb6a5237752fdc | |
parent | 7678455634ed9b0d03a852f1a9abb7140a3e8285 (diff) | |
download | freebsd-ports-gnome-9992ce61542d7d8ecd6888d7fa50f5c5aea596cf.tar.gz freebsd-ports-gnome-9992ce61542d7d8ecd6888d7fa50f5c5aea596cf.tar.zst freebsd-ports-gnome-9992ce61542d7d8ecd6888d7fa50f5c5aea596cf.zip |
Try to finish fighting to make cvs get the right patch files.
-rw-r--r-- | audio/xmms-imms/files/patch-correlate.cc | 9 | ||||
-rw-r--r-- | audio/xmms-imms/files/patch-fetcher.cc | 17 | ||||
-rw-r--r-- | audio/xmms-imms/files/patch-picker.cc | 38 | ||||
-rw-r--r-- | audio/xmms-imms/files/patch-plugin.cc | 55 | ||||
-rw-r--r-- | audio/xmms-imms/files/patch-plugin.h | 14 | ||||
-rw-r--r-- | audio/xmms-imms/files/patch-spectrum.h | 14 | ||||
-rw-r--r-- | audio/xmms-imms/files/patch-utils.h | 46 |
7 files changed, 46 insertions, 147 deletions
diff --git a/audio/xmms-imms/files/patch-correlate.cc b/audio/xmms-imms/files/patch-correlate.cc deleted file mode 100644 index bde17fb6e601..000000000000 --- a/audio/xmms-imms/files/patch-correlate.cc +++ /dev/null @@ -1,9 +0,0 @@ ---- correlate.cc.orig Thu Apr 15 16:15:24 2004 -+++ correlate.cc Sat Aug 14 11:15:59 2004 -@@ -1,5 +1,6 @@ - #include <assert.h> - #include <iostream> -+#include <math.h> - - #include "correlate.h" - #include "strmanip.h" diff --git a/audio/xmms-imms/files/patch-fetcher.cc b/audio/xmms-imms/files/patch-fetcher.cc deleted file mode 100644 index 502e6257a5b2..000000000000 --- a/audio/xmms-imms/files/patch-fetcher.cc +++ /dev/null @@ -1,17 +0,0 @@ ---- fetcher.cc.orig Sun Jan 25 16:55:21 2004 -+++ fetcher.cc Wed Feb 11 18:34:39 2004 -@@ -200,8 +200,12 @@ - return identified; - - // Erase the first occurrence of the artist -- list<string>::iterator i = find(file_parts.begin(), file_parts.end(), -- artist); -+ list<string>::iterator i = file_parts.begin(); -+ while (i != file_parts.end()) { -+ if (*i == artist) -+ break; -+ i++; -+ } - if (i != file_parts.end()) - file_parts.erase(i); - diff --git a/audio/xmms-imms/files/patch-picker.cc b/audio/xmms-imms/files/patch-picker.cc deleted file mode 100644 index fccc4e7d7436..000000000000 --- a/audio/xmms-imms/files/patch-picker.cc +++ /dev/null @@ -1,38 +0,0 @@ ---- picker.cc.orig Thu Apr 15 16:15:24 2004 -+++ picker.cc Sat Aug 14 11:19:33 2004 -@@ -2,6 +2,7 @@ - #include <algorithm> - - #include <math.h> -+#include <math.h> - - #include "picker.h" - #include "strmanip.h" -@@ -53,9 +54,12 @@ - - SongData data(position, path); - -- if (find(candidates.begin(), candidates.end(), data) -- != candidates.end()) -- return true; -+ Candidates::iterator i = candidates.begin(); -+ while (i != candidates.end()) { -+ if (*i == data) -+ return true; -+ i++; -+ } - - if (fetch_song_info(data)) - { -@@ -83,8 +87,9 @@ - - void SongPicker::do_events() - { -- bool more; -- for (int i = 0; i < 4 && (more = add_candidate()); ++i); -+ bool more = true; -+ for (int i = 0; i < 4 && more; ++i) -+ more = add_candidate(); - if (!more) - identify_more(); - } diff --git a/audio/xmms-imms/files/patch-plugin.cc b/audio/xmms-imms/files/patch-plugin.cc deleted file mode 100644 index 4e841a6693c8..000000000000 --- a/audio/xmms-imms/files/patch-plugin.cc +++ /dev/null @@ -1,55 +0,0 @@ ---- plugin.cc.orig Sun Jan 25 16:55:21 2004 -+++ plugin.cc Wed Feb 11 18:51:51 2004 -@@ -5,6 +5,9 @@ - #include <string> - #include <iostream> - #include <time.h> -+#include <unistd.h> -+#include <fcntl.h> -+#include <limits.h> - - #include <xmms/plugin.h> - #include <xmms/xmmsctrl.h> -@@ -21,6 +24,7 @@ - - // Local vars - static Imms *imms = NULL; -+static int urandom = -1; - unsigned int time_left = 1000, sloppy_skips = 0; - int last_plpos = -2, cur_plpos, pl_length = -1; - int good_length = 0, song_length = 0, delay = 0; -@@ -39,6 +43,15 @@ - FIND_NEXT = 2 - } state; - -+// Random -+int imms_random(int max) -+{ -+ unsigned long rand_num; -+ (void)read(urandom, &rand_num, sizeof(rand_num)); -+ double cof = rand_num / (ULONG_MAX + 1.0); -+ return (int)(max * cof); -+} -+ - // Wrapper that frees memory - string imms_get_playlist_item(int at) - { -@@ -62,14 +75,17 @@ - - void imms_init() - { -- if (!imms) -+ if (!imms) { - imms = new Imms(); -+ urandom = open("/dev/urandom", O_RDONLY); -+ } - - state = IDLE; - } - - void imms_cleanup(void) - { -+ close(urandom); - delete imms; - imms = 0; - } diff --git a/audio/xmms-imms/files/patch-plugin.h b/audio/xmms-imms/files/patch-plugin.h deleted file mode 100644 index c3d440914912..000000000000 --- a/audio/xmms-imms/files/patch-plugin.h +++ /dev/null @@ -1,14 +0,0 @@ ---- plugin.h.orig Thu Apr 15 16:15:24 2004 -+++ plugin.h Sat Aug 14 11:08:55 2004 -@@ -1,7 +1,11 @@ - #ifndef __PLUGIN_H - #define __PLUGIN_H - -+#ifdef HAVE_STDIN - #include <stdint.h> -+#else -+#include <sys/types.h> -+#endif - #include "immsconf.h" - - #ifdef __cplusplus diff --git a/audio/xmms-imms/files/patch-spectrum.h b/audio/xmms-imms/files/patch-spectrum.h deleted file mode 100644 index 75bdc23d775d..000000000000 --- a/audio/xmms-imms/files/patch-spectrum.h +++ /dev/null @@ -1,14 +0,0 @@ ---- spectrum.h.orig Sun Jan 25 16:55:21 2004 -+++ spectrum.h Wed Feb 11 17:45:20 2004 -@@ -1,7 +1,11 @@ - #ifndef __SPECTRUM_H - #define __SPECTRUM_H - -+#if HAVE_STDINT_H - #include <stdint.h> -+#else -+#include <sys/types.h> -+#endif - #include <time.h> - #include <sys/time.h> - diff --git a/audio/xmms-imms/files/patch-utils.h b/audio/xmms-imms/files/patch-utils.h new file mode 100644 index 000000000000..7d62dba0e270 --- /dev/null +++ b/audio/xmms-imms/files/patch-utils.h @@ -0,0 +1,46 @@ +--- utils.h.orig Wed Aug 18 01:56:28 2004 ++++ utils.h Tue Aug 31 21:40:20 2004 +@@ -1,7 +1,9 @@ + #ifndef __UTILS_H + #define __UTILS_H + ++#include <fcntl.h> + #include <sys/time.h> ++#include <stdexcept> + #include <string> + + #define HOUR (60*60) +@@ -10,8 +12,32 @@ + + using std::string; + +-int imms_random(int max); + time_t usec_diff(struct timeval &tv1, struct timeval &tv2); ++ ++class ImmsRandom ++{ ++public: ++ ImmsRandom() ++ { ++ urandom = open("/dev/urandom", O_RDONLY); ++ if (urandom == -1) ++ throw std::runtime_error("could not open /dev/urandom"); ++ } ++ ~ImmsRandom() ++ { ++ (void)close(urandom); ++ } ++ int imms_random(int max) ++ { ++ unsigned long rand_num; ++ ++ (void)read(urandom, &rand_num, sizeof(rand_num)); ++ double cof = rand_num / (ULONG_MAX + 1.0); ++ return (int)(max * cof); ++ } ++private: ++ int urandom; ++}; + + class StackTimer + { |