Re: [flac-dev] Wave64 format fix
Janne Hyvärinen wrote: Here's a patch that fixes WAVE64 format handling. GUID had one word incorrectly in little endian order. Applied, thanks. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] snprintf and MS Visual Studio
Erik de Castro Lopo wrote: Hi all, There are a bunch of sprintf calls in the FLAC code base and I'd like to replace them with calls to snprintf but I know that can cause problems with at least some versions of Visual Studio. Whats the current state of play in this regard? Does MSVS have stdarg.h? Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] snprintf and MS Visual Studio
Erik de Castro Lopo wrote: Does MSVS have stdarg.h? Hmm, seems to: http://msdn.microsoft.com/en-us/library/kb57fad8%28v=vs.80%29.aspx Hope it works as expected. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] Patch to add Unicode filename support for win32 flac
JonY wrote: On 3/17/2013 10:33, Janne Hyvärinen wrote: Here's a patch that makes MSVC compiled flac.exe able to use wildcards and encode/decode files with Unicode characters in names. It may not be the prettiest code but it fulfills its primary purpose. I tried to alter FLAC code as little as possible. It replaces argv with utf-8 encoded version and only converts to usable Unicode for file functions. That means printed texts and tags that contain non-ascii characters will be broken, but it is fixable if these changes are acceptable. Can this be reworked without the defines? This way, it should support mingw builds too. +1 I'd like to see some way to do this to: a) Make this usable from MinGW compiled binaries. b) Reduce the the amount of inline #ifdef hackery. Cheers, Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] Patch to add Unicode filename support for win32 flac
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17.03.2013 06:33, Janne Hyvärinen wrote: Here's a patch that makes MSVC compiled flac.exe able to use wildcards and encode/decode files with Unicode characters in names. It may not be the prettiest code but it fulfills its primary purpose. I tried to alter FLAC code as little as possible. It replaces argv with utf-8 encoded version and only converts to usable Unicode for file functions. That means printed texts and tags that contain non-ascii characters will be broken, but it is fixable if these changes are acceptable. /me looks at chmod and utime wrappers: Ah, i knew i've missed something! :) Also, i didn't consider wildcards (i thought shell was supposed to handle them...). -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRRaGLAAoJEOs4Jb6SI2CwapIIANAihJPXnq5rJDXIs1JdJvUx rDk3c1obe8PTE2ur+jU86TDgflIotY1mYCUptglNr28IPiWs1Nj7qKM0sIXfa6e7 kaAocJStwXNjA/VCLUXd4Ka+OY0MOdKnldAcepLnTPBZSgKXVHOoe/A98tHc6BsS 1+fBKoU6YFb7jubaW6P2IVquu/rhbCyAI/3+3yaBdMYkgvs5zq/HT/iUYWjVD5V5 jTW/lDFNzqRydIPH3EdB64W9kXAXhLi75P3DVD+4OtDW9eTiLIIYWNxh0Bbk6AWg f/AP9kDp/2qSg5QSab0j5fEQDYG6RnYl4MNXLhwhLRyHK19WlBLucw7l/4ibdWs= =2RLE -END PGP SIGNATURE- ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] snprintf and MS Visual Studio
Janne Hyvärinen wrote: Patch for snprintf stuff. Applied and pushed. Thats it for me tonight. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] Patch to add Unicode filename support for win32 flac
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17.03.2013 18:55, JonY wrote: On 3/17/2013 18:37, Erik de Castro Lopo wrote: JonY wrote: On 3/17/2013 10:33, Janne Hyvärinen wrote: Here's a patch that makes MSVC compiled flac.exe able to use wildcards and encode/decode files with Unicode characters in names. It may not be the prettiest code but it fulfills its primary purpose. I tried to alter FLAC code as little as possible. It replaces argv with utf-8 encoded version and only converts to usable Unicode for file functions. That means printed texts and tags that contain non-ascii characters will be broken, but it is fixable if these changes are acceptable. Can this be reworked without the defines? This way, it should support mingw builds too. +1 I'd like to see some way to do this to: a) Make this usable from MinGW compiled binaries. b) Reduce the the amount of inline #ifdef hackery. A simple way to do this is to make all C IO calls that need OS specific hacks go into the compatibility module. Eg for open() calls: int _flac_open(){ #if win32 ... #else if os2 ... #else ... [generic call to open() without hacks] #endif } All those ifdefs will at least be confined rather than spread out through the code. I did it plibc-style: in compat.h: #if defined(_WIN32) #define FOPEN grabbag__fopen_utf8_wrapper #else #define FOPEN fopen #endif in grabbag: #if defined(_WIN32) implement grabbag__fopen_utf8_wrapper, which has the same signature as fopen, but does utf8-utf16 conversion internally, then calls wfopen #endif and replace fopen with FOPEN everywhere else. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRRdrIAAoJEOs4Jb6SI2CwL4YH/Ayixx9r3XitYI0j1FH+xQd3 lrhJ3I3Di1uE0/LES9/mL65T6yBvwov1LDoL4JMHMK4/mH78s0wDZXYr6h/FoEhW 8XpxRL6ujDfCEb2cp76KAcZLL3rcO4uEsgVJsXBtkC5K+zpjzgMVnasg+oH/Z6sS PdqPg/w+40FOgkYszMUwwJJJF/y2uTZXSOZoDyM8glx2oMhrAHmi0Yx7ksehndSo wN6JaJFe3IdprOZdyLXpxsPxiNt1MiR0b7BKg4bAFt8evStcD9d/CHSJ3te5134v d4YswJj/GQ1y9fJLpW+wPSEYmcJbi+Brkfo8OYs5pcs2Tsv0ZfQ80ItoJZ91CyQ= =ZnwK -END PGP SIGNATURE- ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] MSVC project updates
Janne Hyvärinen wrote: One more set of MSVC project updates. Changed ogg_static.lib to libogg_static.lib as that's the name latest version uses. Removed MSVC 6.0 related parts from README and tweaked info there to be more up-to-date. Also changed nasmw.exe into nasm.exe as nasmw.exe has been long gone. LibFLAC_dynamic was complaining in debug mode about conflicts with libcmt, I excluded it from the project there as I saw no other way to solve the problem. Applied. Thanks. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] Patch to add Unicode filename support for win32 flac
On 3/17/2013 23:01, LRN wrote: All those ifdefs will at least be confined rather than spread out through the code. I did it plibc-style: in compat.h: #if defined(_WIN32) #define FOPEN grabbag__fopen_utf8_wrapper #else #define FOPEN fopen #endif in grabbag: #if defined(_WIN32) implement grabbag__fopen_utf8_wrapper, which has the same signature as fopen, but does utf8-utf16 conversion internally, then calls wfopen #endif and replace fopen with FOPEN everywhere else. Don't do that, it leaks into the system headers and breaks mingw if FLAC_USE_FOPEN_UTF8 is defined. Call the wrappers directly instead of using a macro. signature.asc Description: OpenPGP digital signature ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] Patch to add Unicode filename support for win32 flac
JonY wrote: On 3/17/2013 23:01, LRN wrote: All those ifdefs will at least be confined rather than spread out through the code. I did it plibc-style: in compat.h: #if defined(_WIN32) #define FOPEN grabbag__fopen_utf8_wrapper #else #define FOPEN fopen #endif in grabbag: #if defined(_WIN32) implement grabbag__fopen_utf8_wrapper, which has the same signature as fopen, but does utf8-utf16 conversion internally, then calls wfopen #endif and replace fopen with FOPEN everywhere else. Don't do that, it leaks into the system headers and breaks mingw if FLAC_USE_FOPEN_UTF8 is defined. Call the wrappers directly instead of using a macro. +1 Yep, I prefer not to have too much #ifdef hackery. In my recent replacement of all the sprintf/_snprintf stuff, I relaced all the calls with a call to flac_snprintf() and localised #ifdef hackery to the implementation of that function. From a patch cleanliness POV, I like to see the new functionality added in one patch and a separate patch to change all the old function usage to the new function usage. For example, in commit 06af237c I added the new flac_snprintf() function and in commit 3c84f9e8 I replaced all the old calls to sprintf/_snprintf. Cheers, Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] Patch to add Unicode filename support for win32 flac
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18.03.2013 02:10, JonY wrote: On 3/17/2013 23:01, LRN wrote: All those ifdefs will at least be confined rather than spread out through the code. I did it plibc-style: in compat.h: #if defined(_WIN32) #define FOPEN grabbag__fopen_utf8_wrapper #else #define FOPEN fopen #endif in grabbag: #if defined(_WIN32) implement grabbag__fopen_utf8_wrapper, which has the same signature as fopen, but does utf8-utf16 conversion internally, then calls wfopen #endif and replace fopen with FOPEN everywhere else. Don't do that, it leaks into the system headers How? compat.h is not a public header, it is only used internally in FLAC. And i don't think that system headers have defines for FOPEN and such. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRRnP7AAoJEOs4Jb6SI2CwxWoH/13eGOZb62iAm4SzkDFQ6/Bh 2Goz3lz+9fK4Gq+tXyfPmXC1JabLdM1vnw43QgkAVWr3OrJ2+AN+LHocP9+YCYG4 ckd5Eisi32taDr3+CnaJzOrYQnaeD926iPC2vQoVOMIniGWTRVzIIYxood0gGXd3 oa5hPMvq1t/TXyKudSt8Jimeoe6vyoaLcBJCMykn9B5qh//ryiajGJlwQgicessb Rzw0/VgbLcck3XLyzm7gfsXxiYhRjeSalZyPxYw6DE8rsARxswk1TfWLB7faPAiI spaA2mEX7iQz9GPmKlhil/Q/rzsn3vt8lgHbC+WDD0843kkaC3MWPvPdqqsbFh4= =3u0R -END PGP SIGNATURE- ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] Patch to add Unicode filename support for win32 flac
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18.03.2013 02:37, Erik de Castro Lopo wrote: JonY wrote: On 3/17/2013 23:01, LRN wrote: All those ifdefs will at least be confined rather than spread out through the code. I did it plibc-style: in compat.h: #if defined(_WIN32) #define FOPEN grabbag__fopen_utf8_wrapper #else #define FOPEN fopen #endif in grabbag: #if defined(_WIN32) implement grabbag__fopen_utf8_wrapper, which has the same signature as fopen, but does utf8-utf16 conversion internally, then calls wfopen #endif and replace fopen with FOPEN everywhere else. Don't do that, it leaks into the system headers and breaks mingw if FLAC_USE_FOPEN_UTF8 is defined. Call the wrappers directly instead of using a macro. +1 Yep, I prefer not to have too much #ifdef hackery. In my recent replacement of all the sprintf/_snprintf stuff, I relaced all the calls with a call to flac_snprintf() and localised #ifdef hackery to the implementation of that function. From a patch cleanliness POV, I like to see the new functionality added in one patch and a separate patch to change all the old function usage to the new function usage. For example, in commit 06af237c I added the new flac_snprintf() function and in commit 3c84f9e8 I replaced all the old calls to sprintf/_snprintf. /me shrugs Sure, that'll work too. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRRnSAAAoJEOs4Jb6SI2CwPmoIAIM2pFUjl+TNDnPkDCBkLWPy zf58O5s8R+2S1uNfpd8fQrheZKdK8kSitJj9XYGELo+POyn8pJGEBjYvZyqVls88 gAHaE5wWgV5aSYmHcwQD8aXCB2LP9Lkpk01rvt6lZ9grw15nWUyhmiPd3uyQYwOD ZGrqAS661d4XoSP5N0hi86mUf9NcM6xXacDY+leRnSNowIrtbnCR0vhQJoHMpY7U fWB6dM4YEgZmCbj6he9ZHbXemlMiK+rRkoEsPPcAobGCIga6I0il6j/3JxI8bKCl VF+4Iz0APw22/+ck6K+tfde/9JGraZT2HsYm2PNAcPiuZPmvP0oTvQrGLkRJzr0= =GIQw -END PGP SIGNATURE- ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev
Re: [flac-dev] Patch to add Unicode filename support for win32 flac
On Mar 17, 2013, at 03:57, LRN wrote: /me looks at chmod and utime wrappers: Ah, i knew i've missed something! :) Also, i didn't consider wildcards (i thought shell was supposed to handle them...). I believe that shell does handle wildcards on all Unix variants, including OSX. Since Windows does not handle them, I suggest that the main flac code not be littered with code that's not necessary on the primary platforms. Aren't Windows users accustomed to this feature being missing anyway? Brian ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev