Re: [Flac-dev] Git branch with compiling fixes for win32

2011-11-10 Thread Ben Allison
>
> Development is probably complete. Maintenance should continue.

Speaking of which, I plan on starting AMD64, ARMv5, and ARMv7 assembly
routines in the next few weeks.  I'll sync up with Erik on getting them
integrated.

-Ben Allison
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Git branch with compiling fixes for win32

2011-11-10 Thread JonY
On 11/10/2011 18:39, Erik de Castro Lopo wrote:
> 
> I'm subscribed to the list (and I set my reply-to to the list).
> Please do not CC me.
> 
> JonY wrote:
> 
>> Its probably on one of the sf tracker somewhere, I can't seem to find it
>> anymore. It wasn't anything complicated, so I should be able to redo it
>> quickly.
> 
> I'm a Linux guy. I do not have easy access to a windows machine
> and don't have the time or patience to maintain one.
> 
> For windows stuff I'll be relying on others to provide and test
> patches.
> 
> Erik

Alright, here's a quick fix, although it is more ugly than I remembered.

Basically, it removes those _MSC_VER ifdefs, and relies on inttypes.h
where available, and falls back to I64 on MSVC and then ll for others,
all format warnings suppressed.

Tested on MinGW.

Sven-Hendrik, or any other mingw guys around, do you mind testing the
patch too? Patch based on git master from
https://git.xiph.org/mirrors/flac.git.

diff --git a/src/flac/analyze.c b/src/flac/analyze.c
index 1073758..d4a4441 100644
--- a/src/flac/analyze.c
+++ b/src/flac/analyze.c
@@ -28,6 +28,20 @@
 #include "FLAC/all.h"
 #include "analyze.h"
 
