Commit 3d5901a0 authored by Ron's avatar Ron

Fix some compiler warnings

That become errors for distcheck ...

unistd.h is no longer included by (as many) other system headers,
and that's needed for read(2).

A void* doesn't fit into int on all architectures.
parent 3b3700bf
......@@ -32,6 +32,7 @@
#include "config.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "oggz/oggz.h"
......
......@@ -38,6 +38,7 @@
#include "config.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -463,7 +463,8 @@ write_accum (OCState * state)
OCPageAccum * pa;
OggzTable * candidates;
long serialno, min_serialno;
int i, ntracks, ncandidates=0, remaining=0, min_i, cn, min_cn;
int i, ntracks, ncandidates=0, remaining=0, min_i;
ptrdiff_t cn, min_cn;
ogg_page * og, * min_og;
double min_time;
......@@ -503,7 +504,7 @@ write_accum (OCState * state)
min_og = NULL;
min_serialno = -1;
for (i=0; i < ncandidates; i++) {
cn = ((int) oggz_table_nth (candidates, i, &serialno)) - CN_OFFSET;
cn = ((ptrdiff_t) oggz_table_nth (candidates, i, &serialno)) - CN_OFFSET;
ts = oggz_table_lookup (state->tracks, serialno);
if (ts && ts->page_accum) {
if (cn < oggz_table_size (ts->page_accum)) {
......
......@@ -255,7 +255,8 @@ read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
OVData * ovdata = (OVData *)user_data;
ogg_int64_t gpos = ogg_page_granulepos((ogg_page *)og);
OggzStreamContent content_type;
int packets, packetno, headers, ret = 0;
int packets, ret = 0;
ptrdiff_t packetno, headers;
if (ovdata->chain_ended) {
ovdata_clear (ovdata);
......@@ -301,7 +302,7 @@ read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
fprintf (stderr, "serialno %010lu: missing *** bos\n", serialno);
}
packetno = (int)oggz_table_lookup (ovdata->packetno, serialno);
packetno = (ptrdiff_t)oggz_table_lookup (ovdata->packetno, serialno);
headers = oggz_stream_get_numheaders (oggz, serialno);
if (packetno < headers-1) {
/* The previous page was headers, and more are expected */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment