[prev in list] [next in list] [prev in thread] [next in thread]
List: opensuse-packaging
Subject: Re: [opensuse-packaging] Need help with gcc45 error
From: Dave Plater <davejplater () gmail ! com>
Date: 2010-04-09 6:14:08
Message-ID: 4BBEC5B0.9070407 () gmail ! com
[Download RAW message or body]
On 04/08/2010 02:40 PM, Robert Schweikert wrote:
>
>
> Dave Plater wrote:
>> Hi, I've the following errors in the gcc45 build of multimedia:apps
>> dirac :-
>> quant_chooser.cpp: In member function 'void
>> dirac::QuantChooser::SetSkip(dirac::CodeBlock&, int)':
>> quant_chooser.cpp:343:49: error: invalid operands of types
>> '__gnu_cxx::__enable_if<true, double>::__type' and 'int' to binary
>> 'operator<<'
>> in line 343 where [i] is column 49 :-
>> if ( (std::abs(m_coeff_data[j][i])<<2) >= u_threshold )
>> can_skip = false;
>> In function :-
>> void QuantChooser::SetSkip( CodeBlock& cblock , const int qidx)
>> {
>> const int u_threshold = dirac_quantiser_lists.QuantFactor4( qidx );
>> // Sets the skip flag for a codeblock
>> bool can_skip = true;
>> for (int j=cblock.Ystart(); j<cblock.Yend(); ++j )
>> {
>> for (int i=cblock.Xstart(); i<cblock.Xend(); ++i )
>> {
>> if ( (std::abs(m_coeff_data[j][i])<<2) >= u_threshold )
>> can_skip = false;
>> } }
>> cblock.SetSkip( can_skip );
>> }
>
> From the error message I'd say that m_coeff_data is an array of
> doubles. std:abs is overloaded and will return a double and thus a
> double is being sent to the shift operator. This is not possible.
> Without knowing the intent of the person writing the code it is hard
> to say what the "right" solution is, but you can always cast (insert
> bug here) the result of the std:abs() call to an int. If you do this
> use a C++ cast please and not a C-style cast.
>>
>> and another one:-
>> quant_chooser.cpp: In member function 'dirac::CoeffType
>> dirac::QuantChooser::BlockAbsMax(const dirac::Subband&)':
>> quant_chooser.cpp:358:64: error: no matching function for call to
>> 'max(int&, __gnu_cxx::__enable_if<true, double>::__type)'
>> In line 358 where the last ) before ; is column 64:-
>> val = std::max( val , std::abs(m_coeff_data[j][i]) );
>> In function
>> CoeffType QuantChooser::BlockAbsMax( const Subband& node )
>> {
>> int val( 0 );
>>
>> for (int j=node.Yp() ; j<node.Yp()+node.Yl(); ++j)
>> {
>> for (int i=node.Xp() ; i<node.Xp()+node.Xl(); ++i)
>> { val = std::max( val ,
>> std::abs(m_coeff_data[j][i]) );
>> }// i
>> }// j
>>
>> return val;
>> }
>
> Same problem, data type incompatibility, std:max() is being called
> with an int (val) and a double (std:abs(m_ceff_data[i][j])); but there
> is no implementation of std:max(int, double), max only works for equal
> types, i.e. std:max(int, int) or std:max(double,double). You'll have
> to cast (insert bug here) one of the types.
>
> HTH,
> Robert
>> Can anyone tell me what's wrong, I don't understand the gcc output at
>> all, the package has failed for 45 days apparently, the 11.2 build is
>> fine.
>> Thanks
>> Dave P
>
I've filed an upstream bug.
Regards
Dave P
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-packaging+help@opensuse.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic