mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
Rename psf_rand_long -> psf_rand_int32.
This commit is contained in:
parent
e35511f9af
commit
ea1f70fa87
@ -5,7 +5,7 @@
|
||||
FLAC__metadata_object_vorbiscomment_append_comment.
|
||||
|
||||
* src/common.[ch]
|
||||
Add function psf_rand_long().
|
||||
Add function psf_rand_int32().
|
||||
|
||||
2007-07-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
|
20
src/common.c
20
src/common.c
@ -1283,21 +1283,21 @@ u_bitwidth_to_subformat (int bits)
|
||||
} /* bitwidth_to_subformat */
|
||||
|
||||
/*
|
||||
** psf_rand_long : Not crypto quality, but more than adequate for things
|
||||
** psf_rand_int32 : Not crypto quality, but more than adequate for things
|
||||
** like stream serial numbers in Ogg files.
|
||||
*/
|
||||
|
||||
long
|
||||
psf_rand_long (void)
|
||||
{ static long serial = -1 ;
|
||||
int32_t
|
||||
psf_rand_int32 (void)
|
||||
{ static int32_t value = -1 ;
|
||||
int k, count ;
|
||||
|
||||
if (serial == -1)
|
||||
serial = time (NULL) ;
|
||||
if (value == -1)
|
||||
value = time (NULL) ;
|
||||
|
||||
count = 4 + (serial & 7) ;
|
||||
count = 4 + (value & 7) ;
|
||||
for (k = 0 ; k < count ; k++)
|
||||
serial = 11117 * serial + 211231 ;
|
||||
value = 11117 * value + 211231 ;
|
||||
|
||||
return serial ;
|
||||
} /* psf_rand_long */
|
||||
return value ;
|
||||
} /* psf_rand_int32 */
|
||||
|
@ -589,7 +589,7 @@ void psf_log_SF_INFO (SF_PRIVATE *psf) ;
|
||||
|
||||
void psf_hexdump (const void *ptr, int len) ;
|
||||
|
||||
long psf_rand_long (void) ;
|
||||
int32_t psf_rand_int32 (void) ;
|
||||
|
||||
/* Functions used when writing file headers. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user