Changeset 111


Ignore:
Timestamp:
06/09/13 15:21:23 (12 years ago)
Author:
epyon
Message:
  • LLVM C++ fixes part 1. LLVM ROCKS.
Location:
trunk/nv
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/common.hh

    r90 r111  
    193193        if (p == 0)
    194194        {
    195                 NV_THROW( std::bad_cast, "dynamic_cast returned NULL" );
     195                NV_THROW( std::bad_cast );
    196196        }
    197197
  • trunk/nv/interface/clear_state.hh

    r31 r111  
    2727                bool alpha;
    2828
    29                 color_mask() : red( true ), blue( true ), green( true ), alpha( true ) {}
     29                color_mask() : red( true ), green( true ), blue( true ), alpha( true ) {}
    3030                color_mask( bool red, bool green, bool blue, bool alpha )
    3131                        : red( red ), green( green ), blue( blue ), alpha( alpha ) {}
  • trunk/nv/interface/mesh.hh

    r101 r111  
    107107                vertex_attribute<T>* get_indices()
    108108                {
    109                         return m_indices->get_type() == type_to_enum<T>() ? ((vertex_attribute<T>*)(m_indices)); : nullptr;
     109                        return m_indices->get_type() == type_to_enum<T>() ? ((vertex_attribute<T>*)(m_indices)) : nullptr;
    110110                }
    111111
  • trunk/nv/interface/program.hh

    r73 r111  
    6161        {
    6262        public:
    63                 typename T value_type;
     63                typedef T value_type;
    6464
    6565                uniform( const string& name, int location, int length )
    66                         : uniform_base( name, type_to_enum< typename T >::type, location, length ), m_value()
     66                        : uniform_base( name, type_to_enum< T >::type, location, length ), m_value()
    6767                {}
    6868
  • trunk/nv/interface/vertex_buffer.hh

    r101 r111  
    3939                int get_size() const { return m_size; };
    4040                buffer_hint get_hint() const { return m_hint; };
     41        virtual ~buffer() {}
    4142        protected:
    4243                int         m_size;
  • trunk/nv/interface/window.hh

    r98 r111  
    3333                virtual void swap_buffers() = 0;
    3434                virtual device* get_device() = 0;
    35                 virtual ~window() = 0 {};
     35                virtual ~window() {};
    3636        };
    3737
  • trunk/nv/types.hh

    r94 r111  
    162162        };
    163163
     164        template <typename TYPE> void ConstructObject(void* object)
     165        {
     166                // Use placement new to call the constructor
     167                new (object) TYPE;
     168        }
     169        template <typename TYPE> void DestructObject(void* object)
     170        {
     171                // Explicit call of the destructor
     172                ((TYPE*)object)->TYPE::~TYPE();
     173        }
     174   
    164175        struct type_entry;
    165176
     
    256267                std::vector<type_enum> enum_list;
    257268
    258                 template <int TYPE>
    259                 type_entry& base()
    260                 {
    261                         base_type = type_db->get_type( typeid(TYPE) );
    262                 }
     269                template <typename TYPE>
     270                type_entry& base();
    263271
    264272                template <int SIZE>
    265                 type_entry& fields( type_field (&init_fields)[SIZE] )
    266                 {
    267                         for (int i = 0; i < SIZE; i++)
    268                         {
    269                                 type_field f = init_fields[i];
    270                                 f.type = type_db->get_type(*(f.type_inf));
    271                                 f.type_name = f.type->name;
    272                                 field_list.push_back(f);
    273                         }
    274                         return *this;
    275                 }
     273                type_entry& fields( type_field (&init_fields)[SIZE] );
    276274
    277275                template <int SIZE>
     
    342340                type_info_map m_idx_types;
    343341        };
    344 
    345         template <typename TYPE> void ConstructObject(void* object)
    346         {
    347                 // Use placement new to call the constructor
    348                 new (object) TYPE;
    349         }
    350         template <typename TYPE> void DestructObject(void* object)
    351         {
    352                 // Explicit call of the destructor
    353                 ((TYPE*)object)->TYPE::~TYPE();
    354         }
     342   
     343    template < typename TYPE >
     344    type_entry& type_entry::base()
     345    {
     346        base_type = type_db->get_type( typeid(TYPE) );
     347    }
     348   
     349    template <int SIZE>
     350    type_entry& type_entry::fields( type_field (&init_fields)[SIZE] )
     351    {
     352        for (int i = 0; i < SIZE; i++)
     353        {
     354            type_field f = init_fields[i];
     355            f.type = type_db->get_type(*(f.type_inf));
     356            f.type_name = f.type->name;
     357            field_list.push_back(f);
     358        }
     359        return *this;
     360    }
    355361
    356362}
Note: See TracChangeset for help on using the changeset viewer.