+#ifdef HAVE_INTTYPES_H
+#include 
+#define flactypei64 PRId64
+#define flactypeu64 PRIu64
+#else
+#ifdef _MSC_VER
+#define flactypei64 "I64d"
+#define flactypeu64 "I64u"
+#else
+#define flactypei64 "lld"
+#define flactypeu64 "llu"
+#endif
+#endif
+
 typedef struct {
FLAC__int32 residual;
unsigned count;
@@ -66,11 +80,7 @@ void flac__analyze_frame(const FLAC__Frame *frame, unsigned 
frame_number, FLAC__
unsigned i, channel, partitions;
 
/* do the human-readable part first */
-#ifdef _MSC_VER
-   fprintf(fout, 
"frame=%u\toffset=%I64u\tbits=%u\tblocksize=%u\tsample_rate=%u\tchannels=%u\tchannel_assignment=%s\n",
 frame_number, frame_offset, frame_bytes*8, frame->header.blocksize, 
frame->header.sample_rate, channels, 
FLAC__ChannelAssignmentString[frame->header.channel_assignment]);
-#else
-   fprintf(fout, 
"frame=%u\toffset=%llu\tbits=%u\tblocksize=%u\tsample_rate=%u\tchannels=%u\tchannel_assignment=%s\n",
 frame_number, (unsigned long long)frame_offset, frame_bytes*8, 
frame->header.blocksize, frame->header.sample_rate, channels, 
FLAC__ChannelAssignmentString[frame->header.channel_assignment]);
-#endif
+   fprintf(fout, 
"frame=%u\toffset=%"flactypei64"\tbits=%u\tblocksize=%u\tsample_rate=%u\tchannels=%u\tchannel_assignment=%s\n",
 frame_number, (unsigned long long)frame_offset, frame_bytes*8, 
frame->header.blocksize, frame->header.sample_rate, channels, 
FLAC__ChannelAssignmentString[frame->header.channel_assignment]);
for(channel = 0; channel < channels; channel++) {
const FLAC__Subframe *subframe = frame->subframes+channel;
const FLAC__bool is_rice2 = 
subframe->data.fixed.entropy_coding_method.type == 
FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2;
diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c
index 639a1da..e43e073 100644
--- a/src/metaflac/operations.c
+++ b/src/metaflac/operations.c
@@ -32,6 +32,20 @@
 #include 
 #include "operations_shorthand.h"
 
+#ifdef HAVE_INTTYPES_H
+#include 
+#define flactypei64 PRId64
+#define flactypeu64 PRIu64
+#else
+#ifdef _MSC_VER
+#define flactypei64 "I64d"
+#define flactypeu64 "I64u"
+#else
+#define flactypei64 "lld"
+#define flactypeu64 "llu"
+#endif
+#endif
+
 static void show_version(void);
 static FLAC__bool do_major_operation(const CommandLineOptions *options);
 static FLAC__bool do_major_operation_on_file(const char *filename, const 
CommandLineOptions *options);
@@ -565,11 +579,7 @@ void write_metadata(const char *filename, 
FLAC__StreamMetadata *block, unsigned
PPR; printf("  sample_rate: %u Hz\n", 
block->data.stream_info.sample_rate);
PPR; printf("  channels: %u\n", 
block->data.stream_info.channels);
PPR; printf("  bits-per-sample: %u\n", 
block->data.stream_info.bits_per_sample);
-#ifdef _MSC_VER
-   PPR; printf("  total samples: %I64u\n", 
block->data.stream_info.total_samples);
-#else
-   PPR; printf("  total samples: %llu\n", (unsigned long 
long)block->data.stream_info.total_samples);
-#endif
+   PPR; printf("  total samples: %"flactypeu64"\n", 
(unsigned long long)block->data.stream_info.total_samples);
PPR; printf("  MD5 signature: ");
for(i = 0; i < 16; i++) {
printf("%02x", 
(unsigned)block->data.stream_info.md5sum[i]);
@@ -596,11 +606,7 @@ void write_metadata(const char *filename, 
FLAC__StreamMetadata *block, unsigned
PPR; printf("  seek points: %u\n", 
block->data.seek_table.num_points);
for(i = 0; i < block->data.seek_table.num_points; i++) {

if(block->data.seek_table.points[i].sample_number != 
FLAC__STREAM_METADAT

Re: [Flac-dev] Git branch with compiling fixes for win32

2011-11-10 Thread Erik de Castro Lopo

I'm subscribed to the list (and I set my reply-to to the list).
Please do not CC me.

JonY wrote:

> Its probably on one of the sf tracker somewhere, I can't seem to find it
> anymore. It wasn't anything complicated, so I should be able to redo it
> quickly.

I'm a Linux guy. I do not have easy access to a windows machine
and don't have the time or patience to maintain one.

For windows stuff I'll be relying on others to provide and test
patches.

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] Git branch with compiling fixes for win32

2011-11-10 Thread JonY
On 11/10/2011 18:13, Sean M. Pappalardo - D.J. Pegasus wrote:
> Not sure if the patches you already have address this, but here are some 
> hacks I collected to try to get libFLAC to build on Windows for Mixxx: 
> http://mixxx.org/wiki/doku.php/build_windows_dependencies#libflac
> 
> I have never actually gotten it to build on x64 and right now just use 
> OpenCodecs' distribution (also mentioned at that link) which has Visual 
> Studio files that build fine for me.
> 
> Sincerely,
> Sean M. Pappalardo
> "D.J. Pegasus"
> Mixxx Developer - Controller Specialist

I have not built flac for win64, at least I don't remember I did. I'll
investigate after I put up the printf patches.



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] Git branch with compiling fixes for win32

2011-11-10 Thread Sean M. Pappalardo - D.J. Pegasus
Not sure if the patches you already have address this, but here are some 
hacks I collected to try to get libFLAC to build on Windows for Mixxx: 
http://mixxx.org/wiki/doku.php/build_windows_dependencies#libflac

I have never actually gotten it to build on x64 and right now just use 
OpenCodecs' distribution (also mentioned at that link) which has Visual 
Studio files that build fine for me.

Sincerely,
Sean M. Pappalardo
"D.J. Pegasus"
Mixxx Developer - Controller Specialist
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Git branch with compiling fixes for win32

2011-11-10 Thread JonY
On 11/10/2011 08:02, Erik de Castro Lopo wrote:
> JonY wrote:
> 
>> I submitted a patch sometime ago to correct printf specifiers for win32
>> by using inttypes.h, but there were no response, so I thought flac
>> development was dead.
> 
> Development is probably complete. Maintenance should continue.
> 
>> Not sure where the patch went or if its still valid.
> 
> If you sent it to this list, the mailing list archive should be here:
> 
> http://lists.xiph.org/mailman/listinfo/flac-dev
> 

Its probably on one of the sf tracker somewhere, I can't seem to find it
anymore. It wasn't anything complicated, so I should be able to redo it
quickly.





signature.asc
Description: OpenPGP digital signature
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev