mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-27 03:50:29 +00:00
Change ptr arg to psf_write() to const void*.
This commit is contained in:
parent
90d0ee803b
commit
b935e188f3
@ -1,3 +1,9 @@
|
|||||||
|
2004-11-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||||
|
|
||||||
|
* src/file_io.c src/common.h
|
||||||
|
Change the ptr argument to psf_write() from "void*" to a "const void*".
|
||||||
|
Thanks to Tobias Gehrig for suggesting this.
|
||||||
|
|
||||||
2004-10-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
2004-10-31 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||||
|
|
||||||
* src/file_io.c src/common.h
|
* src/file_io.c src/common.h
|
||||||
|
@ -554,7 +554,7 @@ void psf_set_file (SF_PRIVATE *psf, int fd) ;
|
|||||||
|
|
||||||
sf_count_t psf_fseek (SF_PRIVATE *psf, sf_count_t offset, int whence) ;
|
sf_count_t psf_fseek (SF_PRIVATE *psf, sf_count_t offset, int whence) ;
|
||||||
sf_count_t psf_fread (void *ptr, sf_count_t bytes, sf_count_t count, SF_PRIVATE *psf) ;
|
sf_count_t psf_fread (void *ptr, sf_count_t bytes, sf_count_t count, SF_PRIVATE *psf) ;
|
||||||
sf_count_t psf_fwrite (void *ptr, sf_count_t bytes, sf_count_t count, SF_PRIVATE *psf) ;
|
sf_count_t psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t count, SF_PRIVATE *psf) ;
|
||||||
sf_count_t psf_fgets (char *buffer, sf_count_t bufsize, SF_PRIVATE *psf) ;
|
sf_count_t psf_fgets (char *buffer, sf_count_t bufsize, SF_PRIVATE *psf) ;
|
||||||
sf_count_t psf_ftell (SF_PRIVATE *psf) ;
|
sf_count_t psf_ftell (SF_PRIVATE *psf) ;
|
||||||
sf_count_t psf_get_filelen (SF_PRIVATE *psf) ;
|
sf_count_t psf_get_filelen (SF_PRIVATE *psf) ;
|
||||||
|
@ -324,7 +324,7 @@ psf_fread (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
|||||||
} /* psf_fread */
|
} /* psf_fread */
|
||||||
|
|
||||||
sf_count_t
|
sf_count_t
|
||||||
psf_fwrite (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
||||||
{ sf_count_t total = 0 ;
|
{ sf_count_t total = 0 ;
|
||||||
ssize_t count ;
|
ssize_t count ;
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ psf_fwrite (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
|||||||
{ /* Break the writes down to a sensible size. */
|
{ /* Break the writes down to a sensible size. */
|
||||||
count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : items ;
|
count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : items ;
|
||||||
|
|
||||||
count = write (psf->filedes, ((char*) ptr) + total, count) ;
|
count = write (psf->filedes, ((const char*) ptr) + total, count) ;
|
||||||
|
|
||||||
if (count == -1)
|
if (count == -1)
|
||||||
{ if (errno == EINTR)
|
{ if (errno == EINTR)
|
||||||
@ -746,7 +746,7 @@ psf_fread (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
|||||||
} /* psf_fread */
|
} /* psf_fread */
|
||||||
|
|
||||||
/* Win32 */ sf_count_t
|
/* Win32 */ sf_count_t
|
||||||
psf_fwrite (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
||||||
{ sf_count_t total = 0 ;
|
{ sf_count_t total = 0 ;
|
||||||
ssize_t count ;
|
ssize_t count ;
|
||||||
DWORD dwNumberOfBytesWritten ;
|
DWORD dwNumberOfBytesWritten ;
|
||||||
@ -761,7 +761,7 @@ psf_fwrite (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
|||||||
{ /* Break the writes down to a sensible size. */
|
{ /* Break the writes down to a sensible size. */
|
||||||
count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : (ssize_t) items ;
|
count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : (ssize_t) items ;
|
||||||
|
|
||||||
if (WriteFile ((HANDLE) psf->filedes, ((char*) ptr) + total, count, &dwNumberOfBytesWritten, 0) == 0)
|
if (WriteFile ((HANDLE) psf->filedes, ((const char*) ptr) + total, count, &dwNumberOfBytesWritten, 0) == 0)
|
||||||
{ psf_log_syserr (psf, GetLastError ()) ;
|
{ psf_log_syserr (psf, GetLastError ()) ;
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
@ -1059,7 +1059,7 @@ psf_fread (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
|||||||
} /* psf_fread */
|
} /* psf_fread */
|
||||||
|
|
||||||
/* Win32 */ sf_count_t
|
/* Win32 */ sf_count_t
|
||||||
psf_fwrite (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
||||||
{ sf_count_t total = 0 ;
|
{ sf_count_t total = 0 ;
|
||||||
ssize_t count ;
|
ssize_t count ;
|
||||||
|
|
||||||
@ -1073,7 +1073,7 @@ psf_fwrite (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
|
|||||||
{ /* Break the writes down to a sensible size. */
|
{ /* Break the writes down to a sensible size. */
|
||||||
count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : items ;
|
count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : items ;
|
||||||
|
|
||||||
count = write (psf->filedes, ((char*) ptr) + total, count) ;
|
count = write (psf->filedes, ((const char*) ptr) + total, count) ;
|
||||||
|
|
||||||
if (count == -1)
|
if (count == -1)
|
||||||
{ if (errno == EINTR)
|
{ if (errno == EINTR)
|
||||||
|
Loading…
Reference in New Issue
Block a user