static void chain_read_ogg_metadata_cb_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
{
FLAC__Metadata_Chain *chain = (FLAC__Metadata_Chain*)client_data;
+ FLAC__Metadata_Node *node;
(void)decoder;
- FLAC__Metadata_Node *node = node_new_();
+ node = node_new_();
if(0 == node) {
chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR;
return;
return true;
}
-/* There's no stroull() in MSVC6 so we just write a specialized one */
+#ifdef _MSC_VER
+/* There's no strtoull() in MSVC6 so we just write a specialized one */
static FLAC__uint64 local__strtoull(const char *src)
{
FLAC__uint64 ret = 0;
}
return ret;
}
+#endif
FLAC__bool parse_uint64(const char *src, FLAC__uint64 *dest)
{
FLAC__ASSERT(0 != src);
if(strlen(src) == 0 || strspn(src, "0123456789") != strlen(src))
return false;
+#ifdef _MSC_VER
*dest = local__strtoull(src);
+#else
+ *dest = strtoull(src, 0, 10);
+#endif
return true;
}
#include <stdlib.h> /* for atoi() */
#include <string.h>
+#ifdef _MSC_VER
+/* There's no strtoll() in MSVC6 so we just write a specialized one */
+static FLAC__int64 local__strtoll(const char *src, char **endptr)
+{
+ FLAC__bool neg = false;
+ FLAC__int64 ret = 0;
+ int c;
+ FLAC__ASSERT(0 != src);
+ if(*src == '-') {
+ neg = true;
+ src++;
+ }
+ while(0 != (c = *src)) {
+ c -= '0';
+ if(c >= 0 && c <= 9)
+ ret = (ret * 10) + c;
+ else
+ break;
+ src++;
+ }
+ if(endptr)
+ *endptr = (char*)src;
+ return neg? -ret : ret;
+}
+#endif
+
FLAC__bool grabbag__seektable_convert_specification_to_template(const char *spec, FLAC__bool only_explicit_placeholders, FLAC__uint64 total_samples_to_encode, unsigned sample_rate, FLAC__StreamMetadata *seektable_template, FLAC__bool *spec_has_real_points)
{
unsigned i;
if(!only_explicit_placeholders) {
char *endptr;
#ifdef _MSC_VER
- const FLAC__int64 n = (FLAC__int64)strtol(pt, &endptr, 10); /* [2G limit] */
+ const FLAC__int64 n = local__strtoll(pt, &endptr);
#else
const FLAC__int64 n = (FLAC__int64)strtoll(pt, &endptr, 10);
#endif
return true;
}
+#ifdef _MSC_VER
+/* There's no strtoull() in MSVC6 so we just write a specialized one */
+static FLAC__uint64 local__strtoull(const char *src)
+{
+ FLAC__uint64 ret = 0;
+ int c;
+ FLAC__ASSERT(0 != src);
+ while(0 != (c = *src++)) {
+ c -= '0';
+ if(c >= 0 && c <= 9)
+ ret = (ret * 10) + c;
+ else
+ break;
+ }
+ return ret;
+}
+#endif
+
int main(int argc, char *argv[])
{
const char *filename;
if (argc > 2)
count = strtoul(argv[2], 0, 10);
if (argc > 3)
+#ifdef _MSC_VER
+ samples = local__strtoull(argv[3]);
+#else
samples = strtoull(argv[3], 0, 10);
+#endif
if (count < 30)
fprintf(stderr, "WARNING: random seeks don't kick in until after 30 preprogrammed ones\n");