ref: e339b93be406b90748b429b41f1696ae15095d33
parent: 8d5c2fb9aa870325f6dd0816a2b93cf223af74f6
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Thu May 11 13:39:28 EDT 2017
A few more type changes
--- a/src/ogg_packer.c
+++ b/src/ogg_packer.c
@@ -233,13 +233,13 @@
size "bytes", but fewer bytes can be written. The buffer remains valid through
a call to oggp_close_page() or oggp_get_next_page(), but is invalidated by
another call to oggp_get_packet_buffer() or by a call to oggp_commit_packet(). */
-unsigned char *oggp_get_packet_buffer(oggpacker *oggp, int bytes) {
+unsigned char *oggp_get_packet_buffer(oggpacker *oggp, oggp_int32 bytes) {
if (oggp->buf_fill + bytes > oggp->buf_size) {
shift_buffer(oggp);
/* If we didn't shift the buffer or if we did and there's still not enough room, make some more. */
if (oggp->buf_fill + bytes > oggp->buf_size) {
- int newsize;
+ size_t newsize;
unsigned char *newbuf;
newsize = oggp->buf_fill + bytes + MAX_HEADER_SIZE;
/* Making sure we don't need to do that too often. */
@@ -261,7 +261,7 @@
/** Tells the oggpacker that the packet buffer obtained from
oggp_get_packet_buffer() has been filled and the number of bytes written
has to be no more than what was originally asked for. */
-int oggp_commit_packet(oggpacker *oggp, int bytes, oggp_uint64 granulepos, int eos) {
+int oggp_commit_packet(oggpacker *oggp, oggp_int32 bytes, oggp_uint64 granulepos, int eos) {
size_t i;
size_t nb_255s;
assert(oggp->user_buf != NULL);
--- a/src/ogg_packer.h
+++ b/src/ogg_packer.h
@@ -52,12 +52,12 @@
size "bytes", but fewer bytes can be written. The buffer remains valid through
a call to oggp_close_page() or oggp_get_next_page(), but is invalidated by
another call to oggp_get_packet_buffer() or by a call to oggp_commit_packet(). */
-unsigned char *oggp_get_packet_buffer(oggpacker *oggp, int bytes);
+unsigned char *oggp_get_packet_buffer(oggpacker *oggp, oggp_int32 bytes);
/** Tells the oggpacker that the packet buffer obtained from
oggp_get_packet_buffer() has been filled and the number of bytes written
has to be no more than what was originally asked for. */
-int oggp_commit_packet(oggpacker *oggp, int bytes, oggp_uint64 granulepos, int eos);
+int oggp_commit_packet(oggpacker *oggp, oggp_int32 bytes, oggp_uint64 granulepos, int eos);
/** Create a page from the data written so far (and not yet part of a previous page).
If there is too much data for one page, then all page continuations will be closed too. */