Use config.h rather than passing all defs in CFLAGS
[platform/upstream/flac.git] / src / libFLAC / format.c
index 2998970..ae719ba 100644 (file)
 #include "FLAC/format.h"
 #include "private/format.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #ifdef min
 #undef min
 #endif
 #define min(a,b) ((a)<(b)?(a):(b))
 
+/* VERSION should come from configure */
+const char *FLAC__VERSION_STRING = VERSION;
+
+#if defined _MSC_VER || defined __MINW32__
+/* yet one more hack because of MSVC6: */
+const char *FLAC__VENDOR_STRING = "reference libFLAC 1.0.4 20020924";
+#else
+const char *FLAC__VENDOR_STRING = "reference libFLAC " VERSION " 20020924";
+#endif
+
 const FLAC__byte FLAC__STREAM_SYNC_STRING[4] = { 'f','L','a','C' };
 const unsigned FLAC__STREAM_SYNC = 0x664C6143;
 const unsigned FLAC__STREAM_SYNC_LEN = 32; /* bits */;
@@ -125,7 +139,7 @@ FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate)
                sample_rate == 0 ||
                sample_rate > FLAC__MAX_SAMPLE_RATE ||
                (
-                       sample_rate >= (1u << 16) && 
+                       sample_rate >= (1u << 16) &&
                        !(sample_rate % 1000 == 0 || sample_rate % 10 == 0)
                )
        ) {
@@ -234,17 +248,16 @@ unsigned FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_an
        return max_rice_partition_order;
 }
 
-void FLAC__format_entropy_coding_method_partitioned_rice_init(FLAC__EntropyCodingMethod_PartitionedRice *object)
+void FLAC__format_entropy_coding_method_partitioned_rice_contents_init(FLAC__EntropyCodingMethod_PartitionedRiceContents *object)
 {
        FLAC__ASSERT(0 != object);
 
-       object->order = 0;
        object->parameters = 0;
        object->raw_bits = 0;
        object->capacity_by_order = 0;
 }
 
-void FLAC__format_entropy_coding_method_partitioned_rice_clear(FLAC__EntropyCodingMethod_PartitionedRice *object)
+void FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(FLAC__EntropyCodingMethod_PartitionedRiceContents *object)
 {
        FLAC__ASSERT(0 != object);
 
@@ -252,10 +265,10 @@ void FLAC__format_entropy_coding_method_partitioned_rice_clear(FLAC__EntropyCodi
                free(object->parameters);
        if(0 != object->raw_bits)
                free(object->raw_bits);
-       FLAC__format_entropy_coding_method_partitioned_rice_init(object);
+       FLAC__format_entropy_coding_method_partitioned_rice_contents_init(object);
 }
 
-FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_ensure_size(FLAC__EntropyCodingMethod_PartitionedRice *object, unsigned max_partition_order)
+FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(FLAC__EntropyCodingMethod_PartitionedRiceContents *object, unsigned max_partition_order)
 {
        FLAC__ASSERT(0 != object);