Skip to content

Commit

Permalink
Made several code changes in order to prevent some compiler warnings in
Browse files Browse the repository at this point in the history
the case of MSVC on Windows.
  • Loading branch information
mdadams committed Jul 30, 2022
1 parent 7ea3005 commit 5d6db11
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ option(JAS_ENABLE_PIC "Enable position-independent code" ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ${JAS_ENABLE_PIC})

option(JAS_ENABLE_HIDDEN "Hide internal symbols" ON)
option(JAS_ENABLE_32BIT "In the JPC/JP2 codec, use a fixed-point word size of 32 bits (instead of 64 bits)" OFF)
option(JAS_ENABLE_32BIT "Use a word size of 32 bits (instead of 64 bits) for fixed-point representations" OFF)
option(JAS_ENABLE_LIBJPEG "Enable the use of the JPEG Library" ON)
option(JAS_ENABLE_LIBHEIF "Enable the use of the HEIF Library" ON)
option(JAS_ENABLE_OPENGL "Enable the use of the OpenGL/GLUT Library" ON)
option(JAS_ENABLE_DOC "Enable building of the documentation" ON)
option(JAS_ENABLE_LATEX "Allow the use of LaTeX if it is available " ON)
option(JAS_ENABLE_LATEX "Allow the use of LaTeX if it is available" ON)
option(JAS_ENABLE_PROGRAMS "Enable building of the programs" ON)
option(JAS_ENABLE_MULTITHREADING_SUPPORT "Enable multithreading support" ON)
option(JAS_PREFER_PTHREAD
Expand Down
3 changes: 2 additions & 1 deletion src/libjasper/base/jas_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,8 @@ const jas_image_fmtinfo_t *jas_image_lookupfmtbyname(const char *name)
static uint_fast32_t inttobits(jas_seqent_t v, unsigned prec, bool sgnd)
{
uint_fast32_t ret;
ret = ((sgnd && v < 0) ? ((1 << prec) + v) : v) & JAS_ONES(prec);
ret = JAS_CAST(uint_fast32_t, ((sgnd && v < 0) ? ((1 << prec) + v) : v) &
JAS_ONES(prec));
return ret;
}

Expand Down
16 changes: 8 additions & 8 deletions src/libjasper/jpc/jpc_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2195,14 +2195,14 @@ static jpc_enc_rlvl_t *rlvl_create(jpc_enc_rlvl_t *rlvl, jpc_enc_cp_t *cp,

/* Compute the coordinates of the top-left and bottom-right
corners of the tile-component at this resolution. */
rlvl->tlx = JPC_CEILDIVPOW2(jas_seq2d_xstart(tcmpt->data), tcmpt->numrlvls -
1 - rlvlno);
rlvl->tly = JPC_CEILDIVPOW2(jas_seq2d_ystart(tcmpt->data), tcmpt->numrlvls -
1 - rlvlno);
rlvl->brx = JPC_CEILDIVPOW2(jas_seq2d_xend(tcmpt->data), tcmpt->numrlvls -
1 - rlvlno);
rlvl->bry = JPC_CEILDIVPOW2(jas_seq2d_yend(tcmpt->data), tcmpt->numrlvls -
1 - rlvlno);
rlvl->tlx = JPC_CEILDIVPOW2(JAS_CAST(uint_fast32_t,
jas_seq2d_xstart(tcmpt->data)), tcmpt->numrlvls - 1 - rlvlno);
rlvl->tly = JPC_CEILDIVPOW2(JAS_CAST(uint_fast32_t,
jas_seq2d_ystart(tcmpt->data)), tcmpt->numrlvls - 1 - rlvlno);
rlvl->brx = JPC_CEILDIVPOW2(JAS_CAST(uint_fast32_t,
jas_seq2d_xend(tcmpt->data)), tcmpt->numrlvls - 1 - rlvlno);
rlvl->bry = JPC_CEILDIVPOW2(JAS_CAST(uint_fast32_t,
jas_seq2d_yend(tcmpt->data)), tcmpt->numrlvls - 1 - rlvlno);

if (rlvl->tlx >= rlvl->brx || rlvl->tly >= rlvl->bry) {
rlvl->numhprcs = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/libjasper/pgx/pgx_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ static int pgx_putword(jas_stream_t *out, bool bigendian, int prec,
static uint_fast32_t pgx_inttoword(jas_seqent_t v, int prec, bool sgnd)
{
uint_fast32_t ret;
ret = ((sgnd && v < 0) ? ((1 << prec) + v) : v) & ((1 << prec) - 1);
ret = JAS_CAST(uint_fast32_t, ((sgnd && v < 0) ? ((1 << prec) + v) : v) &
((1 << prec) - 1));
return ret;
}

0 comments on commit 5d6db11

Please sign in to comment.