ref: 40e6fb44883611af7b01dbe537a392d1861d39b9
parent: d6b34115c32fe86ef7073b603e0d77f1d8c283d4
author: rrt <rrt>
date: Thu Apr 5 11:44:42 EDT 2007
Make offset to sox_seeki sox_ssize_t rather than sox_size_t because it can actually be signed if you know you're seeking a seekable stream (and you can then use SEEK_CUR with a -ve offset).
--- a/src/misc.c
+++ b/src/misc.c
@@ -483,9 +483,9 @@
* file operations so that they could one day also work on memory
* buffers.
*
- * N.B. Can only seek forwards!
+ * N.B. Can only seek forwards on non-seekable streams!
*/
-int sox_seeki(ft_t ft, sox_size_t offset, int whence)
+int sox_seeki(ft_t ft, sox_ssize_t offset, int whence)
{
if (ft->seekable == 0) {
/* If a stream peel off chars else EPERM */
--- a/src/sox_i.h
+++ b/src/sox_i.h
@@ -144,7 +144,7 @@
int sox_writef(ft_t ft, float f);
#define sox_readdf(ft, d) (sox_read_sudf_buf(ft, d, 1) == 1 ? SOX_SUCCESS : SOX_EOF)
int sox_writedf(ft_t ft, double d);
-int sox_seeki(ft_t ft, sox_size_t offset, int whence);
+int sox_seeki(ft_t ft, sox_ssize_t offset, int whence);
sox_size_t sox_filelength(ft_t ft);
int sox_flush(ft_t ft);
sox_size_t sox_tell(ft_t ft);