aadarshasubedi / hqx

Automatically exported from code.google.com/p/hqx
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Visual 2010 compilation error #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Ambiguous call:

/* Test if there is difference in color */
static inline int yuv_diff(uint32_t yuv1, uint32_t yuv2) {
    return (( abs((yuv1 & Ymask) - (yuv2 & Ymask)) > trY ) ||
            ( abs((yuv1 & Umask) - (yuv2 & Umask)) > trU ) ||
            ( abs((yuv1 & Vmask) - (yuv2 & Vmask)) > trV ) );
}

Error:
    10  IntelliSense: more than one instance of overloaded function "abs" matches the argument list:
            function "abs(int _X)"
            function "abs(long _X)"
            function "abs(long long _X)"
            argument types are: (unsigned int)  c:\Program Files\C++\Projects\HqxMAME\ScalerTest\hqx\common.h   51  15  ScalerTest

Solution: Explicitly cast value before calling "abs"

Original issue reported on code.google.com by zhnmju...@gmx.de on 25 Sep 2012 at 5:51