Changeset 487


Ignore:
Timestamp:
03/08/16 08:05:51 (9 years ago)
Author:
epyon
Message:
 
Location:
trunk
Files:
2 added
49 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv.lua

    r486 r487  
    151151                        buildoptions { "-std=c++0x" }
    152152                end
     153       
    153154        configuration { "windows", "gmake" }
    154                 linkoptions { "-mwindows" }
     155                linkoptions { "-Wl,--subsystem,windows" }
     156--              linkoptions { "-mwindows" }
    155157
    156158        configuration "linux"
  • trunk/nv/core/ascii_printer.hh

    r484 r487  
    2626                explicit ascii_printer( terminal * term );
    2727
    28                 void print( uchar8 ch, const position& p, uint32 color )
     28                void print( char ch, const position& p, uint32 color )
    2929                {
    3030                        m_terminal->print( p, color, ch );
  • trunk/nv/core/random.hh

    r451 r487  
    5151                {
    5252                        NV_ASSERT( max >= min, "Bad srange argument!" );
    53                         return static_cast< sint32 >( urand( static_cast< uint32 >( max - min ) + 1 ) + min );
     53                        // this method probably reduces range //
     54                        uint32 roll = urand( static_cast<uint32>( max - min ) + 1 );
     55                        return static_cast< sint32 >( roll ) + min;
    5456                }
    5557
  • trunk/nv/core/resource.hh

    r485 r487  
    3636        public:
    3737                resource_handler( resource_type_id id ) : m_type_id( id ) {}
     38                virtual ~resource_handler() {}
    3839
    3940        protected:
     
    4142                virtual void raw_add( resource_id id, void* value ) = 0;
    4243                virtual void unlock( resource_id id ) = 0;
    43                 virtual void release( resource_id id ) = 0;
     44                //virtual void release( resource_id id ) = 0;
    4445                virtual bool exists( resource_id id ) = 0;
    4546                virtual bool load_resource( const string_view& id ) = 0;
     
    8485                constexpr explicit operator bool() const { return is_valid(); }
    8586                resource_lock< T > lock() const { return resource_lock< T >( *this, resource_unchecked() ); }
    86                 ~resource()
    87                 {
    88                         if ( m_handler ) m_handler->release( m_id );
    89                 }
    90         protected:
     87//              ~resource()
     88//              {
     89//                      if ( m_handler ) m_handler->release( m_id );
     90//              }
     91        protected:
     92                explicit resource( resource_id id ) : m_id( id ), m_handler( nullptr ) {}
     93
    9194                resource_id       m_id;
    9295                resource_handler* m_handler;
     
    134137        public:
    135138
    136                 void release( resource_handler* r )
    137                 {
    138                         r->release( m_id );
    139                         m_id = 0;
    140                 }
     139//              void release( resource_handler* r )
     140//              {
     141//                      r->release( m_id );
     142//                      m_id = 0;
     143//              }
    141144                ~resource_handle()
    142145                {
     
    158161                        : m_id( r.m_id )
    159162                        , m_handler( r.m_handler )
    160                         , m_resource( r.m_handler ? r.m_handler->lock<T>( r.m_id, false ) : nullptr ) {}
     163                        , m_resource( r.m_handler ? r.m_handler->template lock<T>( r.m_id, false ) : nullptr ) {}
    161164                explicit resource_lock( const resource< T >& r )
    162165                        : m_id( r.m_id )
    163166                        , m_handler( r.m_handler )
    164                         , m_resource( r.m_handler->lock<T>( r.m_id ) ) {}
     167                        , m_resource( r.m_handler->template lock<T>( r.m_id ) ) {}
    165168                explicit resource_lock( const resource_handle< T >& r, resource_handler* handler ) : m_id( r.m_id ), m_handler( handler ), m_resource( handler->raw_lock( r.m_id ) ) {}
    166169                resource_lock( const resource_lock& ) = delete;
     
    214217                        auto m = m_handlers.find( resource_type_id( rtti_type_hash<T>::value ) );
    215218                        NV_ASSERT( m != m_handlers.end(), "Resource type unrecognized!" );
    216                         if ( m->second->exists( id ) || m->second->load_resource( id ) )
    217                                 return m->second->create< T >( id );
     219                        shash64 hid( id );
     220                        if ( m->second->exists( hid ) || m->second->load_resource( id ) )
     221                                return m->second->create< T >( hid );
    218222                        NV_ASSERT( false, "resource_manager.get failed!" );
    219223                        return resource< T >();
     
    225229                        auto m = m_handlers.find( resource_type_id( rtti_type_hash<T>::value ) );
    226230                        NV_ASSERT( m != m_handlers.end(), "Resource type unrecognized!" );
    227                         if ( m->second->exists( id ) )
     231                        shash64 hid( id );
     232                        if ( m->second->exists( hid ) )
    228233                        {
    229                                 return m->second->create< T >( id );
     234                                return m->second->create< T >( hid );
    230235                        }
    231236                        NV_ASSERT( false, "resource_manager.get failed!" );
  • trunk/nv/core/types.hh

    r450 r487  
    3434                constexpr thash64() : inherited_type() {}
    3535                constexpr explicit thash64( hash_type value ) : inherited_type( value ) {}
    36                 constexpr thash64( const thash64& value ) = default;
    3736
    3837                template < typename T >
     
    211210                        ( is_pointer<field_type>::value ? TF_POINTER : 0 ) |
    212211                        ( is_pod<field_type>::value ? TF_SIMPLETYPE : 0 );
    213                 f.offset = offset_of( field );
     212                f.offset = uint32( offset_of( field ) );
    214213                f.control = nullptr;
    215214                f.enumidx = 0;
     
    229228                        ( is_pointer<TFIELD>::value ? TF_POINTER : 0 ) |
    230229                        ( is_pod<TFIELD>::value ? TF_SIMPLETYPE : 0 );
    231                 f.offset = offset_of( field );
     230                f.offset = uint32( offset_of( field ) );
    232231                f.control = nullptr;
    233232                f.enumidx = 0;
     
    248247                        ( is_pointer<field_type>::value ? TF_POINTER : 0 ) |
    249248                        ( is_pod<field_type>::value ? TF_SIMPLETYPE : 0 );
    250                 f.offset = offset_of( field );
     249                f.offset = uint32( offset_of( field ) );
    251250                f.control = m_entry->field_names[ control_name ];
    252251                f.enumidx = static_cast< sint32 >( control_value );
     
    266265                        ( is_pointer<TFIELD>::value ? TF_POINTER : 0 ) |
    267266                        ( is_pod<TFIELD>::value ? TF_SIMPLETYPE : 0 );
    268                 f.offset = offset_of( field );
     267                f.offset = uint32( offset_of( field ) );
    269268                f.control = m_entry->field_names[control_name];
    270269                f.enumidx = static_cast<sint32>( control_value );
  • trunk/nv/curses/curses_terminal.hh

    r395 r487  
    3535         * Print a character of the given color to the screen memory
    3636         */
    37         virtual void print( position p, uint32 color, unsigned char ch );
     37        virtual void print( position p, uint32 color, char ch );
    3838
    3939        /**
  • trunk/nv/engine/animation.hh

    r486 r487  
    8585                animator_transition_instance() {}
    8686
    87                 animator_transition_instance( const animator_transition_data& data, uint32 source )
    88                         : animator_transition_data( data ), source( source ), time( 0.0f )
     87                animator_transition_instance( const animator_transition_data& data, uint32 src )
     88                        : animator_transition_data( data ), source( src ), time( 0.0f )
    8989                {
    9090
     
    9696        public:
    9797                vector< animator_transition_instance > m_transitions;
    98                 uint32 m_current_state;
     98                sint32 m_current_state;
    9999                float m_time;
    100100
    101101                animator_layer_instance() : m_current_state( 0 ), m_time( 0.0f ) {}
    102                 void set_state( uint32 state ) { m_current_state = state; }
    103                 uint32 get_state() const { return m_current_state; }
    104                 uint32 get_final_state() const
     102                void set_state( uint32 state ) { m_current_state = sint32( state ); }
     103                sint32 get_state() const { return m_current_state; }
     104                sint32 get_final_state() const
    105105                {
    106106                        if ( m_transitions.size() > 0 )
    107                                 return m_transitions.back().target;
     107                                return sint32( m_transitions.back().target );
    108108                        return m_current_state;
    109109                }
     
    135135                                {
    136136                                        animator_transition_instance& tr = m_transitions.front();
    137                                         m_current_state = tr.target;
     137                                        m_current_state = sint32( tr.target );
    138138                                        tr.time += time;
    139139                                        if ( tr.time < tr.duration ) break;
     
    181181                        for ( uint32 i = 0; i < data->layers.size(); ++i )
    182182                        {
    183                                 m_layers[i].set_state( data->layers[i].def_state );
     183                                m_layers[i].set_state( uint32( data->layers[i].def_state ) );
    184184                        }
    185185                }
     
    190190                }
    191191
    192                 uint32 base_state() const
     192                sint32 base_state() const
    193193                {
    194194                        // HACK
     
    203203                                if ( m_layers[i].m_current_state != -1 )
    204204                                {
    205                                         uint32 last_state = m_layers[i].get_final_state();
    206                                         const animator_state_data& state = data->layers[i].states[last_state];
     205                                        sint32 last_state = m_layers[i].get_final_state();
     206                                        const animator_state_data& state = data->layers[i].states[ uint32( last_state ) ];
    207207                                        auto it = state.transitions.find( name );
    208208                                        if ( it != state.transitions.end() )
    209209                                        {
    210                                                 m_layers[i].add_transition( it->second, last_state );
     210                                                m_layers[i].add_transition( it->second, uint32( last_state ) );
    211211                                        }
    212212                                }
     
    228228                                        {
    229229                                                const animator_layer_data& layer = data->layers[i];
    230                                                 const animator_state_data& state = layer.states[m_layers[i].m_current_state];
     230                                                const animator_state_data& state = layer.states[ uint32( m_layers[i].m_current_state ) ];
    231231                                                if ( state.poses.size() > 0 )
    232232                                                        animate_state( m_transforms, state, data->layers[i], data->poses, get_frame( state, m_layers[i].m_time ) );
     
    258258                        const animator_layer_instance& linst = m_layers[layer_id];
    259259                        m_layers[layer_id].update( dtime );
    260                         if ( m_layers[layer_id].m_transitions.size() > 0 )
    261                         {
    262                                 animate_layer( ldata, linst.m_transitions.front(), data->poses, linst.m_time );
    263                         }
    264                         else
    265                         {
    266                                 const animator_state_data& state = ldata.states[linst.m_current_state];
    267                                 if ( state.poses.size() > 0 )
    268                                         animate_state( m_transforms, state, ldata, data->poses, get_frame( state, linst.m_time ) );
     260                        if ( linst.m_current_state != -1 )
     261                        {
     262                                if ( m_layers[layer_id].m_transitions.size() > 0 )
     263                                {
     264                                        animate_layer( ldata, linst.m_transitions.front(), data->poses, linst.m_time );
     265                                }
     266                                else
     267                                {
     268                                        const animator_state_data& state = ldata.states[ uint32( linst.m_current_state ) ];
     269                                        if ( state.poses.size() > 0 )
     270                                                animate_state( m_transforms, state, ldata, data->poses, get_frame( state, linst.m_time ) );
     271                                }
    269272                        }
    270273                        m_transforms.delocalize( data->poses->get_tree() );
  • trunk/nv/engine/resource_system.hh

    r486 r487  
    7777                {
    7878                        if ( exists( id ) )
    79                                 return create< T >( id );
     79                                return this->template create< T >( id );
    8080                        else
    8181                        {
    8282                                if ( this->load_resource( id ) )
    8383                                {
    84                                         return create< T >( id );
     84                                        return this->template create< T >( id );
    8585                                }
    8686                        }
     
    9191                resource_type get( uint64 id )
    9292                {
    93                         if ( exists( shash64( id ) ) ) return create< T >( shash64( id ) );
     93                        if ( exists( shash64( id ) ) ) return this->template create< T >( shash64( id ) );
    9494                        // NV_ASSERT( false, "resource_manager.get failed!" );
    9595                        return resource_type();
     
    120120                        }
    121121                        m_store[id] = resource;
    122                         return create< T >( id );
     122                        return this->template create< T >( id );
    123123                }
    124124
     
    140140                }
    141141
    142                 virtual void unlock( resource_id ) {};
    143                 virtual void release( resource_id ) {};
     142                virtual void unlock( resource_id ) {}
     143                virtual void release( resource_id ) {}
    144144                virtual void release( stored_type ) {}
    145145
  • trunk/nv/gfx/poses.hh

    r486 r487  
    9090                        pose.m_transforms.resize( m_node_tree.size() );
    9191
    92                         for ( sint32 i = 0; i < sint32( m_node_tree.size() ); ++i )
     92                        for ( uint32 i = 0; i < m_node_tree.size(); ++i )
    9393                        {
    9494                                const data_channel_set* node = nullptr;
  • trunk/nv/gfx/skeleton_instance.hh

    r486 r487  
    6969                }
    7070
    71                 uint32 size() const { return m_offsets.size(); };
     71                uint32 size() const { return m_offsets.size(); }
    7272        protected:
    7373                dynamic_array< value_type >   m_offsets;
     
    8484                void prepare( const mesh_nodes_data* node_data, const data_node_list& bone_data );
    8585                void prepare( const data_node_list& pose_data, const data_node_list& bone_data );
    86                 uint32 size() const { return m_indices.size(); };
    87                 uint32 skeleton_size() const { return m_bone_count; };
     86                uint32 size() const { return m_indices.size(); }
     87                uint32 skeleton_size() const { return m_bone_count; }
    8888        protected:
    8989                dynamic_array< sint16 > m_indices;
  • trunk/nv/interface/data_channel.hh

    r482 r487  
    6363                const T& extract( uint16 slot_index, uint32 index ) const
    6464                {
    65                         NV_ASSERT( slot < m_desc.size(), "Bas slot passed to extract!" )
     65                        NV_ASSERT( slot_index < m_desc.size(), "Bas slot passed to extract!" );
    6666                        return *reinterpret_cast<const T*>( m_data + m_desc.element_size()*index + m_desc[slot_index].offset );
    6767                }
  • trunk/nv/interface/image_loader.hh

    r486 r487  
    2828                virtual image_data* load( stream& ) = 0;
    2929                virtual image_data* load( stream&, image_format format ) = 0;
    30                 virtual ~image_loader() {};
     30                virtual ~image_loader() {}
    3131        };
    3232
  • trunk/nv/interface/interpolate.hh

    r486 r487  
    147147        {
    148148                inline static T interpolate( float f, const T& lhs, const T& rhs ) { return math::slerp( lhs, rhs, f ); }
    149                 inline static T interpolate( float f, const T& v0, const T& v1, const T& v2, const T& v3 ) { return math::slerp( v1, v2, f ); }
     149                inline static T interpolate( float f, const T&, const T& v1, const T& v2, const T& ) { return math::slerp( v1, v2, f ); }
    150150        };
    151151
     
    209209                case interpolation::QUADRATIC     : return quadratic_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );
    210210                case interpolation::SQUADRATIC    : return squad_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );
    211                 default: case interpolation::NONE : return no_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );
     211                default                          : return no_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );
    212212                }
    213213        }
     
    224224                case interpolation::QUADRATIC     : interpolate_array( result, f, quadratic_interpolator<value_type>( f ), ::nv::forward<Args>( args )... ); break;
    225225                case interpolation::SQUADRATIC    : interpolate_array( result, f, squad_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
    226                 default: case interpolation::NONE : interpolate_array( result, f, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
     226                default                          : interpolate_array( result, f, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
    227227                }
    228228        }
     
    277277                case interpolation::QUADRATIC     : interpolate_blend( result, f, in, blend_factor, normalized_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
    278278                case interpolation::SQUADRATIC    : interpolate_blend( result, f, in, blend_factor, spherical_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
    279                 default: case interpolation::NONE : interpolate_blend( result, f, in, blend_factor, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
     279                default                          : interpolate_blend( result, f, in, blend_factor, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
    280280                }
    281281        }
  • trunk/nv/interface/mesh_data.hh

    r485 r487  
    6565
    6666                data_node_list( data_node_list&& other )
    67                         : m_name( other.m_name ), m_data( nv::move( other.m_data ) )
     67                        : m_data( nv::move( other.m_data ) ), m_name( other.m_name )
    6868                {
    6969                }
     
    123123                        for ( uint8 n = 0; n < uint8( m_data.size() ); ++n )
    124124                        {
    125                                 if ( m_data[n].parent_id != -1 )
    126                                         m_children[m_data[n].parent_id].push( n );
     125                                if ( m_data[n].parent_id >= 0 )
     126                                        m_children[ uint32( m_data[n].parent_id ) ].push( n );
    127127                        }
    128128                }
  • trunk/nv/interface/terminal.hh

    r395 r487  
    3636         * Print a character of the given color to the screen memory
    3737         */
    38         virtual void print( position p, uint32 color, unsigned char ch ) = 0;
     38        virtual void print( position p, uint32 color, char ch ) = 0;
    3939
    4040        /**
  • trunk/nv/interface/uniform.hh

    r486 r487  
    2727        {
    2828        public:
    29                 uniform_base( datatype type, int location, int length )
     29                uniform_base( datatype type, int location, size_t length )
    3030                        : m_type( type ), m_location(location), m_length( length ), m_dirty( true ) {}
    3131                bool try_type_check( datatype )
     
    4242                datatype get_type() const { return m_type; }
    4343                int get_location() const { return m_location; }
    44                 int get_length() const { return m_length; }
     44                size_t get_length() const { return m_length; }
    4545                bool is_dirty() const { return m_dirty; }
    4646                void clean() { m_dirty = false; }
    47                 static uniform_base* create( datatype utype, int location, int length );
     47                static uniform_base* create( datatype utype, int location, size_t length );
    4848                virtual ~uniform_base() {}
    4949        protected:
    5050                datatype m_type;
    5151                int      m_location;
    52                 int      m_length;
     52                size_t   m_length;
    5353                bool     m_dirty;
    5454        };
     
    6060                typedef T value_type;
    6161
    62                 uniform( int location, int length )
     62                uniform( int location, size_t length )
    6363                        : uniform_base( type_to_enum< T >::type, location, length ), m_value( nullptr )
    6464                {
     
    285285        };
    286286
    287         inline uniform_base* uniform_base::create( datatype utype, int location, int length )
     287        inline uniform_base* uniform_base::create( datatype utype, int location, size_t length )
    288288        {
    289289                switch( utype )
  • trunk/nv/lib/assimp.hh

    r485 r487  
    2323#       define NV_ASSIMP_PATH "libassimp32.so"
    2424#endif
     25
     26typedef nv::size_t size_t;
    2527
    2628extern "C" {
  • trunk/nv/rogue/fov.hh

    r455 r487  
    2323                        virtual bool is_transparent( const position& ) const = 0;
    2424                        virtual void set_visible( const position&, bool ) = 0;
     25                        virtual ~fov_interface() {}
    2526                };
    2627
  • trunk/nv/stl/algorithm/fill.hh

    r402 r487  
    1818#include <nv/stl/iterator.hh>
    1919#include <nv/stl/type_traits/common.hh>
     20#include <nv/stl/type_traits/properties.hh>
    2021
    2122namespace nv
  • trunk/nv/stl/container/growing_storage.hh

    r448 r487  
    134134                void push_back( const value_type& e )
    135135                {
    136                         if ( try_grow( 1 ) ) copy_construct_object( Storage::data() + m_size - 1, e );
     136                        if ( try_grow( 1 ) ) copy_construct_object( Storage::data() + sint32( m_size ) - 1, e );
    137137                }
    138138                void push_back( value_type&& e )
    139139                {
    140                         if ( try_grow( 1 ) ) move_construct_object( Storage::data() + m_size - 1, forward<value_type>( e ) );
     140                        if ( try_grow( 1 ) ) move_construct_object( Storage::data() + sint32( m_size ) - 1, forward<value_type>( e ) );
    141141                }
    142142                template < typename... Args >
    143143                void emplace_back( Args&&... args )
    144144                {
    145                         if ( try_grow( 1 ) ) construct_object( Storage::data() + m_size - 1, forward<Args>( args )... );
     145                        if ( try_grow( 1 ) ) construct_object( Storage::data() + sint32( m_size ) - 1, forward<Args>( args )... );
    146146                }
    147147
     
    149149                {
    150150                        if ( m_size == 0 ) return;
    151                         InitializePolicy::destroy( Storage::data() + m_size - 1 );
     151                        InitializePolicy::destroy( Storage::data() + sint32( m_size ) - 1 );
    152152                        m_size.size( m_size - 1 );
    153153                }
     
    157157                {
    158158                        if ( m_size == 0 ) return iterator();
    159                         iterator iend = Storage::data() + m_size;
     159                        iterator iend = Storage::data() + sint32( m_size );
    160160                        InitializePolicy::destroy( position );
    161161                        if ( ( position + 1 ) < iend )
     
    167167                iterator erase( iterator first, iterator last )
    168168                {
    169                         iterator iend = Storage::data() + m_size;
     169                        NV_ASSERT( first <= last, "Bad arguments passed to erase!" );
     170                        iterator iend = Storage::data() + sint32( m_size );
    170171                        InitializePolicy::destroy( first, last );
    171172                        iterator position = raw_alias_copy( last, iend, first );
    172                         m_size.size( m_size - ( last - first ) );
     173                        m_size.size( m_size - size_type( last - first ) );
    173174                        return position;
    174175                }
     
    178179                        // TODO: distance can't be called on destructive iterators - check
    179180                        //   and use pushback if needed?
    180                         size_type d        = distance( first, last );
     181                        NV_ASSERT( first <= last, "Bad arguments passed to append!" );
     182                        size_type d        = size_type( distance( first, last ) );
    181183                        size_type old_size = m_size;
    182184                        if ( try_grow( d ) )
     
    191193                        {
    192194                                iterator iposition = Storage::data() + offset;
    193                                 iterator iend = Storage::data() + m_size - 1;
     195                                iterator iend = Storage::data() + sint32( m_size ) - 1;
    194196                                raw_alias_copy( iposition, iend, iposition + 1 );
    195197                                copy_construct_object( iposition, value );
     
    202204                        // TODO: distance can't be called on destructive iterators - check
    203205                        //   and use pushback if needed?
     206                        NV_ASSERT( first <= last, "Bad arguments passed to insert!" );
    204207                        ptrdiff_t offset = position - Storage::data();
    205                         size_type d = distance( first, last );
     208                        size_type d = size_type( distance( first, last ) );
    206209                        if ( try_grow( d ) )
    207210                        {
    208211                                iterator iposition = Storage::data() + offset;
    209                                 iterator iend = Storage::data() + m_size - d;
     212                                iterator iend = Storage::data() + sint32( m_size ) - d;
    210213                                raw_alias_copy( iposition, iend, iposition + d );
    211214                                InitializePolicy::copy( first, last, iposition );
     
    217220                        size_type old_size = m_size;
    218221                        resize_impl( new_size );
    219                         if ( m_size > old_size ) InitializePolicy::initialize( Storage::data() + old_size, Storage::data() + m_size );
     222                        if ( m_size > old_size ) InitializePolicy::initialize( Storage::data() + old_size, Storage::data() + sint32( m_size ) );
    220223                }
    221224
     
    224227                        size_type old_size = m_size;
    225228                        resize_impl( new_size );
    226                         if ( m_size > old_size ) uninitialized_construct( Storage::data() + old_size, Storage::data() + m_size );
     229                        if ( m_size > old_size ) uninitialized_construct( Storage::data() + old_size, Storage::data() + sint32( m_size ) );
    227230                }
    228231
     
    231234                        size_type old_size = m_size;
    232235                        resize_impl( new_size );
    233                         if ( m_size > old_size ) uninitialized_fill( Storage::data() + old_size, Storage::data() + m_size, value );
     236                        if ( m_size > old_size ) uninitialized_fill( Storage::data() + old_size, Storage::data() + sint32( m_size ), value );
    234237                }
    235238
     
    249252                        // TODO: distance can't be called on destructive iterators - check
    250253                        //   and use pushback if needed?
    251                         if ( m_size > 0 ) InitializePolicy::destroy( Storage::data(), Storage::data() + m_size );
    252                         size_type d = distance( first, last );
     254                        NV_ASSERT( first <= last, "Bad arguments passed to insert!" );
     255                        if ( m_size > 0 ) InitializePolicy::destroy( Storage::data(), Storage::data() + sint32( m_size ) );
     256                        size_type d = size_type( distance( first, last ) );
    253257                        if ( try_resize( d, false ) )
    254258                                InitializePolicy::copy( first, last, Storage::data() );
     
    265269                        if ( m_size > 0 )
    266270                        {
    267                                 InitializePolicy::destroy( Storage::data(), Storage::data() + m_size );
     271                                InitializePolicy::destroy( Storage::data(), Storage::data() + sint32( m_size ) );
    268272                                m_size = size_impl_type();
    269273                        }
     
    285289                                if ( new_size < old_size )
    286290                                {
    287                                         InitializePolicy::destroy( Storage::data() + new_size, Storage::data() + old_size );
     291                                        InitializePolicy::destroy( Storage::data() + sint32( new_size ), Storage::data() + sint32( old_size ) );
    288292                                }
    289293                                if ( try_resize( new_size, true ) )
  • trunk/nv/stl/functional/hash.hh

    r479 r487  
    174174                constexpr hash_value() : m_value( 0 ) {}
    175175                constexpr explicit hash_value( hash_type value ) : m_value( value ) {}
    176                 constexpr hash_value( const hash_value& ) = default;
    177176
    178177                constexpr bool is_valid() const { return m_value != 0; }
  • trunk/nv/stl/hash_store.hh

    r486 r487  
    7474        public:
    7575                typedef hash_table_base< hash_store_entry_policy< T, H > > base_type;
     76                typedef typename base_type::iterator           iterator;
     77                typedef typename base_type::const_iterator     const_iterator;
     78                typedef typename base_type::insert_return_type insert_return_type;
    7679                typedef H key_type;
    7780                typedef H query_type;
  • trunk/nv/stl/math/angle.hh

    r471 r487  
    139139
    140140                template < typename T, typename enable_if< is_floating_point<T>::value >::type* = nullptr >
    141                 inline T angle( T a, T y )
     141                inline T angle( T a, T b )
    142142                {
    143143                        return acos( clamp( dot( a, b ), T( -1 ), T( 1 ) ) );
     
    156156                        const T result( acos( clamp( dot( a, b ), T( -1 ), T( 1 ) ) ) );
    157157
    158                         if ( all( epsilon_equal( y, math::rotate( a, result ), T( 0.0001 ) ) ) )
     158                        if ( all( epsilon_equal( b, math::rotate( a, result ), T( 0.0001 ) ) ) )
    159159                                return result;
    160160                        else
  • trunk/nv/stl/math/exponential.hh

    r471 r487  
    4444                inline T exp2( T x )
    4545                {
    46                         return exp( ln_two<T>() );
     46                        return exp( ln_two<T>() * x );
    4747                }
    4848
  • trunk/nv/stl/math/matrix_transform.hh

    r472 r487  
    175175
    176176                        tmat4<T> result( T( 0 ) );
    177                         result[0][0] = ( static_cast<T>( 2 ) * zNear ) / ( right - left );
    178                         result[1][1] = ( static_cast<T>( 2 ) * zNear ) / ( top - bottom );
     177                        result[0][0] = ( static_cast<T>( 2 ) * z_near ) / ( right - left );
     178                        result[1][1] = ( static_cast<T>( 2 ) * z_near ) / ( top - bottom );
    179179                        result[2][2] = ep - static_cast<T>( 1 );
    180180                        result[2][3] = static_cast<T>( -1 );
     
    217217                {
    218218                        NV_ASSERT( delta.x > T( 0 ) && delta.y > T( 0 ), "bad delta passed to pick_matrix!" );
    219                         if ( !( delta.x > T( 0 ) && delta.y > T( 0 ) ) ) return result;
    220 
    221                         tmat4<T> result( 1 );
     219                        if ( !( delta.x > T( 0 ) && delta.y > T( 0 ) ) ) return tmat4<T>( 1 );
     220
    222221                        tvec3<T> temp(
    223222                                ( T( viewport[2] ) - T( 2 ) * ( center.x - T( viewport[0] ) ) ) / delta.x,
     
    226225                        );
    227226
    228                         result = translate( result, temp );
     227                        tmat4<T> result = translate( result, temp );
    229228                        return scale( result, tvec3<T>( T( viewport[2] ) / delta.x, T( viewport[3] ) / delta.y, T( 1 ) ) );
    230229                }
  • trunk/nv/stl/math/quaternion.hh

    r485 r487  
    4141                        {
    4242                                NV_ASSERT( i >= 0 && i < 4, "index out of range" );
    43                                 return ( &x )[i]
     43                                return ( &x )[i];
    4444                        }
    4545                        inline const T& operator[]( length_type i ) const
    4646                        {
    4747                                NV_ASSERT( i >= 0 && i < 4, "index out of range" );
    48                                 return ( &x )[i]
     48                                return ( &x )[i];
    4949                        }
    5050
    5151                        constexpr tquat()
    52                                 : x( 0 ), y( 0 ), z( 0 ), w( 1 ) {};
     52                                : x( 0 ), y( 0 ), z( 0 ), w( 1 ) {}
    5353                        constexpr tquat( const tquat<T>& q )
    5454                                : x( q.x ), y( q.y ), z( q.z ), w( q.w ) {}
  • trunk/nv/stl/priority_queue.hh

    r446 r487  
    8080                void emplace( Args&&... args )
    8181                {
    82                         m_data.emplace_back( ::std::forward<Args>( args )... );
     82                        m_data.emplace_back( ::nv::forward<Args>( args )... );
    8383                        push_heap( m_data.begin(), m_data.end(), m_compare );
    8484                }
  • trunk/nv/stl/string.hh

    r485 r487  
    134134
    135135                constexpr explicit string_hash( hash_type value ) : inherited_type( value ) {}
    136                 constexpr string_hash( const string_hash& value ) = default;
    137136        };
    138137
  • trunk/src/core/ascii_printer.cc

    r486 r487  
    2020        for ( char c : text )
    2121        {
    22                 m_terminal->print( coord, color, static_cast<unsigned char>( c ) );
     22                m_terminal->print( coord, color, c );
    2323                ++coord.x;
    2424                if ( coord.x >= m_terminal->get_size().x ) break;
  • trunk/src/core/io_event.cc

    r450 r487  
    6464        ;
    6565
    66         uint32 counter = 0;
    6766        db->create_type<io_event_code>()
    68 #       define NV_IO_EVENT( id ) .value( #id, counter++ )
     67#       define NV_IO_EVENT( id ) .value( #id, id )
    6968#               include <nv/detail/io_event_list.inc>
    7069#       undef NV_IO_EVENT
  • trunk/src/core/random.cc

    r471 r487  
    2222{
    2323        m_state[0] = static_cast<uint32>( seed & mt_full_mask );
    24         for ( int i = 1; i < mersenne_n; i++ )
     24        for ( uint32 i = 1; i < mersenne_n; i++ )
    2525        {
    2626                m_state[i]  = ( 1812433253UL * ( m_state[i - 1] ^ ( m_state[i - 1] >> 30 ) ) + i );
     
    7171
    7272random::random( random::seed_type seed /*= 0 */ )
    73         : m_remaining( 0 ), m_next( nullptr ), m_seeded( 0 )
     73        : m_next( nullptr ), m_remaining( 0 ), m_seeded( 0 )
    7474{
    7575        mt_init( seed == 0 ? randomized_seed() : seed );
  • trunk/src/curses/curses_terminal.cc

    r406 r487  
    5353}
    5454
    55 void curses_terminal::print( position p, uint32 color, unsigned char ch )
     55void curses_terminal::print( position p, uint32 color, char ch )
    5656{
    5757        m_update_needed = true;
     
    6464                attrset((static_cast<uint32>(color+1) << 24)  & 0xff000000ul);
    6565        }
    66         mvaddch( p.y-1, p.x-1, ch );
     66        mvaddch( p.y-1, p.x-1, chtype(ch) );
    6767        ::move( m_cursor.y-1, m_cursor.x-1 );
    6868}
  • trunk/src/engine/animation.cc

    r486 r487  
    6161                layer.def_state = -1;
    6262
    63                 if ( layer.mask != -1 )
     63                if ( layer.mask >= 0 )
    6464                {
    6565                        const auto& tree = animator->poses->get_tree();
    6666                        layer.mask_vector.resize( tree.size(), false );
    67                         fill_mask_vector_rec( layer.mask_vector, tree, layer.mask );
     67                        fill_mask_vector_rec( layer.mask_vector, tree, uint32( layer.mask ) );
    6868                }
    6969
  • trunk/src/formats/assimp_loader.cc

    r486 r487  
    215215                {
    216216                        aiBone* bone  = mesh->mBones[m];
    217                         for (unsigned int w=0; w<bone->mNumWeights; w++)
     217                        for ( size_t w=0; w<bone->mNumWeights; w++)
    218218                        {
    219219                                assimp_skinned_vtx& v = vtx[ bone->mWeights[w].mVertexId ];
    220220                                bool found = false;
    221                                 for ( int i = 0 ; i < 4; ++i )
     221                                for ( size_t i = 0 ; i < 4; ++i )
    222222                                {
    223223                                        if ( v.boneweight[i] <= 0.0f )
     
    409409                        {
    410410                                assimp_skinned_vtx& vertex = channel.data()[v];
    411                                 for ( int i = 0; i < 4; ++i )
     411                                for ( size_t i = 0; i < 4; ++i )
    412412                                {
    413413                                        if ( vertex.boneweight[i] > 0.0f )
     
    429429                        mat4 tr = nv::math::inverse( assimp_mat4_cast( m_data->node_by_name[bone_data[i].name]->mTransformation ) );
    430430                        int pid = bone_data[i].parent_id;
    431                         if ( pid != -1 )
    432                                 bone_data[i].transform = tr * bone_data[pid].transform;
     431                        if ( pid >= 0 )
     432                                bone_data[i].transform = tr * bone_data[ size_t( pid ) ].transform;
    433433                        else
    434434                                bone_data[i].transform = tr;
     
    492492{
    493493        int this_is_incorrect;
    494         return m_mesh_count == 0 || m_data->scene->mNumAnimations > 0 && m_data->skeletons.size() == 0;
    495 }
    496 
    497 int indent = 0;
     494        return m_mesh_count == 0 || ( m_data->scene->mNumAnimations > 0 && m_data->skeletons.size() == 0 );
     495}
    498496
    499497void nv::assimp_loader::scan_nodes( const void* node ) const
     
    537535        transform t = nv::transform( nv::assimp_mat4_cast( node->mTransformation ) );
    538536
    539         nodes[ this_id ] = anode ? create_keys( anode, t ) : data_channel_set_creator::create_set( 0 );
    540 
    541         infos[this_id].name      = make_name( name );
    542         infos[this_id].parent_id = parent_id;
     537        nodes[ uint32( this_id ) ] = anode ? create_keys( anode, t ) : data_channel_set_creator::create_set( 0 );
     538        infos[ uint32( this_id ) ].name      = make_name( name );
     539        infos[ uint32( this_id ) ].parent_id = parent_id;
    543540        // This value is ignored by the create_transformed_keys, but needed by create_direct_keys!
    544541        // TODO: find a common solution!
  • trunk/src/formats/nmd_loader.cc

    r486 r487  
    6666{
    6767        if ( count == 0 ) return;
    68         source.seek( count * sizeof( nmd_attribute ), origin::CUR );
     68        source.seek( long( count * sizeof( nmd_attribute ) ), origin::CUR );
    6969}
    7070
     
    220220void nv::nmd_dump_bones( stream& stream_out, const data_node_list& nodes )
    221221{
    222         uint32 total = sizeof( nmd_animation_header );
    223         for ( auto node : nodes )
    224         {
    225                 total += sizeof( nmd_element_header );
    226         }
     222        uint32 total = sizeof( nmd_animation_header ) + sizeof( nmd_element_header ) * nodes.size();
    227223
    228224        nmd_element_header header;
  • trunk/src/gfx/image.cc

    r406 r487  
    2626        : m_size( size ), m_depth( depth ), m_data( nullptr )
    2727{
     28        NV_ASSERT( size.x >= 0 && size.y >= 0, "bad parameters passed to image!" );
    2829        sint32 bsize = m_size.x * m_size.y * static_cast<sint32>( m_depth );
    29         m_data = new uint8[ bsize ];
     30        m_data = new uint8[ size_t( bsize ) ];
    3031
    3132        if ( reversed )
  • trunk/src/gfx/mesh_creator.cc

    r482 r487  
    265265        delete[] tangents2;
    266266
    267         uint32 n_channel_index = m_data->get_channel_index( slot::NORMAL );
    268         data_channel_set_creator( m_data ).set_channel( n_channel_index, merge_channels( *m_nrm_channel, g_channel ) );
     267        int n_channel_index = m_data->get_channel_index( slot::NORMAL );
     268        NV_ASSERT( n_channel_index >= 0, "Normal channel not found!" );
     269        data_channel_set_creator( m_data ).set_channel( uint32( n_channel_index ), merge_channels( *m_nrm_channel, g_channel ) );
    269270        initialize();
    270271}
  • trunk/src/gfx/texture_font.cc

    r471 r487  
    8080static uint8* convert_to_rgba(uint8* rgb, const int lines, const int line_count, const int line_bpitch )
    8181{
    82         uint8* result = new uint8[ lines * line_count * 4 ];
     82        uint8* result = new uint8[ static_cast< uint32 >( lines * line_count * 4 ) ];
    8383        uint8* rgba   = result;
    8484        for(int l=0; l<lines; ++l)
  • trunk/src/gl/gl_context.cc

    r485 r487  
    216216                        glBindBufferBase( buffer_type_to_enum( info->type ), index, info->glid );
    217217                else
    218                         glBindBufferRange( buffer_type_to_enum( info->type ), index, info->glid, offset, size );
     218                        glBindBufferRange( buffer_type_to_enum( info->type ), index, info->glid, static_cast<GLintptr>( offset ), static_cast<GLsizeiptr>( size ) );
    219219        }
    220220}
     
    790790                else
    791791                {
    792                         glDrawArrays( primitive_to_enum(prim), first, static_cast<GLsizei>( count ) );
     792                        glDrawArrays( primitive_to_enum(prim), static_cast<GLint>( first ), static_cast<GLsizei>( count ) );
    793793                }
    794794                unbind( va );
  • trunk/src/gl/gl_device.cc

    r485 r487  
    358358        if ( info )
    359359        {
    360                 int result = glGetUniformBlockIndex( info->glid, name.data() );
    361                 if ( result >= 0 ) return result;
     360                GLuint result = glGetUniformBlockIndex( info->glid, name.data() );
     361                if ( result != GL_INVALID_INDEX ) return static_cast<int>( result );
    362362                if ( fatal )
    363363                {
     
    427427                if ( ubase->is_dirty() )
    428428                {
    429                         int uloc = ubase->get_location();
     429                        GLint   uloc = ubase->get_location();
     430                        GLsizei size = static_cast<GLsizei>( ubase->get_length() );
    430431                        switch( ubase->get_type() )
    431432                        {
    432                         case FLOAT          : glUniform1fv( uloc, ubase->get_length(), static_cast< uniform< enum_to_type< FLOAT >::type >*>( ubase )->get_value() ); break;
    433                         case INT            : glUniform1iv( uloc, ubase->get_length(), static_cast< uniform< enum_to_type< INT >::type >*>( ubase )->get_value() ); break;
    434                         case FLOAT_VECTOR_2 : glUniform2fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*>( ubase )->get_value())); break;
    435                         case FLOAT_VECTOR_3 : glUniform3fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*>( ubase )->get_value())); break;
    436                         case FLOAT_VECTOR_4 : glUniform4fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*>( ubase )->get_value())); break;
    437                         case INT_VECTOR_2   : glUniform2iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_2 >::type >*>( ubase )->get_value())); break;
    438                         case INT_VECTOR_3   : glUniform3iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_3 >::type >*>( ubase )->get_value())); break;
    439                         case INT_VECTOR_4   : glUniform4iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_4 >::type >*>( ubase )->get_value())); break;
    440                         case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*>( ubase )->get_value())); break;
    441                         case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*>( ubase )->get_value())); break;
    442                         case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*>( ubase )->get_value())); break;
     433                        case FLOAT          : glUniform1fv( uloc, size, static_cast< uniform< enum_to_type< FLOAT >::type >*>( ubase )->get_value() ); break;
     434                        case INT            : glUniform1iv( uloc, size, static_cast< uniform< enum_to_type< INT >::type >*>( ubase )->get_value() ); break;
     435                        case FLOAT_VECTOR_2 : glUniform2fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*>( ubase )->get_value())); break;
     436                        case FLOAT_VECTOR_3 : glUniform3fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*>( ubase )->get_value())); break;
     437                        case FLOAT_VECTOR_4 : glUniform4fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*>( ubase )->get_value())); break;
     438                        case INT_VECTOR_2   : glUniform2iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_2 >::type >*>( ubase )->get_value())); break;
     439                        case INT_VECTOR_3   : glUniform3iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_3 >::type >*>( ubase )->get_value())); break;
     440                        case INT_VECTOR_4   : glUniform4iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_4 >::type >*>( ubase )->get_value())); break;
     441                        case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*>( ubase )->get_value())); break;
     442                        case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*>( ubase )->get_value())); break;
     443                        case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*>( ubase )->get_value())); break;
    443444                        default : break; // error?
    444445                        }
     
    507508                }
    508509
    509                 uniform_base* u = uniform_base::create( utype, uni_loc, uni_len );
     510                uniform_base* u = uniform_base::create( utype, uni_loc, size_t( uni_len ) );
    510511                NV_ASSERT( u, "Unknown uniform type!" );
    511512                (*p->m_uniform_map)[ name ] = u;
  • trunk/src/gui/gui_ascii_renderer.cc

    r444 r487  
    1818        bool   clear;
    1919        bool   border;
    20         uchar8 border_chars[8];
     20        char  border_chars[8];
    2121        uint32 border_color;
    2222        uint32 text_color;
     
    6767                                er->border_color = uint32( border_color );
    6868                        for ( uint32 i = 0; i < 8 && i < path.length(); i++ )
    69                                 er->border_chars[i] = static_cast< uchar8 >( path[i] );
     69                                er->border_chars[i] = path[i];
    7070                }
    7171        }
     
    102102                for ( char c : e->m_text )
    103103                {
    104                         m_terminal->print( p, er->text_color, static_cast< unsigned char >( c ) );
     104                        m_terminal->print( p, er->text_color, c );
    105105                        ++p.x;
    106106                }
  • trunk/src/gui/gui_gfx_renderer.cc

    r472 r487  
    311311                }
    312312
    313                 e->m_text;
     313//              e->m_text;
    314314                if ( !e->m_text.empty() )
    315315                {
  • trunk/src/gui/gui_style.cc

    r448 r487  
    3333        if ( !resolve( e->m_id, e->m_class, cselector, centry, LUA_TTABLE ) ) return false;
    3434        vec = vec4();
    35         for ( int i = 0; i < 4; ++i )
     35        for ( size_t i = 0; i < 4; ++i )
    3636        {
    37                 lua_rawgeti( m_lua, -1, i+1 );
     37                lua_rawgeti( m_lua, -1, int(i+1) );
    3838                if ( lua_isnil( m_lua, -1 ) ) return true;
    3939                vec[i] = static_cast< float >( lua_tonumber( m_lua, -1 ) );
  • trunk/src/image/miniz.cc

    r486 r487  
    33
    44using namespace nv;
     5
     6#define MINIZ_NO_TIME
     7#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES
     8
     9#define MINIZ_HAS_64BIT_REGISTERS 0
     10#define TINFL_USE_64BIT_BITBUF 0
     11
     12#if NV_COMPILER == NV_CLANG
     13#pragma clang diagnostic ignored "-Wunused-macros"
     14#pragma clang diagnostic ignored "-Wold-style-cast"
     15#pragma clang diagnostic ignored "-Wsign-conversion"
     16#endif
    517
    618#if defined( _M_IX86 ) || defined( _M_X64 ) || defined( __i386__ ) || defined( __i386 ) || defined( __i486__ ) || defined( __i486 ) || defined( i386 ) || defined( __ia64__ ) || defined( __x86_64__ )
  • trunk/src/image/png_loader.cc

    r486 r487  
    1010
    1111using namespace nv;
     12
     13#if NV_COMPILER == NV_CLANG
     14#pragma clang diagnostic ignored "-Wunused-macros"
     15#pragma clang diagnostic ignored "-Wold-style-cast"
     16#pragma clang diagnostic ignored "-Wsign-conversion"
     17#pragma clang diagnostic ignored "-Wreserved-id-macro"
     18#pragma clang diagnostic ignored "-Wmissing-prototypes"
     19#define NULL 0
     20#endif
    1221
    1322enum
     
    322331};
    323332
     333static int iabs( int a )
     334{
     335        return a < 0 ? -a : a;
     336}
     337
    324338static int stbi__paeth( int a, int b, int c )
    325339{
    326340        int p = a + b - c;
    327         int pa = abs( p - a );
    328         int pb = abs( p - b );
    329         int pc = abs( p - c );
     341        int pa = iabs( p - a );
     342        int pb = iabs( p - b );
     343        int pc = iabs( p - c );
    330344        if ( pa <= pb && pa <= pc ) return a;
    331345        if ( pb <= pc ) return b;
     
    10501064                case 3: format.format = RGB; break;
    10511065                case 4: format.format = RGBA; break;
    1052                 default: return false;
     1066                default: return nullptr;
    10531067                }
    10541068                size = ivec2( x, y );
  • trunk/src/io/c_stream.cc

    r486 r487  
    5050{
    5151        NV_ASSERT( buffer != nullptr && max_count != 0, "Bad parameter passed to write!" );
    52         char* result = ::fgets( buffer, max_count, reinterpret_cast<FILE*>( m_file ) );
     52        char* result = ::fgets( buffer, static_cast<int>( max_count ), reinterpret_cast<FILE*>( m_file ) );
    5353        if ( !result ) return false;
    5454        return true;
  • trunk/src/lib/gl.cc

    r466 r487  
    161161        if ( wgl_library_loaded ) return true;
    162162
    163         HGLRC (NV_GL_APIENTRY *wgl_createcontext) (HDC)        = nullptr;
    164         BOOL  (NV_GL_APIENTRY *wgl_makecurrent)   (HDC, HGLRC) = nullptr;
    165         BOOL  (NV_GL_APIENTRY *wgl_deletecontext) (HGLRC)      = nullptr;
     163        HGLRC ( NV_GL_APIENTRY *wgl_createcontext) (HDC)        = nullptr;
     164        BOOL  ( NV_GL_APIENTRY *wgl_makecurrent)   (HDC, HGLRC) = nullptr;
     165        BOOL  ( NV_GL_APIENTRY *wgl_deletecontext) (HGLRC)      = nullptr;
    166166
    167167        void_assign( wgl_createcontext, gl_library.get("wglCreateContext") );
  • trunk/src/lua/lua_math.cc

    r471 r487  
    1111#include "nv/stl/type_traits/common.hh"
    1212
    13 static int nlua_swizzel_lookup[256];
     13static size_t nlua_swizzel_lookup[256];
    1414
    1515using nv::lua::detail::is_vec;
     
    1818using nv::lua::detail::push_vec;
    1919
    20 inline bool nlua_is_swizzel( const unsigned char* str, int max )
     20inline bool nlua_is_swizzel( const unsigned char* str, size_t max )
    2121{
    2222        while (*str)
     
    279279        {
    280280                switch (len) {
    281                 case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
    282                 case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
    283                 case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
     281                case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
     282                case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
     283                case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
    284284                default: break;
    285285                }
  • trunk/src/stl/assert.cc

    r440 r487  
    2828#       else // NV_COMPILER
    2929#       if NV_COMPILER == NV_CLANG
    30 extern "C" {
    31         extern void __assert(const char *, const char *, unsigned int, const char *) NV_NORETURN;
     30// extern "C" {
     31//      extern void __assert(const char *, const char *, unsigned int, const char *) NV_NORETURN;
     32// }
     33
     34int error_here;
     35static void __assert( const char *, const char *, unsigned int, const char * ) NV_NORETURN
     36{
     37        //no-op
    3238}
     39
    3340#define NV_ASSERT_IMPL __assert
    3441#       else
Note: See TracChangeset for help on using the changeset viewer.