Skip to content

Commit

Permalink
Fix sign/unsigned comparison warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Buitenhuis <[email protected]>
  • Loading branch information
dwbuiten committed Nov 9, 2012
1 parent 84344f0 commit 200decb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/d2v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ string d2vgetpath(char *d2v_path, string file)
void d2vfreep(d2vcontext **ctx)
{
d2vcontext *lctx = *ctx;
int i;
unsigned int i;

if (!lctx)
return;
Expand Down
11 changes: 6 additions & 5 deletions core/decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int64_t file_seek(void *opaque, int64_t offset, int whence)
* which does its job fine as-is.
*/
int64_t real_offset = offset + ctx->orig_file_offset;
int i;
unsigned int i;

for(i = ctx->orig_file; i < ctx->cur_file; i++)
real_offset -= ctx->file_sizes[i];
Expand All @@ -78,7 +78,7 @@ static int64_t file_seek(void *opaque, int64_t offset, int whence)
* adjusted for GOP offset.
*/
int64_t size = -(ctx->orig_file_offset);
int i;
unsigned int i;

for(i = ctx->orig_file; i < ctx->file_sizes.size(); i++)
size += ctx->file_sizes[i];
Expand Down Expand Up @@ -122,7 +122,7 @@ static int read_packet(void *opaque, uint8_t *buf, int size)
void decodefreep(decodecontext **ctx)
{
decodecontext *lctx = *ctx;
int i;
unsigned int i;

if (!lctx)
return;
Expand Down Expand Up @@ -245,7 +245,8 @@ int decodeframe(int frame_num, d2vcontext *ctx, decodecontext *dctx, AVFrame *ou
{
frame f;
gop g;
int i, j, av_ret, offset;
unsigned int i;
int j, av_ret, offset;
bool next;

/* Get our frame and the GOP its in. */
Expand Down Expand Up @@ -385,7 +386,7 @@ int decodeframe(int frame_num, d2vcontext *ctx, decodecontext *dctx, AVFrame *ou
/* If we're decoding linearly, there is obviously no offset. */
o = next ? 0 : offset;
for(j = 0; j <= o; j++) {
while(dctx->inpkt.stream_index != i) {
while(dctx->inpkt.stream_index != (int) i) {
av_free_packet(&dctx->inpkt);
av_read_frame(dctx->fctx, &dctx->inpkt);
}
Expand Down
4 changes: 2 additions & 2 deletions core/decode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ typedef struct decodecontext {

uint8_t *in;

int orig_file;
int cur_file;
unsigned int orig_file;
unsigned int cur_file;
uint64_t orig_file_offset;
} decodecontext;

Expand Down

0 comments on commit 200decb

Please sign in to comment.