Ignore:
Timestamp:
01/12/17 14:41:17 (8 years ago)
Author:
epyon
Message:

CONTINUED:

  • getting rid of size_t
  • datatypes now restricted to uint32 size
  • 64-bit compatibility
  • copyright updates where modified
File:
1 edited

Legend:

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

    r487 r534  
    1 // Copyright (C) 2015-2015 ChaosForge Ltd
     1// Copyright (C) 2015-2017 ChaosForge Ltd
    22// http://chaosforge.org/
    33//
     
    251251        int remaining()
    252252        {
    253                 return m_img_buffer_end - m_img_buffer;
     253                return (int)( m_img_buffer_end - m_img_buffer );
    254254        }
    255255
     
    865865
    866866                case STBI__PNG_TYPE( 'I', 'E', 'N', 'D' ): {
    867                         uint32 raw_len, bpl;
     867                        size_t raw_len;
     868                        uint32 bpl;
    868869                        if ( first ) return stbi__err( "first not IHDR", "Corrupt PNG" );
    869870                        if ( scan != STBI__SCAN_load ) return 1;
     
    882883                        else
    883884                                s->img_out_n = s->img_n;
    884                         if ( !stbi__create_png_image( z, z->expanded, raw_len, s->img_out_n, depth, color, interlace ) ) return 0;
     885                        if ( !stbi__create_png_image( z, z->expanded, int( raw_len ), s->img_out_n, depth, color, interlace ) ) return 0;
    885886                        if ( has_trans )
    886887                                if ( !stbi__compute_transparency( z, tc, s->img_out_n ) ) return 0;
     
    977978static int stbi__stream_read( void *user, char *data, int size )
    978979{
    979         return reinterpret_cast<stream*>( user )->read( data, 1, size );
     980        return (int)reinterpret_cast<stream*>( user )->read( data, 1, size );
    980981}
    981982
     
    10221023        if ( stbi__png_info( &s, &x, &y, &comp ) == 1 )
    10231024        {
    1024                 str.seek( pos, origin::SET );
     1025                str.seek( (long)pos, origin::SET );
    10251026                format.type = UBYTE;
    10261027                switch ( comp )
Note: See TracChangeset for help on using the changeset viewer.