Ignore:
Timestamp:
03/14/17 16:44:18 (8 years ago)
Author:
epyon
Message:
  • clang compatibility
  • ecs upgrades
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/image/png_writer.cc

    r534 r551  
    1212#include <stdarg.h> 
    1313
    14 using namespace nv;
     14//using namespace nv;
    1515
    1616#if NV_COMPILER == NV_CLANG
     
    3333};
    3434
    35 #define STBI_MALLOC(sz)     nvmalloc(sz)
    36 #define STBI_REALLOC(p,sz)  nvrealloc(p,sz)
    37 #define STBI_FREE(p)        nvfree(p)
    38 #define STBI_MEMMOVE(d,s,c) nvmemmove(d,s,c)
     35#define STBI_MALLOC(sz)     nv::nvmalloc(sz)
     36#define STBI_REALLOC(p,sz)  nv::nvrealloc(p,sz)
     37#define STBI_FREE(p)        nv::nvfree(p)
     38#define STBI_MEMMOVE(d,s,c) nv::nvmemmove(d,s,c)
    3939
    4040typedef void stbi_write_func( void *context, void *data, int size );
     
    5757
    5858template < typename T >
    59 inline uchar8 byte_cast( T x )
    60 {
    61         return uchar8( ( x ) & 255 );
     59inline nv::uchar8 byte_cast( T x )
     60{
     61        return nv::uchar8( ( x ) & 255 );
    6262}
    6363
     
    246246}
    247247
     248static int iabs( int i )
     249{
     250        return i >= 0 ? i : -i;
     251}
     252
    248253static unsigned char stbiw__paeth( int a, int b, int c )
    249254{
    250         int p = a + b - c, pa = abs( p - a ), pb = abs( p - b ), pc = abs( p - c );
     255        int p = a + b - c, pa = iabs( p - a ), pb = iabs( p - b ), pc = iabs( p - c );
    251256        if ( pa <= pb && pa <= pc ) return byte_cast( a );
    252257        if ( pb <= pc ) return byte_cast( b );
     
    320325                                if ( p ) break;
    321326                                for ( i = 0; i < x*n; ++i )
    322                                         est += abs( (signed char)line_buffer[i] );
     327                                        est += iabs( (signed char)line_buffer[i] );
    323328                                if ( est < bestval ) { bestval = est; best = k; }
    324329                        }
Note: See TracChangeset for help on using the changeset viewer.