mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
Fix more signed/unsigned issues.
This commit is contained in:
parent
50823c0383
commit
5c9136b5b9
@ -1,6 +1,7 @@
|
||||
2006-05-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/caf.c src/double64.c examples/sndfile-info.c
|
||||
* src/caf.c src/double64.c examples/sndfile-info.c tests/virtual_io_test.c
|
||||
tests/utils.tpl
|
||||
Fix a couple of signed/unsigned problems.
|
||||
|
||||
2006-05-01 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#define SF_COUNT_TO_LONG(x) ((long) (x))
|
||||
#define ARRAY_LEN(x) ((int) (sizeof (x)) / (sizeof ((x) [0])))
|
||||
#define SIGNED_SIZEOF(x) ((int64_t) (sizeof (x)))
|
||||
|
||||
#define PIPE_INDEX(x) ((x) + 500)
|
||||
#define PIPE_TEST_LEN 12345
|
||||
@ -138,7 +139,6 @@ void test_seek_or_die
|
||||
#define M_PI 3.14159265358979323846264338
|
||||
#endif
|
||||
|
||||
#define SIGNED_SIZEOF(x) ((int) (sizeof (x)))
|
||||
#define LOG_BUFFER_SIZE 2048
|
||||
|
||||
[+ FOR float_type +]
|
||||
|
@ -106,10 +106,10 @@ vfwrite (const void *ptr, sf_count_t count, void *user_data)
|
||||
** This will break badly for files over 2Gig in length, but
|
||||
** is sufficient for testing.
|
||||
*/
|
||||
if (vf->offset >= sizeof (vf->data))
|
||||
if (vf->offset >= SIGNED_SIZEOF (vf->data))
|
||||
return 0 ;
|
||||
|
||||
if (vf->offset + count > sizeof (vf->data))
|
||||
if (vf->offset + count > SIGNED_SIZEOF (vf->data))
|
||||
count = sizeof (vf->data) - vf->offset ;
|
||||
|
||||
memcpy (vf->data + vf->offset, ptr, (size_t) count) ;
|
||||
|
Loading…
Reference in New Issue
Block a user