FS-4657 --resolve update libsndfile to its latest master

This commit is contained in:
Jeff Lenk
2014-02-21 16:09:43 -06:00
parent 0c1f6ef2ed
commit 199a64bf6a
291 changed files with 25966 additions and 5745 deletions

View File

@@ -1,5 +1,5 @@
/*
** Copyright (C) 1999-2009 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 1999-2012 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -20,6 +20,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <inttypes.h>
#if HAVE_UNISTD_H
#include <unistd.h>
@@ -30,8 +33,6 @@
#endif
#include <fcntl.h>
#include <math.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
@@ -131,15 +132,13 @@ multi_file_test (const char *filename, int *formats, int format_count)
SF_INFO sfinfo ;
SF_EMBED_FILE_INFO embed_info ;
sf_count_t filelen ;
int fd, k, file_count = 0, open_perm ;
int fd, k, file_count = 0 ;
print_test_name ("multi_file_test", filename) ;
unlink (filename) ;
open_perm = OS_IS_WIN32 ? 0 : S_IRUSR | S_IWUSR | S_IRGRP ;
if ((fd = open (filename, O_RDWR | O_CREAT, open_perm)) < 0)
if ((fd = open (filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) < 0)
{ printf ("\n\nLine %d: open failed : %s\n", __LINE__, strerror (errno)) ;
exit (1) ;
} ;
@@ -155,13 +154,11 @@ multi_file_test (const char *filename, int *formats, int format_count)
embed_info.length = 0 ;
for (file_count = 0 ; embed_info.offset + embed_info.length < filelen ; )
for (file_count = 1 ; embed_info.offset + embed_info.length < filelen ; file_count ++)
{
file_count ++ ;
if (verbose)
{ puts ("\n------------------------------------") ;
printf ("This offset : %ld\n", SF_COUNT_TO_LONG (embed_info.offset + embed_info.length)) ;
printf ("This offset : %" PRId64 "\n", embed_info.offset + embed_info.length) ;
} ;
if (lseek (fd, embed_info.offset + embed_info.length, SEEK_SET) < 0)
@@ -172,7 +169,7 @@ multi_file_test (const char *filename, int *formats, int format_count)
memset (&sfinfo, 0, sizeof (sfinfo)) ;
if ((sndfile = sf_open_fd (fd, SFM_READ, &sfinfo, SF_FALSE)) == NULL)
{ printf ("\n\nLine %d: sf_open_fd failed\n", __LINE__) ;
printf ("Embedded file number : %d offset : %ld\n", file_count, SF_COUNT_TO_LONG (embed_info.offset)) ;
printf ("Embedded file number : %d offset : %" PRId64 "\n", file_count, embed_info.offset) ;
puts (sf_strerror (sndfile)) ;
dump_log_buffer (sndfile) ;
exit (1) ;
@@ -183,9 +180,11 @@ multi_file_test (const char *filename, int *formats, int format_count)
sf_close (sndfile) ;
if (verbose)
printf ("\nNext offset : %ld\nNext length : %ld\n", SF_COUNT_TO_LONG (embed_info.offset), SF_COUNT_TO_LONG (embed_info.length)) ;
printf ("\nNext offset : %" PRId64 "\nNext length : %" PRId64 "\n", embed_info.offset, embed_info.length) ;
} ;
file_count -- ;
if (file_count != format_count)
{ printf ("\n\nLine %d: file count (%d) not equal to %d.\n\n", __LINE__, file_count, format_count) ;
printf ("Embedded file number : %d\n", file_count) ;