diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 8cfd20119f..6cac37cf82 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1852,9 +1852,9 @@ void CLP(ShaderContext):: update_transform_table(const TransformTable *table) { LMatrix4f *matrices = (LMatrix4f *)alloca(_transform_table_size * 64); - int i = 0; + size_t i = 0; if (table != NULL) { - int num_transforms = min(_transform_table_size, table->get_num_transforms()); + size_t num_transforms = min((size_t)_transform_table_size, table->get_num_transforms()); for (; i < num_transforms; ++i) { #ifdef STDFLOAT_DOUBLE LMatrix4 matrix; @@ -1885,8 +1885,8 @@ update_slider_table(const SliderTable *table) { memset(sliders, 0, _slider_table_size * 4); if (table != NULL) { - int num_sliders = min(_slider_table_size, table->get_num_sliders()); - for (int i = 0; i < num_sliders; ++i) { + size_t num_sliders = min((size_t)_slider_table_size, table->get_num_sliders()); + for (size_t i = 0; i < num_sliders; ++i) { sliders[i] = table->get_slider(i)->get_slider(); } } diff --git a/panda/src/gobj/geomPrimitive.cxx b/panda/src/gobj/geomPrimitive.cxx index 02abb0c407..797ea9e1c8 100644 --- a/panda/src/gobj/geomPrimitive.cxx +++ b/panda/src/gobj/geomPrimitive.cxx @@ -1304,7 +1304,7 @@ set_vertices(const GeomVertexArrayData *vertices, int num_vertices) { // Validate the format and make sure to copy its numeric type. const GeomVertexArrayFormat *format = vertices->get_array_format(); nassertv(format->get_num_columns() == 1); - cdata->_index_type = format->get_column((size_t)0)->get_numeric_type(); + cdata->_index_type = format->get_column(0)->get_numeric_type(); cdata->_modified = Geom::get_next_modified(); cdata->_got_minmax = false; diff --git a/panda/src/gobj/geomVertexArrayFormat.I b/panda/src/gobj/geomVertexArrayFormat.I index 2ded24872c..10a5adf674 100644 --- a/panda/src/gobj/geomVertexArrayFormat.I +++ b/panda/src/gobj/geomVertexArrayFormat.I @@ -151,9 +151,9 @@ get_total_bytes() const { // Description: Returns the number of different columns in the // array. //////////////////////////////////////////////////////////////////// -INLINE size_t GeomVertexArrayFormat:: +INLINE int GeomVertexArrayFormat:: get_num_columns() const { - return _columns.size(); + return (int)_columns.size(); } //////////////////////////////////////////////////////////////////// @@ -162,10 +162,10 @@ get_num_columns() const { // Description: Returns the ith column of the array. //////////////////////////////////////////////////////////////////// INLINE const GeomVertexColumn *GeomVertexArrayFormat:: -get_column(size_t i) const { - nassertr(i < _columns.size(), NULL); +get_column(int i) const { + nassertr(i >= 0 && i < (int)_columns.size(), NULL); consider_sort_columns(); - return _columns[i]; + return _columns[(size_t)i]; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/gobj/geomVertexArrayFormat.h b/panda/src/gobj/geomVertexArrayFormat.h index f764b3c3c8..9e150d596b 100644 --- a/panda/src/gobj/geomVertexArrayFormat.h +++ b/panda/src/gobj/geomVertexArrayFormat.h @@ -102,8 +102,8 @@ PUBLISHED: void pack_columns(); void align_columns_for_animation(); - INLINE size_t get_num_columns() const; - INLINE const GeomVertexColumn *get_column(size_t i) const; + INLINE int get_num_columns() const; + INLINE const GeomVertexColumn *get_column(int i) const; MAKE_SEQ(get_columns, get_num_columns, get_column); const GeomVertexColumn *get_column(const InternalName *name) const; diff --git a/panda/src/gobj/geomVertexData.cxx b/panda/src/gobj/geomVertexData.cxx index 80aa43dbf4..d2202e1831 100644 --- a/panda/src/gobj/geomVertexData.cxx +++ b/panda/src/gobj/geomVertexData.cxx @@ -1675,7 +1675,7 @@ update_animated_vertices(GeomVertexData::CData *cdata, Thread *current_thread) { CPT(GeomVertexArrayFormat) blend_array_format = orig_format->get_array(blend_array_index); if (blend_array_format->get_stride() == 2 && - blend_array_format->get_column((size_t)0)->get_component_bytes() == 2) { + blend_array_format->get_column(0)->get_component_bytes() == 2) { // The blend indices are a table of ushorts. Optimize this // common case. CPT(GeomVertexArrayDataHandle) blend_array_handle = cdata->_arrays[blend_array_index].get_read_pointer()->get_handle(current_thread);