Skip to content

Commit

Permalink
Getting rid of some of the warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Sep 17, 2024
1 parent 5f29603 commit 517e1be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/core/codestream/ojph_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1275,15 +1275,15 @@ namespace ojph {
else
{
p->BDnlt = (ui8)(siz.get_bit_depth(c) - 1);
p->BDnlt |= (ui8)(siz.is_signed(c) ? 0x80 : 0);
p->BDnlt |= (ui8)(siz.is_signed(c) ? 0x80 : (ui8)0);
}
}

if (this->enabled)
{
if (bit_depth != 0) // default captures some components
{
this->BDnlt = (ui8)((bit_depth - 1) | (is_signed ? 0x80 : 0));
this->BDnlt = (ui8)((bit_depth - 1) | (is_signed ? 0x80 : (ui8)0));
if (!all_same_bit_depth || !all_same_signedness)
{
// We cannot use the default for all undefined components, so we
Expand All @@ -1298,7 +1298,7 @@ namespace ojph {
p = add_object(c);
p->enabled = true;
p->BDnlt = (ui8)(siz.get_bit_depth(c) - 1);
p->BDnlt |= (ui8)(siz.is_signed(c) ? 0x80 : 0);
p->BDnlt |= siz.is_signed(c) ? 0x80 : (ui8)0;
}
}
}
Expand All @@ -1311,7 +1311,7 @@ namespace ojph {
}

//////////////////////////////////////////////////////////////////////////
void param_nlt::set_type3_transformation(ui16 comp_num, bool enable)
void param_nlt::set_type3_transformation(ui32 comp_num, bool enable)
{
param_nlt* p = get_comp_object(comp_num);
if (p == NULL)
Expand All @@ -1320,14 +1320,14 @@ namespace ojph {
}

//////////////////////////////////////////////////////////////////////////
bool param_nlt::get_type3_transformation(ui16 comp_num, ui8& bit_depth,
bool param_nlt::get_type3_transformation(ui32 comp_num, ui8& bit_depth,
bool& is_signed) const
{
const param_nlt* p = get_comp_object(comp_num);
p = p ? p : this;
if (p->enabled)
{
bit_depth = (p->BDnlt & 0x7F) + 1;
bit_depth = (p->BDnlt & 0x7F) + (ui8)1;
bit_depth = bit_depth <= 38 ? bit_depth : 38;
is_signed = (p->BDnlt & 0x80) == 0x80;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/codestream/ojph_params_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ namespace ojph {
}

void check_validity(const param_siz& siz);
void set_type3_transformation(ui16 comp_num, bool enable);
bool get_type3_transformation(ui16 comp_num, ui8& bit_depth,
void set_type3_transformation(ui32 comp_num, bool enable);
bool get_type3_transformation(ui32 comp_num, ui8& bit_depth,
bool& is_signed) const;
bool write(outfile_base* file) const;
void read(infile_base* file);
Expand Down

0 comments on commit 517e1be

Please sign in to comment.