Skip to content

Commit

Permalink
Added the --out-dir option to the build script.
Browse files Browse the repository at this point in the history
Made a few code changes in an attempt to eliminate some compiler warnings
in the case of MSVC on Windows.
  • Loading branch information
mdadams committed Jul 30, 2022
1 parent 5d6db11 commit 815e3bf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
14 changes: 12 additions & 2 deletions build/build
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ use_pthread=0
enable_multithread=1
build_dir=
install_dir=
out_dir=
crostini=0
clean_build_dir=0
clean_install_dir=0
Expand Down Expand Up @@ -168,6 +169,12 @@ while [ $# -gt 0 ]; do
shift 1
enable_install=1
;;
--out-dir)
shift 1
[ $# -gt 0 ] || usage
out_dir="$1"
shift 1
;;
--build-dir)
shift 1
[ $# -gt 0 ] || usage
Expand Down Expand Up @@ -408,11 +415,14 @@ fi

source_dir="$abs_program_dir/.."

if [ -z "$out_dir" ]; then
out_dir="$source_dir/tmp_cmake"
fi
if [ -z "$build_dir" ]; then
build_dir="$source_dir/tmp_cmake/build"
build_dir="$out_dir/build"
fi
if [ -z "$install_dir" ]; then
install_dir="$source_dir/tmp_cmake/install"
install_dir="$out_dir/install"
fi

echo "operating system: $os"
Expand Down
5 changes: 3 additions & 2 deletions src/libjasper/base/jas_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,9 @@ 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 = JAS_CAST(uint_fast32_t, ((sgnd && v < 0) ? ((1 << prec) + v) : v) &
JAS_ONES(prec));
assert(v >= 0 || sgnd);
ret = ((sgnd && v < 0) ? (JAS_POW2_X(jas_seqent_t, prec) + v) : v) &
JAS_ONES(prec);
return ret;
}

Expand Down
6 changes: 6 additions & 0 deletions src/libjasper/include/jasper/jas_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ extern "C" {
set to one. */
#define JAS_ONES(n) \
((1 << (n)) - 1)
#if 0
#define JAS_ONES_X(type, n) \
((JAS_CAST(type, 1) << (n)) - 1)
#endif
#define JAS_POW2_X(type, n) \
(JAS_CAST(type, 1) << (n))

/******************************************************************************\
*
Expand Down
4 changes: 2 additions & 2 deletions src/libjasper/pgx/pgx_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +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 = JAS_CAST(uint_fast32_t, ((sgnd && v < 0) ? ((1 << prec) + v) : v) &
((1 << prec) - 1));
ret = ((sgnd && v < 0) ? (JAS_POW2_X(jas_seqent_t, prec) + v) : v) &
((1 << prec) - 1);
return ret;
}

0 comments on commit 815e3bf

Please sign in to comment.