Skip to content

Commit

Permalink
Fix warnings about signed/unsigned casts in pi.c
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Apr 16, 2020
1 parent 221a801 commit 73007ae
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 162 deletions.
2 changes: 1 addition & 1 deletion src/lib/openjp2/openjpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ typedef struct opj_poc {
/** Tile number (starting at 1) */
OPJ_UINT32 tile;
/** Start and end values for Tile width and height*/
OPJ_INT32 tx0, tx1, ty0, ty1;
OPJ_UINT32 tx0, tx1, ty0, ty1;
/** Start value, initialised in pi_initialise_encode*/
OPJ_UINT32 layS, resS, compS, prcS;
/** End value, initialised in pi_initialise_encode */
Expand Down
10 changes: 10 additions & 0 deletions src/lib/openjp2/opj_intmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ static INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b)
{
return a >> b;
}

/**
Divide an integer by a power of 2 and round downwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_UINT32 opj_uint_floordivpow2(OPJ_UINT32 a, OPJ_UINT32 b)
{
return a >> b;
}

/**
Get logarithm of an integer and round downwards
@return Returns log2(a)
Expand Down
Loading

0 comments on commit 73007ae

Please sign in to comment.