r33888 - in trunk: Makefile gui/win32/playlist.c gui/win32/playlist.h
Author: diego Date: Fri Jul 22 00:24:57 2011 New Revision: 33888 Log: foo Modified: trunk/Makefile trunk/gui/win32/playlist.c trunk/gui/win32/playlist.h Modified: trunk/Makefile ============================================================================== --- trunk/Makefile Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/Makefile Fri Jul 22 00:24:57 2011 (r33888) @@ -720,20 +720,14 @@ DIRS = . \ input \ libaf \ libao2 \ - libass \ - libdvdcss \ - libdvdnav \ - libdvdnav/vm \ - libdvdread4 \ libmenu \ libmpcodecs \ libmpcodecs/native \ libmpdemux \ - libmpeg2 \ libvo \ loader \ - loader/dshow \ loader/dmo \ + loader/dshow \ loader/wine \ mp3lib \ osdep \ @@ -742,14 +736,22 @@ DIRS = . \ stream/librtsp \ stream/realrtsp \ sub \ - tremor \ TOOLS \ vidix \ +ALL_DIRS = $(DIRS) \ + libass \ + libdvdcss \ + libdvdnav \ + libdvdnav/vm \ + libdvdread4 \ + libmpeg2 \ + tremor \ + ALLHEADERS = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.h)) ADDSUFFIXES = $(foreach suf,$(1),$(addsuffix $(suf),$(2))) -ADD_ALL_DIRS = $(call ADDSUFFIXES,$(1),$(DIRS)) +ADD_ALL_DIRS = $(call ADDSUFFIXES,$(1),$(ALL_DIRS)) ADD_ALL_EXESUFS = $(1) $(call ADDSUFFIXES,$(EXESUFS_ALL),$(1)) Modified: trunk/gui/win32/playlist.c ============================================================================== --- trunk/gui/win32/playlist.c Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.c Fri Jul 22 00:24:57 2011 (r33888) @@ -22,6 +22,7 @@ */ #include <windows.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "mp_msg.h" @@ -29,7 +30,7 @@ /* TODO: implement sort_playlist */ -BOOL adddirtoplaylist(playlist_t *playlist, const char *path, BOOL recursive) +bool adddirtoplaylist(playlist_t *playlist, const char *path, bool recursive) { HANDLE findHandle = INVALID_HANDLE_VALUE; WIN32_FIND_DATA finddata; Modified: trunk/gui/win32/playlist.h ============================================================================== --- trunk/gui/win32/playlist.h Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.h Fri Jul 22 00:24:57 2011 (r33888) @@ -24,7 +24,7 @@ #ifndef MPLAYER_GUI_PLAYLIST_H #define MPLAYER_GUI_PLAYLIST_H -#include <windows.h> +#include <stdbool.h> typedef struct { @@ -56,6 +56,6 @@ struct playlist_t #define SORT_BYDURATION 4 playlist_t *create_playlist(void); -BOOL adddirtoplaylist(playlist_t *playlist, const char* path, BOOL recursive); +bool adddirtoplaylist(playlist_t *playlist, const char* path, bool recursive); #endif /* MPLAYER_GUI_PLAYLIST_H */
diego <subversion <at> mplayerhq.hu> writes:
Log: foo
Modified: trunk/Makefile trunk/gui/win32/playlist.c trunk/gui/win32/playlist.h
Would you mind explaining how a cosmetic change to the Makefile is related to a change in the included headers on windows? I know this doesn't matter in your pet project, but it would be fine if you could try to remember the conventions when committing here. And consider using log messages, they help reading -cvslog. CE
On Thu, Jul 21, 2011 at 10:33:36PM +0000, Carl Eugen Hoyos wrote:
diego <subversion <at> mplayerhq.hu> writes:
Log: foo
Modified: trunk/Makefile trunk/gui/win32/playlist.c trunk/gui/win32/playlist.h
Would you mind explaining how a cosmetic change to the Makefile is related to a change in the included headers on windows?
Work-in-progress batch commit from my local git-svn tree, see my other mail... Diego
On Fri, Jul 22, 2011 at 12:24:57AM +0200, diego wrote:
Log: foo
Sorry, I'm a complete retard and just accidentally pushed random and unfinished nonsense from my git-svn tree. Apologies for being tired and negligent. Anyway, since it's already in, we might as well review quickly instead of ripping out and adding back...
--- trunk/Makefile Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/Makefile Fri Jul 22 00:24:57 2011 (r33888) @@ -720,20 +720,14 @@ DIRS = . \ libao2 \ - libass \ - libdvdcss \ - libdvdnav \ - libdvdnav/vm \ - libdvdread4 \ libmenu \ libmpcodecs \ libmpcodecs/native \ libmpdemux \ - libmpeg2 \ libvo \ loader \ - loader/dshow \ loader/dmo \ + loader/dshow \ loader/wine \ @@ -742,14 +736,22 @@ DIRS = . \ sub \ - tremor \ TOOLS \ vidix \
+ALL_DIRS = $(DIRS) \ + libass \ + libdvdcss \ + libdvdnav \ + libdvdnav/vm \ + libdvdread4 \ + libmpeg2 \ + tremor \ + ALLHEADERS = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.h))
ADDSUFFIXES = $(foreach suf,$(1),$(addsuffix $(suf),$(2))) -ADD_ALL_DIRS = $(call ADDSUFFIXES,$(1),$(DIRS)) +ADD_ALL_DIRS = $(call ADDSUFFIXES,$(1),$(ALL_DIRS)) ADD_ALL_EXESUFS = $(1) $(call ADDSUFFIXES,$(EXESUFS_ALL),$(1))
This I will just keep, it does not really hurt.
--- trunk/gui/win32/playlist.c Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.c Fri Jul 22 00:24:57 2011 (r33888) @@ -22,6 +22,7 @@
#include <windows.h> +#include <stdbool.h> #include <stdio.h> @@ -29,7 +30,7 @@
-BOOL adddirtoplaylist(playlist_t *playlist, const char *path, BOOL recursive) +bool adddirtoplaylist(playlist_t *playlist, const char *path, bool recursive) { HANDLE findHandle = INVALID_HANDLE_VALUE; --- trunk/gui/win32/playlist.h Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.h Fri Jul 22 00:24:57 2011 (r33888) @@ -24,7 +24,7 @@
-#include <windows.h> +#include <stdbool.h>
@@ -56,6 +56,6 @@ struct playlist_t
playlist_t *create_playlist(void); -BOOL adddirtoplaylist(playlist_t *playlist, const char* path, BOOL recursive); +bool adddirtoplaylist(playlist_t *playlist, const char* path, bool recursive);
Ingo, can you confirm this is OK or not? Diego
On Fri, Jul 22, 2011 at 12:41:11AM +0200, Diego Biurrun wrote:
On Fri, Jul 22, 2011 at 12:24:57AM +0200, diego wrote:
--- trunk/gui/win32/playlist.c Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.c Fri Jul 22 00:24:57 2011 (r33888) @@ -22,6 +22,7 @@
#include <windows.h> +#include <stdbool.h> #include <stdio.h> @@ -29,7 +30,7 @@
-BOOL adddirtoplaylist(playlist_t *playlist, const char *path, BOOL recursive) +bool adddirtoplaylist(playlist_t *playlist, const char *path, bool recursive) { HANDLE findHandle = INVALID_HANDLE_VALUE; --- trunk/gui/win32/playlist.h Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.h Fri Jul 22 00:24:57 2011 (r33888) @@ -24,7 +24,7 @@
-#include <windows.h> +#include <stdbool.h>
@@ -56,6 +56,6 @@ struct playlist_t
playlist_t *create_playlist(void); -BOOL adddirtoplaylist(playlist_t *playlist, const char* path, BOOL recursive); +bool adddirtoplaylist(playlist_t *playlist, const char* path, bool recursive);
Ingo, can you confirm this is OK or not?
I just confirmed this works fine on Cygwin, so I guess we can keep it. Diego
On 26 Jul 2011, at 23:28, Diego Biurrun <diego@biurrun.de> wrote:
On Fri, Jul 22, 2011 at 12:41:11AM +0200, Diego Biurrun wrote:
On Fri, Jul 22, 2011 at 12:24:57AM +0200, diego wrote:
--- trunk/gui/win32/playlist.c Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.c Fri Jul 22 00:24:57 2011 (r33888) @@ -22,6 +22,7 @@
#include <windows.h> +#include <stdbool.h> #include <stdio.h> @@ -29,7 +30,7 @@
-BOOL adddirtoplaylist(playlist_t *playlist, const char *path, BOOL recursive) +bool adddirtoplaylist(playlist_t *playlist, const char *path, bool recursive) { HANDLE findHandle = INVALID_HANDLE_VALUE; --- trunk/gui/win32/playlist.h Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.h Fri Jul 22 00:24:57 2011 (r33888) @@ -24,7 +24,7 @@
-#include <windows.h> +#include <stdbool.h>
@@ -56,6 +56,6 @@ struct playlist_t
playlist_t *create_playlist(void); -BOOL adddirtoplaylist(playlist_t *playlist, const char* path, BOOL recursive); +bool adddirtoplaylist(playlist_t *playlist, const char* path, bool recursive);
Ingo, can you confirm this is OK or not?
I just confirmed this works fine on Cygwin, so I guess we can keep it.
Well, bool has different semantic and also performance. Using int would be more similar in behaviour to BOOL and consistent with basically all other parts of MPlayer.
On Wed, Jul 27, 2011 at 07:37:37AM +0200, Reimar Döffinger wrote:
On 26 Jul 2011, at 23:28, Diego Biurrun <diego@biurrun.de> wrote:
On Fri, Jul 22, 2011 at 12:41:11AM +0200, Diego Biurrun wrote:
On Fri, Jul 22, 2011 at 12:24:57AM +0200, diego wrote:
--- trunk/gui/win32/playlist.c Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.c Fri Jul 22 00:24:57 2011 (r33888) @@ -29,7 +30,7 @@
-BOOL adddirtoplaylist(playlist_t *playlist, const char *path, BOOL recursive) +bool adddirtoplaylist(playlist_t *playlist, const char *path, bool recursive) { --- trunk/gui/win32/playlist.h Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.h Fri Jul 22 00:24:57 2011 (r33888) @@ -56,6 +56,6 @@ struct playlist_t
-BOOL adddirtoplaylist(playlist_t *playlist, const char* path, BOOL recursive); +bool adddirtoplaylist(playlist_t *playlist, const char* path, bool recursive);
Ingo, can you confirm this is OK or not?
I just confirmed this works fine on Cygwin, so I guess we can keep it.
Well, bool has different semantic and also performance. Using int would be more similar in behaviour to BOOL and consistent with basically all other parts of MPlayer.
Done. Diego
On Sat, Jul 30, 2011 at 05:38:39PM +0200, Diego Biurrun wrote:
On Wed, Jul 27, 2011 at 07:37:37AM +0200, Reimar Döffinger wrote:
On 26 Jul 2011, at 23:28, Diego Biurrun <diego@biurrun.de> wrote:
On Fri, Jul 22, 2011 at 12:41:11AM +0200, Diego Biurrun wrote:
On Fri, Jul 22, 2011 at 12:24:57AM +0200, diego wrote:
--- trunk/gui/win32/playlist.c Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.c Fri Jul 22 00:24:57 2011 (r33888) @@ -29,7 +30,7 @@
-BOOL adddirtoplaylist(playlist_t *playlist, const char *path, BOOL recursive) +bool adddirtoplaylist(playlist_t *playlist, const char *path, bool recursive) { --- trunk/gui/win32/playlist.h Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.h Fri Jul 22 00:24:57 2011 (r33888) @@ -56,6 +56,6 @@ struct playlist_t
-BOOL adddirtoplaylist(playlist_t *playlist, const char* path, BOOL recursive); +bool adddirtoplaylist(playlist_t *playlist, const char* path, bool recursive);
Ingo, can you confirm this is OK or not?
I just confirmed this works fine on Cygwin, so I guess we can keep it.
Well, bool has different semantic and also performance. Using int would be more similar in behaviour to BOOL and consistent with basically all other parts of MPlayer.
Done.
Thanks, I didn't mind much really though I guess a lot of people might still be unfamiliar with the special behaviour of the bool type, so it might be better to just avoid it...
Reimar Döffinger wrote on Sat, 30 Jul 2011 19:21:05 +0200:
On Sat, Jul 30, 2011 at 05:38:39PM +0200, Diego Biurrun wrote:
On Wed, Jul 27, 2011 at 07:37:37AM +0200, Reimar Döffinger wrote:
On 26 Jul 2011, at 23:28, Diego Biurrun <diego@biurrun.de> wrote:
On Fri, Jul 22, 2011 at 12:41:11AM +0200, Diego Biurrun wrote:
On Fri, Jul 22, 2011 at 12:24:57AM +0200, diego wrote:
--- trunk/gui/win32/playlist.c Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.c Fri Jul 22 00:24:57 2011 (r33888) @@ -29,7 +30,7 @@
-BOOL adddirtoplaylist(playlist_t *playlist, const char *path, BOOL recursive) +bool adddirtoplaylist(playlist_t *playlist, const char *path, bool recursive) { --- trunk/gui/win32/playlist.h Thu Jul 21 03:21:36 2011 (r33887) +++ trunk/gui/win32/playlist.h Fri Jul 22 00:24:57 2011 (r33888) @@ -56,6 +56,6 @@ struct playlist_t
-BOOL adddirtoplaylist(playlist_t *playlist, const char* path, BOOL recursive); +bool adddirtoplaylist(playlist_t *playlist, const char* path, bool recursive);
Ingo, can you confirm this is OK or not?
Sorry, Diego, I overlooked this.
I just confirmed this works fine on Cygwin, so I guess we can keep it.
Well, bool has different semantic and also performance. Using int would be more similar in behaviour to BOOL and consistent with basically all other parts of MPlayer.
Done.
Thanks, I didn't mind much really though I guess a lot of people might still be unfamiliar with the special behaviour of the bool type, so it might be better to just avoid it...
Actually, I'd prefer a boolean type over int in case of a yes/no usage and was thinking of introducing stdbool.h's true/false instead of the X11 True/False values in interface.c (which should be independent from any specific UI). Performance shouldn't be an issue with the GUI, but I don't know what you mean by "different semantic" or "special behaviour". Ingo
On Mon, Aug 01, 2011 at 03:26:03PM +0200, Ingo Brückl wrote:
Performance shouldn't be an issue with the GUI, but I don't know what you mean by "different semantic" or "special behaviour".
E.g. BOOL a = 2; printf("%i", a); prints: 2 bool a = 2; printf("%i", a); prints: 1
Reimar Döffinger wrote on Tue, 2 Aug 2011 21:30:17 +0200:
On Mon, Aug 01, 2011 at 03:26:03PM +0200, Ingo Brückl wrote:
Performance shouldn't be an issue with the GUI, but I don't know what you mean by "different semantic" or "special behaviour".
E.g. BOOL a = 2; printf("%i", a); prints: 2
bool a = 2; printf("%i", a); prints: 1
Oh, now I understand what you meant, bool isn't just a typedef int. I agree with Diego that Windows BOOL wasn't the right type to use, because there is no Windows context with this variable, but as I mentioned, I'd prefer boolean type variables over int when they have a strict yes/no meaning. Although I don't mind using int that much, I'm curious wether you are ok with stdbool.h in general? Ingo
On 4 Aug 2011, at 12:10, Ingo Brückl <ib@wupperonline.de> wrote:
Reimar Döffinger wrote on Tue, 2 Aug 2011 21:30:17 +0200:
On Mon, Aug 01, 2011 at 03:26:03PM +0200, Ingo Brückl wrote:
Performance shouldn't be an issue with the GUI, but I don't know what you mean by "different semantic" or "special behaviour".
E.g. BOOL a = 2; printf("%i", a); prints: 2
bool a = 2; printf("%i", a); prints: 1
Oh, now I understand what you meant, bool isn't just a typedef int.
I agree with Diego that Windows BOOL wasn't the right type to use, because there is no Windows context with this variable, but as I mentioned, I'd prefer boolean type variables over int when they have a strict yes/no meaning. Although I don't mind using int that much, I'm curious wether you are ok with stdbool.h in general?
Well, it means you'll have to change the whole API if you ever want to pass error values back and as said it has disadvantages of being less consistent with the rest of MPlayer and probably a lot of developers who aren't really familiar with the semantics. But no, I have nothing against it, particularly in the GUI, if you think it preferable overall still. Reimar
participants (5)
-
Carl Eugen Hoyos -
diego -
Diego Biurrun -
Ingo Brückl -
Reimar Döffinger