Browse Source

Replace many int params with size_t params where appropriate, and work towards fixing type conversion warnings

rdb 10 years ago
parent
commit
18ad6d1543
100 changed files with 530 additions and 536 deletions
  1. 2 2
      dtool/src/dtoolbase/indent.I
  2. 1 1
      dtool/src/dtoolbase/typeHandle.cxx
  3. 2 2
      dtool/src/dtoolbase/typeHandle.h
  4. 6 6
      dtool/src/dtoolbase/typeRegistry.cxx
  5. 1 1
      dtool/src/dtoolbase/typeRegistryNode.cxx
  6. 2 2
      dtool/src/dtoolutil/dSearchPath.I
  7. 8 10
      dtool/src/dtoolutil/dSearchPath.cxx
  8. 7 7
      dtool/src/dtoolutil/dSearchPath.h
  9. 2 2
      dtool/src/dtoolutil/executionEnvironment.I
  10. 5 5
      dtool/src/dtoolutil/executionEnvironment.cxx
  11. 4 4
      dtool/src/dtoolutil/executionEnvironment.h
  12. 2 2
      dtool/src/dtoolutil/filename.I
  13. 9 9
      dtool/src/dtoolutil/filename.cxx
  14. 1 1
      dtool/src/dtoolutil/filename.h
  15. 1 1
      dtool/src/dtoolutil/lineStreamBuf.I
  16. 2 2
      dtool/src/dtoolutil/lineStreamBuf.cxx
  17. 1 1
      dtool/src/dtoolutil/lineStreamBuf.h
  18. 3 3
      dtool/src/dtoolutil/pandaSystem.cxx
  19. 2 2
      dtool/src/dtoolutil/pandaSystem.h
  20. 7 7
      dtool/src/dtoolutil/textEncoder.I
  21. 5 5
      dtool/src/dtoolutil/textEncoder.h
  22. 2 2
      dtool/src/dtoolutil/unicodeLatinMap.cxx
  23. 13 13
      dtool/src/interrogate/interfaceMakerPythonNative.cxx
  24. 12 12
      dtool/src/prc/configDeclaration.I
  25. 12 12
      dtool/src/prc/configDeclaration.cxx
  26. 24 24
      dtool/src/prc/configDeclaration.h
  27. 11 11
      dtool/src/prc/configPage.cxx
  28. 6 6
      dtool/src/prc/configPage.h
  29. 15 15
      dtool/src/prc/configPageManager.I
  30. 10 10
      dtool/src/prc/configPageManager.h
  31. 16 16
      dtool/src/prc/configVariable.I
  32. 16 16
      dtool/src/prc/configVariable.h
  33. 4 4
      dtool/src/prc/configVariableBool.I
  34. 4 4
      dtool/src/prc/configVariableBool.h
  35. 10 10
      dtool/src/prc/configVariableCore.I
  36. 3 3
      dtool/src/prc/configVariableCore.cxx
  37. 8 8
      dtool/src/prc/configVariableCore.h
  38. 4 4
      dtool/src/prc/configVariableDouble.I
  39. 4 4
      dtool/src/prc/configVariableDouble.h
  40. 4 4
      dtool/src/prc/configVariableEnum.I
  41. 4 4
      dtool/src/prc/configVariableEnum.h
  42. 3 3
      dtool/src/prc/configVariableFilename.I
  43. 3 3
      dtool/src/prc/configVariableFilename.h
  44. 4 4
      dtool/src/prc/configVariableInt.I
  45. 4 4
      dtool/src/prc/configVariableInt.h
  46. 10 10
      dtool/src/prc/configVariableInt64.I
  47. 8 8
      dtool/src/prc/configVariableInt64.h
  48. 6 6
      dtool/src/prc/configVariableList.I
  49. 4 4
      dtool/src/prc/configVariableList.cxx
  50. 6 6
      dtool/src/prc/configVariableList.h
  51. 3 3
      dtool/src/prc/configVariableManager.I
  52. 14 14
      dtool/src/prc/configVariableManager.cxx
  53. 4 4
      dtool/src/prc/configVariableManager.h
  54. 3 3
      dtool/src/prc/configVariableSearchPath.I
  55. 2 2
      dtool/src/prc/configVariableSearchPath.cxx
  56. 4 4
      dtool/src/prc/configVariableSearchPath.h
  57. 4 4
      dtool/src/prc/configVariableString.I
  58. 3 3
      dtool/src/prc/configVariableString.h
  59. 7 7
      dtool/src/prc/encryptStreamBuf.cxx
  60. 1 1
      dtool/src/prc/notify.cxx
  61. 3 3
      dtool/src/prc/notifyCategory.cxx
  62. 3 2
      dtool/src/prc/notifyCategory.h
  63. 11 11
      dtool/src/prc/prcKeyRegistry.cxx
  64. 5 10
      dtool/src/prc/prcKeyRegistry.h
  65. 2 2
      dtool/src/prc/streamReader.cxx
  66. 2 2
      dtool/src/prc/streamWriter.I
  67. 5 5
      dtool/src/prckeys/makePrcKey.cxx
  68. 1 1
      panda/src/display/windowProperties.h
  69. 2 2
      panda/src/express/datagram.cxx
  70. 2 2
      panda/src/express/datagramIterator.I
  71. 4 4
      panda/src/express/datagramIterator.cxx
  72. 1 1
      panda/src/express/datagramIterator.h
  73. 2 2
      panda/src/express/hashVal.cxx
  74. 11 11
      panda/src/express/memoryUsagePointers.cxx
  75. 7 7
      panda/src/express/memoryUsagePointers.h
  76. 1 1
      panda/src/express/memoryUsagePointers_ext.cxx
  77. 1 1
      panda/src/express/memoryUsagePointers_ext.h
  78. 1 1
      panda/src/express/multifile.cxx
  79. 1 1
      panda/src/express/nodeReferenceCount.I
  80. 1 1
      panda/src/express/referenceCount.I
  81. 6 6
      panda/src/express/virtualFileList.I
  82. 4 4
      panda/src/express/virtualFileList.h
  83. 1 1
      panda/src/gobj/adaptiveLru.h
  84. 1 1
      panda/src/gobj/geomPrimitive.cxx
  85. 2 2
      panda/src/gobj/geomVertexArrayData.I
  86. 2 2
      panda/src/gobj/geomVertexArrayData.h
  87. 4 4
      panda/src/gobj/geomVertexArrayFormat.I
  88. 2 2
      panda/src/gobj/geomVertexArrayFormat.h
  89. 1 1
      panda/src/gobj/geomVertexData.cxx
  90. 19 19
      panda/src/gobj/geomVertexFormat.I
  91. 19 19
      panda/src/gobj/geomVertexFormat.cxx
  92. 20 20
      panda/src/gobj/geomVertexFormat.h
  93. 2 2
      panda/src/gobj/lens.I
  94. 5 5
      panda/src/gobj/sliderTable.I
  95. 9 9
      panda/src/gobj/sliderTable.cxx
  96. 7 7
      panda/src/gobj/sliderTable.h
  97. 1 1
      panda/src/gobj/texture.I
  98. 1 1
      panda/src/gobj/texture.cxx
  99. 1 1
      panda/src/gobj/texture.h
  100. 9 9
      panda/src/gobj/transformBlend.I

+ 2 - 2
dtool/src/dtoolbase/indent.I

@@ -39,7 +39,7 @@ write_long_list(ostream &out, int indent_level,
     string str = item.str();
     string str = item.str();
 
 
     indent(out, indent_level) << first_prefix << str;
     indent(out, indent_level) << first_prefix << str;
-    int col = indent_level + first_prefix.length() + str.length();
+    int col = indent_level + (int)(first_prefix.length() + str.length());
 
 
     ++first;
     ++first;
 
 
@@ -52,7 +52,7 @@ write_long_list(ostream &out, int indent_level,
       if (col > max_col) {
       if (col > max_col) {
         out << "\n";
         out << "\n";
         indent(out, indent_level) << later_prefix << str;
         indent(out, indent_level) << later_prefix << str;
-        col = indent_level + later_prefix.length() + str.length();
+        col = indent_level + (int)(later_prefix.length() + str.length());
 
 
       } else {
       } else {
         out << " " << str;
         out << " " << str;

+ 1 - 1
dtool/src/dtoolbase/typeHandle.cxx

@@ -28,7 +28,7 @@ TypeHandle TypeHandle::_none;
 //               only updated if track-memory-usage is set true in
 //               only updated if track-memory-usage is set true in
 //               your Config.prc file.
 //               your Config.prc file.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int TypeHandle::
+size_t TypeHandle::
 get_memory_usage(MemoryClass memory_class) const {
 get_memory_usage(MemoryClass memory_class) const {
   assert((int)memory_class >= 0 && (int)memory_class < (int)MC_limit);
   assert((int)memory_class >= 0 && (int)memory_class < (int)MC_limit);
   if ((*this) == TypeHandle::none()) {
   if ((*this) == TypeHandle::none()) {

+ 2 - 2
dtool/src/dtoolbase/typeHandle.h

@@ -126,11 +126,11 @@ PUBLISHED:
   int get_best_parent_from_Set(const std::set< int > &legal_vals) const;
   int get_best_parent_from_Set(const std::set< int > &legal_vals) const;
 
 
 #ifdef DO_MEMORY_USAGE
 #ifdef DO_MEMORY_USAGE
-  int get_memory_usage(MemoryClass memory_class) const;
+  size_t get_memory_usage(MemoryClass memory_class) const;
   void inc_memory_usage(MemoryClass memory_class, size_t size);
   void inc_memory_usage(MemoryClass memory_class, size_t size);
   void dec_memory_usage(MemoryClass memory_class, size_t size);
   void dec_memory_usage(MemoryClass memory_class, size_t size);
 #else
 #else
-  static CONSTEXPR int get_memory_usage(MemoryClass) { return 0; }
+  static CONSTEXPR size_t get_memory_usage(MemoryClass) { return 0; }
   INLINE void inc_memory_usage(MemoryClass, size_t) { }
   INLINE void inc_memory_usage(MemoryClass, size_t) { }
   INLINE void dec_memory_usage(MemoryClass, size_t) { }
   INLINE void dec_memory_usage(MemoryClass, size_t) { }
 #endif  // DO_MEMORY_USAGE
 #endif  // DO_MEMORY_USAGE

+ 6 - 6
dtool/src/dtoolbase/typeRegistry.cxx

@@ -59,7 +59,7 @@ register_type(TypeHandle &type_handle, const string &name) {
     // class has been defined.
     // class has been defined.
 
 
     TypeHandle new_handle;
     TypeHandle new_handle;
-    new_handle._index = _handle_registry.size();
+    new_handle._index = (int)_handle_registry.size();
 
 
     TypeRegistryNode *rnode = new TypeRegistryNode(new_handle, name, type_handle);
     TypeRegistryNode *rnode = new TypeRegistryNode(new_handle, name, type_handle);
     _handle_registry.push_back(rnode);
     _handle_registry.push_back(rnode);
@@ -73,7 +73,7 @@ register_type(TypeHandle &type_handle, const string &name) {
   TypeRegistryNode *rnode = (*ri).second;
   TypeRegistryNode *rnode = (*ri).second;
   assert(rnode->_name == (*ri).first);
   assert(rnode->_name == (*ri).first);
   assert(rnode->_handle._index >= 0 &&
   assert(rnode->_handle._index >= 0 &&
-           rnode->_handle._index < (int)_handle_registry.size());
+         rnode->_handle._index < (int)_handle_registry.size());
   assert(_handle_registry[rnode->_handle._index] == rnode);
   assert(_handle_registry[rnode->_handle._index] == rnode);
   assert(rnode->_handle._index != 0);
   assert(rnode->_handle._index != 0);
 
 
@@ -137,7 +137,7 @@ register_dynamic_type(const string &name) {
     // has something unique to point to.  This doesn't really mean
     // has something unique to point to.  This doesn't really mean
     // anything, though.
     // anything, though.
     TypeHandle *new_handle = new TypeHandle;
     TypeHandle *new_handle = new TypeHandle;
-    new_handle->_index = _handle_registry.size();
+    new_handle->_index = (int)_handle_registry.size();
 
 
     TypeRegistryNode *rnode = new TypeRegistryNode(*new_handle, name, *new_handle);
     TypeRegistryNode *rnode = new TypeRegistryNode(*new_handle, name, *new_handle);
     _handle_registry.push_back(rnode);
     _handle_registry.push_back(rnode);
@@ -365,7 +365,7 @@ int TypeRegistry::
 get_num_root_classes() {
 get_num_root_classes() {
   _lock->acquire();
   _lock->acquire();
   freshen_derivations();
   freshen_derivations();
-  int num_roots = _root_classes.size();
+  int num_roots = (int)_root_classes.size();
   _lock->release();
   _lock->release();
   return num_roots;
   return num_roots;
 }
 }
@@ -410,7 +410,7 @@ get_num_parent_classes(TypeHandle child, TypedObject *child_object) const {
   _lock->acquire();
   _lock->acquire();
   TypeRegistryNode *rnode = look_up(child, child_object);
   TypeRegistryNode *rnode = look_up(child, child_object);
   assert(rnode != (TypeRegistryNode *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
-  int num_parents = rnode->_parent_classes.size();
+  int num_parents = (int)rnode->_parent_classes.size();
   _lock->release();
   _lock->release();
   return num_parents;
   return num_parents;
 }
 }
@@ -452,7 +452,7 @@ get_num_child_classes(TypeHandle child, TypedObject *child_object) const {
   _lock->acquire();
   _lock->acquire();
   TypeRegistryNode *rnode = look_up(child, child_object);
   TypeRegistryNode *rnode = look_up(child, child_object);
   assert(rnode != (TypeRegistryNode *)NULL);
   assert(rnode != (TypeRegistryNode *)NULL);
-  int num_children = rnode->_child_classes.size();
+  int num_children = (int)rnode->_child_classes.size();
   _lock->release();
   _lock->release();
   return num_children;
   return num_children;
 }
 }

+ 1 - 1
dtool/src/dtoolbase/typeRegistryNode.cxx

@@ -294,7 +294,7 @@ r_build_subtrees(TypeRegistryNode *top, int bit_count,
 
 
     // Now, how many more bits do we need to encode each of our
     // Now, how many more bits do we need to encode each of our
     // children?
     // children?
-    int num_children = _child_classes.size();
+    int num_children = (int)_child_classes.size();
     int more_bits = 0;
     int more_bits = 0;
     int i = num_children - 1;
     int i = num_children - 1;
     while (i > 0) {
     while (i > 0) {

+ 2 - 2
dtool/src/dtoolutil/dSearchPath.I

@@ -21,7 +21,7 @@
 //               list in Python.
 //               list in Python.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE Filename DSearchPath::Results::
 INLINE Filename DSearchPath::Results::
-operator [] (int n) const {
+operator [] (size_t n) const {
   return get_file(n);
   return get_file(n);
 }
 }
 
 
@@ -32,7 +32,7 @@ operator [] (int n) const {
 //               is defined to make the Results object appear to be a
 //               is defined to make the Results object appear to be a
 //               list in Python.
 //               list in Python.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int DSearchPath::Results::
+INLINE size_t DSearchPath::Results::
 size() const {
 size() const {
   return get_num_files();
   return get_num_files();
 }
 }

+ 8 - 10
dtool/src/dtoolutil/dSearchPath.cxx

@@ -72,7 +72,7 @@ clear() {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of files on the result list.
 //  Description: Returns the number of files on the result list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int DSearchPath::Results::
+size_t DSearchPath::Results::
 get_num_files() const {
 get_num_files() const {
   return _files.size();
   return _files.size();
 }
 }
@@ -83,8 +83,8 @@ get_num_files() const {
 //  Description: Returns the nth file on the result list.
 //  Description: Returns the nth file on the result list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 const Filename &DSearchPath::Results::
 const Filename &DSearchPath::Results::
-get_file(int n) const {
-  assert(n >= 0 && n < (int)_files.size());
+get_file(size_t n) const {
+  assert(n < _files.size());
   return _files[n];
   return _files[n];
 }
 }
 
 
@@ -299,7 +299,7 @@ is_empty() const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of directories on the search list.
 //  Description: Returns the number of directories on the search list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int DSearchPath::
+size_t DSearchPath::
 get_num_directories() const {
 get_num_directories() const {
   return _directories.size();
   return _directories.size();
 }
 }
@@ -310,8 +310,8 @@ get_num_directories() const {
 //  Description: Returns the nth directory on the search list.
 //  Description: Returns the nth directory on the search list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 const Filename &DSearchPath::
 const Filename &DSearchPath::
-get_directory(int n) const {
-  assert(n >= 0 && n < (int)_directories.size());
+get_directory(size_t n) const {
+  assert(n < _directories.size());
   return _directories[n];
   return _directories[n];
 }
 }
 
 
@@ -368,10 +368,10 @@ find_file(const Filename &filename) const {
 //               the results list first; otherwise, the newly-found
 //               the results list first; otherwise, the newly-found
 //               files will be appended to the list.
 //               files will be appended to the list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int DSearchPath::
+size_t DSearchPath::
 find_all_files(const Filename &filename,
 find_all_files(const Filename &filename,
                DSearchPath::Results &results) const {
                DSearchPath::Results &results) const {
-  int num_added = 0;
+  size_t num_added = 0;
 
 
   if (filename.is_local()) {
   if (filename.is_local()) {
     if (_directories.empty()) {
     if (_directories.empty()) {
@@ -446,5 +446,3 @@ write(ostream &out, int indent_level) const {
     out << (*di) << "\n";
     out << (*di) << "\n";
   }
   }
 }
 }
-
-

+ 7 - 7
dtool/src/dtoolutil/dSearchPath.h

@@ -39,11 +39,11 @@ PUBLISHED:
     ~Results();
     ~Results();
 
 
     void clear();
     void clear();
-    int get_num_files() const;
-    const Filename &get_file(int n) const;
+    size_t get_num_files() const;
+    const Filename &get_file(size_t n) const;
 
 
-    INLINE Filename operator [] (int n) const;
-    INLINE int size() const;
+    INLINE Filename operator [] (size_t n) const;
+    INLINE size_t size() const;
 
 
     void output(ostream &out) const;
     void output(ostream &out) const;
     void write(ostream &out, int indent_level = 0) const;
     void write(ostream &out, int indent_level = 0) const;
@@ -72,12 +72,12 @@ PUBLISHED:
   void prepend_path(const DSearchPath &path);
   void prepend_path(const DSearchPath &path);
 
 
   bool is_empty() const;
   bool is_empty() const;
-  int get_num_directories() const;
-  const Filename &get_directory(int n) const;
+  size_t get_num_directories() const;
+  const Filename &get_directory(size_t n) const;
   MAKE_SEQ(get_directories, get_num_directories, get_directory);
   MAKE_SEQ(get_directories, get_num_directories, get_directory);
 
 
   Filename find_file(const Filename &filename) const;
   Filename find_file(const Filename &filename) const;
-  int find_all_files(const Filename &filename, Results &results) const;
+  size_t find_all_files(const Filename &filename, Results &results) const;
   INLINE Results find_all_files(const Filename &filename) const;
   INLINE Results find_all_files(const Filename &filename) const;
 
 
   INLINE static Filename
   INLINE static Filename

+ 2 - 2
dtool/src/dtoolutil/executionEnvironment.I

@@ -80,7 +80,7 @@ clear_shadow(const string &var) {
 //  Description: Returns the number of command-line arguments
 //  Description: Returns the number of command-line arguments
 //               available, not counting arg 0, the binary name.
 //               available, not counting arg 0, the binary name.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ExecutionEnvironment::
+INLINE size_t ExecutionEnvironment::
 get_num_args() {
 get_num_args() {
   return get_ptr()->ns_get_num_args();
   return get_ptr()->ns_get_num_args();
 }
 }
@@ -94,7 +94,7 @@ get_num_args() {
 //               parameter, not the binary name.
 //               parameter, not the binary name.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ExecutionEnvironment::
 INLINE string ExecutionEnvironment::
-get_arg(int n) {
+get_arg(size_t n) {
   return get_ptr()->ns_get_arg(n);
   return get_ptr()->ns_get_arg(n);
 }
 }
 
 

+ 5 - 5
dtool/src/dtoolutil/executionEnvironment.cxx

@@ -420,7 +420,7 @@ ns_clear_shadow(const string &var) {
 //               available, not counting arg 0, the binary name.  The
 //               available, not counting arg 0, the binary name.  The
 //               nonstatic implementation.
 //               nonstatic implementation.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int ExecutionEnvironment::
+size_t ExecutionEnvironment::
 ns_get_num_args() const {
 ns_get_num_args() const {
   return _args.size();
   return _args.size();
 }
 }
@@ -435,8 +435,8 @@ ns_get_num_args() const {
 //               implementation.
 //               implementation.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 string ExecutionEnvironment::
 string ExecutionEnvironment::
-ns_get_arg(int n) const {
-  assert(n >= 0 && n < ns_get_num_args());
+ns_get_arg(size_t n) const {
+  assert(n < ns_get_num_args());
   return _args[n];
   return _args[n];
 }
 }
 
 
@@ -719,9 +719,9 @@ read_args() {
   if (_binary_name.empty()) {
   if (_binary_name.empty()) {
     char readlinkbuf [PATH_MAX];
     char readlinkbuf [PATH_MAX];
 #ifdef HAVE_PROC_CURPROC_FILE
 #ifdef HAVE_PROC_CURPROC_FILE
-    int pathlen = readlink("/proc/curproc/file", readlinkbuf, PATH_MAX - 1);
+    ssize_t pathlen = readlink("/proc/curproc/file", readlinkbuf, PATH_MAX - 1);
 #else
 #else
-    int pathlen = readlink("/proc/self/exe", readlinkbuf, PATH_MAX - 1);
+    ssize_t pathlen = readlink("/proc/self/exe", readlinkbuf, PATH_MAX - 1);
 #endif
 #endif
     if (pathlen > 0) {
     if (pathlen > 0) {
       readlinkbuf[pathlen] = 0;
       readlinkbuf[pathlen] = 0;

+ 4 - 4
dtool/src/dtoolutil/executionEnvironment.h

@@ -44,8 +44,8 @@ PUBLISHED:
 
 
   static string expand_string(const string &str);
   static string expand_string(const string &str);
 
 
-  INLINE static int get_num_args();
-  INLINE static string get_arg(int n);
+  INLINE static size_t get_num_args();
+  INLINE static string get_arg(size_t n);
 
 
   INLINE static string get_binary_name();
   INLINE static string get_binary_name();
   INLINE static string get_dtool_name();
   INLINE static string get_dtool_name();
@@ -62,8 +62,8 @@ private:
   void ns_shadow_environment_variable(const string &var, const string &value);
   void ns_shadow_environment_variable(const string &var, const string &value);
   void ns_clear_shadow(const string &var);
   void ns_clear_shadow(const string &var);
 
 
-  int ns_get_num_args() const;
-  string ns_get_arg(int n) const;
+  size_t ns_get_num_args() const;
+  string ns_get_arg(size_t n) const;
 
 
   string ns_get_binary_name() const;
   string ns_get_binary_name() const;
   string ns_get_dtool_name() const;
   string ns_get_dtool_name() const;

+ 2 - 2
dtool/src/dtoolutil/filename.I

@@ -332,8 +332,8 @@ length() const {
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE char Filename::
 INLINE char Filename::
-operator [] (int n) const {
-  assert(n >= 0 && n < (int)_filename.length());
+operator [] (size_t n) const {
+  assert(n < _filename.length());
   return _filename[n];
   return _filename[n];
 }
 }
 
 

+ 9 - 9
dtool/src/dtoolutil/filename.cxx

@@ -728,7 +728,7 @@ set_dirname(const string &s) {
     // Remove the directory prefix altogether.
     // Remove the directory prefix altogether.
     _filename.replace(0, _basename_start, "");
     _filename.replace(0, _basename_start, "");
 
 
-    int length_change = - ((int)_basename_start);
+    ssize_t length_change = - ((ssize_t)_basename_start);
 
 
     _dirname_end = 0;
     _dirname_end = 0;
     _basename_start += length_change;
     _basename_start += length_change;
@@ -746,7 +746,7 @@ set_dirname(const string &s) {
       ss = s+'/';
       ss = s+'/';
     }
     }
 
 
-    int length_change = ss.length() - _basename_start;
+    ssize_t length_change = ss.length() - _basename_start;
 
 
     _filename.replace(0, _basename_start, ss);
     _filename.replace(0, _basename_start, ss);
 
 
@@ -791,7 +791,7 @@ set_basename(const string &s) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void Filename::
 void Filename::
 set_fullpath_wo_extension(const string &s) {
 set_fullpath_wo_extension(const string &s) {
-  int length_change = s.length() - _basename_end;
+  ssize_t length_change = s.length() - _basename_end;
 
 
   _filename.replace(0, _basename_end, s);
   _filename.replace(0, _basename_end, s);
 
 
@@ -811,7 +811,7 @@ set_fullpath_wo_extension(const string &s) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void Filename::
 void Filename::
 set_basename_wo_extension(const string &s) {
 set_basename_wo_extension(const string &s) {
-  int length_change = s.length() - (_basename_end - _basename_start);
+  ssize_t length_change = s.length() - (_basename_end - _basename_start);
 
 
   if (_basename_end == string::npos) {
   if (_basename_end == string::npos) {
     _filename.replace(_basename_start, string::npos, s);
     _filename.replace(_basename_start, string::npos, s);
@@ -875,8 +875,8 @@ get_filename_index(int index) const {
 
 
   if (_hash_end != _hash_start) {
   if (_hash_end != _hash_start) {
     ostringstream strm;
     ostringstream strm;
-    strm << _filename.substr(0, _hash_start) 
-         << setw(_hash_end - _hash_start) << setfill('0') << index
+    strm << _filename.substr(0, _hash_start)
+         << setw((int)(_hash_end - _hash_start)) << setfill('0') << index
          << _filename.substr(_hash_end);
          << _filename.substr(_hash_end);
     file.set_fullpath(strm.str());
     file.set_fullpath(strm.str());
   }
   }
@@ -1822,12 +1822,12 @@ find_on_searchpath(const DSearchPath &searchpath) {
     return -1;
     return -1;
   }
   }
 
 
-  int num_directories = searchpath.get_num_directories();
-  for (int i = 0; i < num_directories; i++) {
+  size_t num_directories = searchpath.get_num_directories();
+  for (size_t i = 0; i < num_directories; ++i) {
     Filename directory = searchpath.get_directory(i);
     Filename directory = searchpath.get_directory(i);
     directory.make_absolute();
     directory.make_absolute();
     if (make_relative_to(directory, false)) {
     if (make_relative_to(directory, false)) {
-      return i;
+      return (int)i;
     }
     }
   }
   }
 
 

+ 1 - 1
dtool/src/dtoolutil/filename.h

@@ -121,7 +121,7 @@ PUBLISHED:
   INLINE const char *c_str() const;
   INLINE const char *c_str() const;
   INLINE bool empty() const;
   INLINE bool empty() const;
   INLINE size_t length() const;
   INLINE size_t length() const;
-  INLINE char operator [] (int n) const;
+  INLINE char operator [] (size_t n) const;
 
 
   EXTENSION(PyObject *__repr__() const);
   EXTENSION(PyObject *__repr__() const);
 
 

+ 1 - 1
dtool/src/dtoolutil/lineStreamBuf.I

@@ -41,7 +41,7 @@ has_newline() const {
 //               into the memory buffer.
 //               into the memory buffer.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void LineStreamBuf::
 INLINE void LineStreamBuf::
-write_chars(const char *start, int length) {
+write_chars(const char *start, size_t length) {
   if (length > 0) {
   if (length > 0) {
     _data += string(start, length);
     _data += string(start, length);
   }
   }

+ 2 - 2
dtool/src/dtoolutil/lineStreamBuf.cxx

@@ -84,7 +84,7 @@ int LineStreamBuf::
 sync() {
 sync() {
   streamsize n = pptr() - pbase();
   streamsize n = pptr() - pbase();
   write_chars(pbase(), n);
   write_chars(pbase(), n);
-  pbump(-n);  // Reset pptr().
+  pbump(-(int)n);  // Reset pptr().
   return 0;  // EOF to indicate write full.
   return 0;  // EOF to indicate write full.
 }
 }
 
 
@@ -104,7 +104,7 @@ overflow(int ch) {
 
 
   if (ch != EOF) {
   if (ch != EOF) {
     // Write one more character.
     // Write one more character.
-    char c = ch;
+    char c = (char)ch;
     write_chars(&c, 1);
     write_chars(&c, 1);
   }
   }
 
 

+ 1 - 1
dtool/src/dtoolutil/lineStreamBuf.h

@@ -40,7 +40,7 @@ protected:
   virtual int sync();
   virtual int sync();
 
 
 private:
 private:
-  INLINE void write_chars(const char *start, int length);
+  INLINE void write_chars(const char *start, size_t length);
 
 
   string _data;
   string _data;
   bool _has_newline;
   bool _has_newline;

+ 3 - 3
dtool/src/dtoolutil/pandaSystem.cxx

@@ -349,7 +349,7 @@ has_system(const string &system) const {
 //               get_system() to iterate through the entire list of
 //               get_system() to iterate through the entire list of
 //               available Panda subsystems.
 //               available Panda subsystems.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int PandaSystem::
+size_t PandaSystem::
 get_num_systems() const {
 get_num_systems() const {
   return _systems.size();
   return _systems.size();
 }
 }
@@ -362,8 +362,8 @@ get_num_systems() const {
 //               order.
 //               order.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 string PandaSystem::
 string PandaSystem::
-get_system(int n) const {
-  if (n < 0 || n >= (int)_systems.size()) {
+get_system(size_t n) const {
+  if (n >= _systems.size()) {
     return string();
     return string();
   }
   }
 
 

+ 2 - 2
dtool/src/dtoolutil/pandaSystem.h

@@ -50,8 +50,8 @@ PUBLISHED:
   static string get_platform();
   static string get_platform();
 
 
   bool has_system(const string &system) const;
   bool has_system(const string &system) const;
-  int get_num_systems() const;
-  string get_system(int n) const;
+  size_t get_num_systems() const;
+  string get_system(size_t n) const;
   MAKE_SEQ(get_systems, get_num_systems, get_system);
   MAKE_SEQ(get_systems, get_num_systems, get_system);
 
 
   string get_system_tag(const string &system, const string &tag) const;
   string get_system_tag(const string &system, const string &tag) const;

+ 7 - 7
dtool/src/dtoolutil/textEncoder.I

@@ -215,7 +215,7 @@ append_unicode_char(int character) {
 //               This is a count of wide characters, after the string
 //               This is a count of wide characters, after the string
 //               has been decoded according to set_encoding().
 //               has been decoded according to set_encoding().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int TextEncoder::
+INLINE size_t TextEncoder::
 get_num_chars() const {
 get_num_chars() const {
   return get_wtext().length();
   return get_wtext().length();
 }
 }
@@ -229,9 +229,9 @@ get_num_chars() const {
 //               according to set_encoding().
 //               according to set_encoding().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE int TextEncoder::
 INLINE int TextEncoder::
-get_unicode_char(int index) const {
+get_unicode_char(size_t index) const {
   get_wtext();
   get_wtext();
-  if (index >= 0 && index < (int)_wtext.length()) {
+  if (index < _wtext.length()) {
     return _wtext[index];
     return _wtext[index];
   }
   }
   return 0;
   return 0;
@@ -246,9 +246,9 @@ get_unicode_char(int index) const {
 //               according to set_encoding().
 //               according to set_encoding().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void TextEncoder::
 INLINE void TextEncoder::
-set_unicode_char(int index, int character) {
+set_unicode_char(size_t index, int character) {
   get_wtext();
   get_wtext();
-  if (index >= 0 && index < (int)_wtext.length()) {
+  if (index < _wtext.length()) {
     _wtext[index] = character;
     _wtext[index] = character;
     _flags &= ~F_got_text;
     _flags &= ~F_got_text;
   }
   }
@@ -261,7 +261,7 @@ set_unicode_char(int index, int character) {
 //               two-, or three-byte encoded string.
 //               two-, or three-byte encoded string.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string TextEncoder::
 INLINE string TextEncoder::
-get_encoded_char(int index) const {
+get_encoded_char(size_t index) const {
   return get_encoded_char(index, get_encoding());
   return get_encoded_char(index, get_encoding());
 }
 }
 
 
@@ -272,7 +272,7 @@ get_encoded_char(int index) const {
 //               two-, or three-byte encoded string.
 //               two-, or three-byte encoded string.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string TextEncoder::
 INLINE string TextEncoder::
-get_encoded_char(int index, TextEncoder::Encoding encoding) const {
+get_encoded_char(size_t index, TextEncoder::Encoding encoding) const {
   wstring wch(1, (wchar_t)get_unicode_char(index));
   wstring wch(1, (wchar_t)get_unicode_char(index));
   return encode_wtext(wch, encoding);
   return encode_wtext(wch, encoding);
 }
 }

+ 5 - 5
dtool/src/dtoolutil/textEncoder.h

@@ -63,11 +63,11 @@ PUBLISHED:
   INLINE string get_text(Encoding encoding) const;
   INLINE string get_text(Encoding encoding) const;
   INLINE void append_text(const string &text);
   INLINE void append_text(const string &text);
   INLINE void append_unicode_char(int character);
   INLINE void append_unicode_char(int character);
-  INLINE int get_num_chars() const;
-  INLINE int get_unicode_char(int index) const;
-  INLINE void set_unicode_char(int index, int character);
-  INLINE string get_encoded_char(int index) const;
-  INLINE string get_encoded_char(int index, Encoding encoding) const;
+  INLINE size_t get_num_chars() const;
+  INLINE int get_unicode_char(size_t index) const;
+  INLINE void set_unicode_char(size_t index, int character);
+  INLINE string get_encoded_char(size_t index) const;
+  INLINE string get_encoded_char(size_t index, Encoding encoding) const;
   INLINE string get_text_as_ascii() const;
   INLINE string get_text_as_ascii() const;
 
 
   INLINE static string reencode_text(const string &text, Encoding from, Encoding to);
   INLINE static string reencode_text(const string &text, Encoding from, Encoding to);

+ 2 - 2
dtool/src/dtoolutil/unicodeLatinMap.cxx

@@ -1299,7 +1299,7 @@ static const UnicodeLatinMap::Entry latin_map[] = {
     UnicodeLatinMap::AT_curl, 0 },
     UnicodeLatinMap::AT_curl, 0 },
 };
 };
 #ifndef CPPPARSER
 #ifndef CPPPARSER
-static const int latin_map_length = sizeof(latin_map) / sizeof(UnicodeLatinMap::Entry);
+static const size_t latin_map_length = sizeof(latin_map) / sizeof(UnicodeLatinMap::Entry);
 #endif
 #endif
 
 
 
 
@@ -1338,7 +1338,7 @@ void UnicodeLatinMap::
 init() {
 init() {
   if (!_initialized) {
   if (!_initialized) {
     _by_character = new ByCharacter;
     _by_character = new ByCharacter;
-    for (int i = 0; i < latin_map_length; i++) {
+    for (size_t i = 0; i < latin_map_length; i++) {
       const UnicodeLatinMap::Entry *entry = &latin_map[i];
       const UnicodeLatinMap::Entry *entry = &latin_map[i];
 
 
       // The first 256 characters are very common in Latin-alphabet
       // The first 256 characters are very common in Latin-alphabet

+ 13 - 13
dtool/src/interrogate/interfaceMakerPythonNative.cxx

@@ -3460,23 +3460,23 @@ write_function_for_name(ostream &out, Object *obj,
   if (map_sets.size() > 1) {
   if (map_sets.size() > 1) {
     switch (args_type) {
     switch (args_type) {
     case AT_keyword_args:
     case AT_keyword_args:
-      indent(out, 2) << "int parameter_count = PyTuple_Size(args);\n";
+      indent(out, 2) << "Py_ssize_t parameter_count = PyTuple_Size(args);\n";
       indent(out, 2) << "if (kwds != NULL) {\n";
       indent(out, 2) << "if (kwds != NULL) {\n";
       indent(out, 2) << "  parameter_count += PyDict_Size(kwds);\n";
       indent(out, 2) << "  parameter_count += PyDict_Size(kwds);\n";
       indent(out, 2) << "}\n";
       indent(out, 2) << "}\n";
       break;
       break;
 
 
     case AT_varargs:
     case AT_varargs:
-      indent(out, 2) << "int parameter_count = PyTuple_Size(args);\n";
+      indent(out, 2) << "Py_ssize_t parameter_count = PyTuple_Size(args);\n";
       break;
       break;
 
 
     case AT_single_arg:
     case AT_single_arg:
       // It shouldn't get here, but we'll handle these cases nonetheless.
       // It shouldn't get here, but we'll handle these cases nonetheless.
-      indent(out, 2) << "const int parameter_count = 1;\n";
+      indent(out, 2) << "const Py_ssize_t parameter_count = 1;\n";
       break;
       break;
 
 
     default:
     default:
-      indent(out, 2) << "const int parameter_count = 0;\n";
+      indent(out, 2) << "const Py_ssize_t parameter_count = 0;\n";
       break;
       break;
     }
     }
 
 
@@ -3571,19 +3571,19 @@ write_function_for_name(ostream &out, Object *obj,
       switch (args_type) {
       switch (args_type) {
       case AT_keyword_args:
       case AT_keyword_args:
         out << "  if (PyTuple_Size(args) > 0 || (kwds != NULL && PyDict_Size(kwds) > 0)) {\n";
         out << "  if (PyTuple_Size(args) > 0 || (kwds != NULL && PyDict_Size(kwds) > 0)) {\n";
-        out << "    int parameter_count = PyTuple_Size(args);\n";
+        out << "    Py_ssize_t parameter_count = PyTuple_Size(args);\n";
         out << "    if (kwds != NULL) {\n";
         out << "    if (kwds != NULL) {\n";
         out << "      parameter_count += PyDict_Size(kwds);\n";
         out << "      parameter_count += PyDict_Size(kwds);\n";
         out << "    }\n";
         out << "    }\n";
         break;
         break;
       case AT_varargs:
       case AT_varargs:
         out << "  if (PyTuple_Size(args) > 0) {\n";
         out << "  if (PyTuple_Size(args) > 0) {\n";
-        out << "    const int parameter_count = PyTuple_GET_SIZE(args);\n";
+        out << "    const Py_ssize_t parameter_count = PyTuple_GET_SIZE(args);\n";
         break;
         break;
       case AT_single_arg:
       case AT_single_arg:
         // Shouldn't happen, but let's handle this case nonetheless.
         // Shouldn't happen, but let's handle this case nonetheless.
         out << "  {\n";
         out << "  {\n";
-        out << "    const int parameter_count = 1;\n";
+        out << "    const Py_ssize_t parameter_count = 1;\n";
         break;
         break;
       case AT_no_args:
       case AT_no_args:
         break;
         break;
@@ -3603,7 +3603,7 @@ write_function_for_name(ostream &out, Object *obj,
     } else if (args_type == AT_keyword_args && max_required_args == 1 && mii->first == 1) {
     } else if (args_type == AT_keyword_args && max_required_args == 1 && mii->first == 1) {
       // Check this to be sure, as we handle the case of only 1 keyword arg
       // Check this to be sure, as we handle the case of only 1 keyword arg
       // in write_function_forset (not using ParseTupleAndKeywords).
       // in write_function_forset (not using ParseTupleAndKeywords).
-      out << "    int parameter_count = PyTuple_Size(args);\n"
+      out << "    Py_ssize_t parameter_count = PyTuple_Size(args);\n"
              "    if (kwds != NULL) {\n"
              "    if (kwds != NULL) {\n"
              "      parameter_count += PyDict_Size(kwds);\n"
              "      parameter_count += PyDict_Size(kwds);\n"
              "    }\n"
              "    }\n"
@@ -3724,7 +3724,7 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) {
           map_sets[i].insert(remap);
           map_sets[i].insert(remap);
         }
         }
 
 
-        int parameter_size = remap->_parameters.size();
+        size_t parameter_size = remap->_parameters.size();
         map_sets[parameter_size].insert(remap);
         map_sets[parameter_size].insert(remap);
       }
       }
     }
     }
@@ -3762,7 +3762,7 @@ write_coerce_constructor(ostream &out, Object *obj, bool is_const) {
           map_sets[i].insert(remap);
           map_sets[i].insert(remap);
         }
         }
 
 
-        int parameter_size = remap->_parameters.size();
+        size_t parameter_size = remap->_parameters.size();
         map_sets[parameter_size].insert(remap);
         map_sets[parameter_size].insert(remap);
       }
       }
     }
     }
@@ -6679,7 +6679,7 @@ is_remap_legal(FunctionRemap *remap) {
   }
   }
 
 
   // all non-optional params must be legal
   // all non-optional params must be legal
-  for (int pn = 0; pn < (int)remap->_parameters.size(); pn++) {
+  for (size_t pn = 0; pn < remap->_parameters.size(); pn++) {
     ParameterRemap *param = remap->_parameters[pn]._remap;
     ParameterRemap *param = remap->_parameters[pn]._remap;
     CPPType *orig_type = param->get_orig_type();
     CPPType *orig_type = param->get_orig_type();
     if (param->get_default_value() == NULL && !is_cpp_type_legal(orig_type)) {
     if (param->get_default_value() == NULL && !is_cpp_type_legal(orig_type)) {
@@ -6767,12 +6767,12 @@ is_remap_coercion_possible(FunctionRemap *remap) {
     return false;
     return false;
   }
   }
 
 
-  int pn = 0;
+  size_t pn = 0;
   if (remap->_has_this) {
   if (remap->_has_this) {
     // Skip the "this" parameter.  It's never coercible.
     // Skip the "this" parameter.  It's never coercible.
     ++pn;
     ++pn;
   }
   }
-  while (pn < (int)remap->_parameters.size()) {
+  while (pn < remap->_parameters.size()) {
     CPPType *type = remap->_parameters[pn]._remap->get_new_type();
     CPPType *type = remap->_parameters[pn]._remap->get_new_type();
 
 
     if (TypeManager::is_char_pointer(type)) {
     if (TypeManager::is_char_pointer(type)) {

+ 12 - 12
dtool/src/prc/configDeclaration.I

@@ -86,7 +86,7 @@ set_string_value(const string &string_value) {
 //               value.  A word is defined as a sequence of
 //               value.  A word is defined as a sequence of
 //               non-whitespace characters delimited by whitespace.
 //               non-whitespace characters delimited by whitespace.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigDeclaration::
+INLINE size_t ConfigDeclaration::
 get_num_words() const {
 get_num_words() const {
   if (!_got_words) {
   if (!_got_words) {
     ((ConfigDeclaration *)this)->get_words();
     ((ConfigDeclaration *)this)->get_words();
@@ -103,11 +103,11 @@ get_num_words() const {
 //               the value.
 //               the value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigDeclaration::
 INLINE bool ConfigDeclaration::
-has_string_word(int n) const {
+has_string_word(size_t n) const {
   if (!_got_words) {
   if (!_got_words) {
     ((ConfigDeclaration *)this)->get_words();
     ((ConfigDeclaration *)this)->get_words();
   }
   }
-  return (n >= 0 && n < (int)_words.size());
+  return (n < _words.size());
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -117,7 +117,7 @@ has_string_word(int n) const {
 //               boolean value for the nth word.
 //               boolean value for the nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigDeclaration::
 INLINE bool ConfigDeclaration::
-has_bool_word(int n) const {
+has_bool_word(size_t n) const {
   if (has_string_word(n)) {
   if (has_string_word(n)) {
     ((ConfigDeclaration *)this)->check_bool_word(n);
     ((ConfigDeclaration *)this)->check_bool_word(n);
     return (_words[n]._flags & F_valid_bool) != 0;
     return (_words[n]._flags & F_valid_bool) != 0;
@@ -132,7 +132,7 @@ has_bool_word(int n) const {
 //               integer value for the nth word.
 //               integer value for the nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigDeclaration::
 INLINE bool ConfigDeclaration::
-has_int_word(int n) const {
+has_int_word(size_t n) const {
   if (has_string_word(n)) {
   if (has_string_word(n)) {
     ((ConfigDeclaration *)this)->check_int_word(n);
     ((ConfigDeclaration *)this)->check_int_word(n);
     return (_words[n]._flags & F_valid_int) != 0;
     return (_words[n]._flags & F_valid_int) != 0;
@@ -147,7 +147,7 @@ has_int_word(int n) const {
 //               int64 value for the nth word.
 //               int64 value for the nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigDeclaration::
 INLINE bool ConfigDeclaration::
-has_int64_word(int n) const {
+has_int64_word(size_t n) const {
   if (has_string_word(n)) {
   if (has_string_word(n)) {
     ((ConfigDeclaration *)this)->check_int64_word(n);
     ((ConfigDeclaration *)this)->check_int64_word(n);
     return (_words[n]._flags & F_valid_int64) != 0;
     return (_words[n]._flags & F_valid_int64) != 0;
@@ -162,7 +162,7 @@ has_int64_word(int n) const {
 //               integer value for the nth word.
 //               integer value for the nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigDeclaration::
 INLINE bool ConfigDeclaration::
-has_double_word(int n) const {
+has_double_word(size_t n) const {
   if (has_string_word(n)) {
   if (has_string_word(n)) {
     ((ConfigDeclaration *)this)->check_double_word(n);
     ((ConfigDeclaration *)this)->check_double_word(n);
     return (_words[n]._flags & F_valid_double) != 0;
     return (_words[n]._flags & F_valid_double) != 0;
@@ -178,7 +178,7 @@ has_double_word(int n) const {
 //               nth value.  See also has_string_word().
 //               nth value.  See also has_string_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigDeclaration::
 INLINE string ConfigDeclaration::
-get_string_word(int n) const {
+get_string_word(size_t n) const {
   if (has_string_word(n)) {
   if (has_string_word(n)) {
     return _words[n]._str;
     return _words[n]._str;
   }
   }
@@ -193,7 +193,7 @@ get_string_word(int n) const {
 //               value.  See also has_bool_word().
 //               value.  See also has_bool_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigDeclaration::
 INLINE bool ConfigDeclaration::
-get_bool_word(int n) const {
+get_bool_word(size_t n) const {
   // We use has_string_word() instead of has_bool_word(), so we can
   // We use has_string_word() instead of has_bool_word(), so we can
   // return a partial answer if there was one.
   // return a partial answer if there was one.
   if (has_string_word(n)) {
   if (has_string_word(n)) {
@@ -211,7 +211,7 @@ get_bool_word(int n) const {
 //               See also has_int_word().
 //               See also has_int_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE int ConfigDeclaration::
 INLINE int ConfigDeclaration::
-get_int_word(int n) const {
+get_int_word(size_t n) const {
   // We use has_string_word() instead of has_int_word(), so we can
   // We use has_string_word() instead of has_int_word(), so we can
   // return a partial answer if there was one.
   // return a partial answer if there was one.
   if (has_string_word(n)) {
   if (has_string_word(n)) {
@@ -229,7 +229,7 @@ get_int_word(int n) const {
 //               See also has_int64_word().
 //               See also has_int64_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PN_int64 ConfigDeclaration::
 INLINE PN_int64 ConfigDeclaration::
-get_int64_word(int n) const {
+get_int64_word(size_t n) const {
   // We use has_string_word() instead of has_int64_word(), so we can
   // We use has_string_word() instead of has_int64_word(), so we can
   // return a partial answer if there was one.
   // return a partial answer if there was one.
   if (has_string_word(n)) {
   if (has_string_word(n)) {
@@ -247,7 +247,7 @@ get_int64_word(int n) const {
 //               See also has_double_word().
 //               See also has_double_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE double ConfigDeclaration::
 INLINE double ConfigDeclaration::
-get_double_word(int n) const {
+get_double_word(size_t n) const {
   // We use has_string_word() instead of has_double_word(), so we can
   // We use has_string_word() instead of has_double_word(), so we can
   // return a partial answer if there was one.
   // return a partial answer if there was one.
   if (has_string_word(n)) {
   if (has_string_word(n)) {

+ 12 - 12
dtool/src/prc/configDeclaration.cxx

@@ -58,7 +58,7 @@ ConfigDeclaration::
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-set_string_word(int n, const string &value) {
+set_string_word(size_t n, const string &value) {
   if (!_got_words) {
   if (!_got_words) {
     get_words();
     get_words();
   }
   }
@@ -92,7 +92,7 @@ set_string_word(int n, const string &value) {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-set_bool_word(int n, bool value) {
+set_bool_word(size_t n, bool value) {
   set_string_word(n, value ? "1" : "0");
   set_string_word(n, value ? "1" : "0");
 
 
   _words[n]._flags |= (F_checked_bool | F_valid_bool);
   _words[n]._flags |= (F_checked_bool | F_valid_bool);
@@ -107,7 +107,7 @@ set_bool_word(int n, bool value) {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-set_int_word(int n, int value) {
+set_int_word(size_t n, int value) {
   set_string_word(n, format_string(value));
   set_string_word(n, format_string(value));
 
 
   _words[n]._flags |= (F_checked_int | F_valid_int);
   _words[n]._flags |= (F_checked_int | F_valid_int);
@@ -122,7 +122,7 @@ set_int_word(int n, int value) {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-set_int64_word(int n, PN_int64 value) {
+set_int64_word(size_t n, PN_int64 value) {
   set_string_word(n, format_string(value));
   set_string_word(n, format_string(value));
 
 
   _words[n]._flags |= (F_checked_int64 | F_valid_int64);
   _words[n]._flags |= (F_checked_int64 | F_valid_int64);
@@ -137,7 +137,7 @@ set_int64_word(int n, PN_int64 value) {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-set_double_word(int n, double value) {
+set_double_word(size_t n, double value) {
   set_string_word(n, format_string(value));
   set_string_word(n, format_string(value));
 
 
   _words[n]._flags |= (F_checked_double | F_valid_double);
   _words[n]._flags |= (F_checked_double | F_valid_double);
@@ -202,7 +202,7 @@ get_words() {
 //               boolean value.
 //               boolean value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-check_bool_word(int n) {
+check_bool_word(size_t n) {
   if (!_got_words) {
   if (!_got_words) {
     get_words();
     get_words();
   }
   }
@@ -249,7 +249,7 @@ check_bool_word(int n) {
 //               integer value.
 //               integer value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-check_int_word(int n) {
+check_int_word(size_t n) {
   if (!_got_words) {
   if (!_got_words) {
     get_words();
     get_words();
   }
   }
@@ -309,7 +309,7 @@ check_int_word(int n) {
 //               integer value.
 //               integer value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-check_int64_word(int n) {
+check_int64_word(size_t n) {
   if (!_got_words) {
   if (!_got_words) {
     get_words();
     get_words();
   }
   }
@@ -367,7 +367,7 @@ check_int64_word(int n) {
 //               floating-point value.
 //               floating-point value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigDeclaration::
 void ConfigDeclaration::
-check_double_word(int n) {
+check_double_word(size_t n) {
   if (!_got_words) {
   if (!_got_words) {
     get_words();
     get_words();
   }
   }
@@ -403,9 +403,9 @@ check_double_word(int n) {
 //
 //
 //               The return value is the number of words extracted.
 //               The return value is the number of words extracted.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int ConfigDeclaration::
+size_t ConfigDeclaration::
 extract_words(const string &str, vector_string &words) {
 extract_words(const string &str, vector_string &words) {
-  int num_words = 0;
+  size_t num_words = 0;
 
 
   size_t pos = 0;
   size_t pos = 0;
   while (pos < str.length() && isspace((unsigned int)str[pos])) {
   while (pos < str.length() && isspace((unsigned int)str[pos])) {
@@ -439,7 +439,7 @@ downcase(const string &s) {
   result.reserve(s.size());
   result.reserve(s.size());
   string::const_iterator p;
   string::const_iterator p;
   for (p = s.begin(); p != s.end(); ++p) {
   for (p = s.begin(); p != s.end(); ++p) {
-    result += tolower(*p);
+    result += (char)tolower(*p);
   }
   }
   return result;
   return result;
 }
 }

+ 24 - 24
dtool/src/prc/configDeclaration.h

@@ -49,25 +49,25 @@ PUBLISHED:
   INLINE const string &get_string_value() const;
   INLINE const string &get_string_value() const;
   INLINE void set_string_value(const string &value);
   INLINE void set_string_value(const string &value);
 
 
-  INLINE int get_num_words() const;
-
-  INLINE bool has_string_word(int n) const;
-  INLINE bool has_bool_word(int n) const;
-  INLINE bool has_int_word(int n) const;
-  INLINE bool has_int64_word(int n) const;
-  INLINE bool has_double_word(int n) const;
-
-  INLINE string get_string_word(int n) const;
-  INLINE bool get_bool_word(int n) const;
-  INLINE int get_int_word(int n) const;
-  INLINE PN_int64 get_int64_word(int n) const;
-  INLINE double get_double_word(int n) const;
-
-  void set_string_word(int n, const string &value);
-  void set_bool_word(int n, bool value);
-  void set_int_word(int n, int value);
-  void set_int64_word(int n, PN_int64 value);
-  void set_double_word(int n, double value);
+  INLINE size_t get_num_words() const;
+
+  INLINE bool has_string_word(size_t n) const;
+  INLINE bool has_bool_word(size_t n) const;
+  INLINE bool has_int_word(size_t n) const;
+  INLINE bool has_int64_word(size_t n) const;
+  INLINE bool has_double_word(size_t n) const;
+
+  INLINE string get_string_word(size_t n) const;
+  INLINE bool get_bool_word(size_t n) const;
+  INLINE int get_int_word(size_t n) const;
+  INLINE PN_int64 get_int64_word(size_t n) const;
+  INLINE double get_double_word(size_t n) const;
+
+  void set_string_word(size_t n, const string &value);
+  void set_bool_word(size_t n, bool value);
+  void set_int_word(size_t n, int value);
+  void set_int64_word(size_t n, PN_int64 value);
+  void set_double_word(size_t n, double value);
 
 
   INLINE int get_decl_seq() const;
   INLINE int get_decl_seq() const;
 
 
@@ -75,15 +75,15 @@ PUBLISHED:
   void write(ostream &out) const;
   void write(ostream &out) const;
 
 
 public:
 public:
-  static int extract_words(const string &str, vector_string &words);
+  static size_t extract_words(const string &str, vector_string &words);
   static string downcase(const string &s);
   static string downcase(const string &s);
 
 
 private:
 private:
   void get_words();
   void get_words();
-  void check_bool_word(int n);
-  void check_int_word(int n);
-  void check_int64_word(int n);
-  void check_double_word(int n);
+  void check_bool_word(size_t n);
+  void check_int_word(size_t n);
+  void check_int64_word(size_t n);
+  void check_double_word(size_t n);
 
 
 private:
 private:
   ConfigPage *_page;
   ConfigPage *_page;

+ 11 - 11
dtool/src/prc/configPage.cxx

@@ -321,7 +321,7 @@ delete_declaration(ConfigDeclaration *decl) {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of declarations on the page.
 //  Description: Returns the number of declarations on the page.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int ConfigPage::
+size_t ConfigPage::
 get_num_declarations() const {
 get_num_declarations() const {
   return _declarations.size();
   return _declarations.size();
 }
 }
@@ -332,8 +332,8 @@ get_num_declarations() const {
 //  Description: Returns the nth declaration on the page.
 //  Description: Returns the nth declaration on the page.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 const ConfigDeclaration *ConfigPage::
 const ConfigDeclaration *ConfigPage::
-get_declaration(int n) const {
-  nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL);
+get_declaration(size_t n) const {
+  nassertr(n < _declarations.size(), (ConfigDeclaration *)NULL);
   return _declarations[n];
   return _declarations[n];
 }
 }
 
 
@@ -346,8 +346,8 @@ get_declaration(int n) const {
 //               ConfigPage::write().
 //               ConfigPage::write().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 ConfigDeclaration *ConfigPage::
 ConfigDeclaration *ConfigPage::
-modify_declaration(int n) {
-  nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL);
+modify_declaration(size_t n) {
+  nassertr(n < _declarations.size(), (ConfigDeclaration *)NULL);
   return _declarations[n];
   return _declarations[n];
 }
 }
 
 
@@ -358,8 +358,8 @@ modify_declaration(int n) {
 //               the page.
 //               the page.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 string ConfigPage::
 string ConfigPage::
-get_variable_name(int n) const {
-  nassertr(n >= 0 && n < (int)_declarations.size(), string());
+get_variable_name(size_t n) const {
+  nassertr(n < _declarations.size(), string());
   return _declarations[n]->get_variable()->get_name();
   return _declarations[n]->get_variable()->get_name();
 }
 }
 
 
@@ -370,8 +370,8 @@ get_variable_name(int n) const {
 //               the page.
 //               the page.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 string ConfigPage::
 string ConfigPage::
-get_string_value(int n) const {
-  nassertr(n >= 0 && n < (int)_declarations.size(), string());
+get_string_value(size_t n) const {
+  nassertr(n < _declarations.size(), string());
   return _declarations[n]->get_string_value();
   return _declarations[n]->get_string_value();
 }
 }
 
 
@@ -382,8 +382,8 @@ get_string_value(int n) const {
 //               the page has been used by code, false otherwise.
 //               the page has been used by code, false otherwise.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool ConfigPage::
 bool ConfigPage::
-is_variable_used(int n) const {
-  nassertr(n >= 0 && n < (int)_declarations.size(), false);
+is_variable_used(size_t n) const {
+  nassertr(n < _declarations.size(), false);
   return _declarations[n]->get_variable()->is_used();
   return _declarations[n]->get_variable()->is_used();
 }
 }
 
 

+ 6 - 6
dtool/src/prc/configPage.h

@@ -63,12 +63,12 @@ PUBLISHED:
   ConfigDeclaration *make_declaration(ConfigVariableCore *variable, const string &value);
   ConfigDeclaration *make_declaration(ConfigVariableCore *variable, const string &value);
   bool delete_declaration(ConfigDeclaration *decl);
   bool delete_declaration(ConfigDeclaration *decl);
 
 
-  int get_num_declarations() const;
-  const ConfigDeclaration *get_declaration(int n) const;
-  ConfigDeclaration *modify_declaration(int n);
-  string get_variable_name(int n) const;
-  string get_string_value(int n) const;
-  bool is_variable_used(int n) const;
+  size_t get_num_declarations() const;
+  const ConfigDeclaration *get_declaration(size_t n) const;
+  ConfigDeclaration *modify_declaration(size_t n);
+  string get_variable_name(size_t n) const;
+  string get_string_value(size_t n) const;
+  bool is_variable_used(size_t n) const;
 
 
   void output(ostream &out) const;
   void output(ostream &out) const;
   void output_brief_signature(ostream &out) const;
   void output_brief_signature(ostream &out) const;

+ 15 - 15
dtool/src/prc/configPageManager.I

@@ -66,7 +66,7 @@ get_search_path() {
 //               specified with the PRC_FILENAME variable in
 //               specified with the PRC_FILENAME variable in
 //               Config.pp.
 //               Config.pp.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigPageManager::
+INLINE size_t ConfigPageManager::
 get_num_prc_patterns() const {
 get_num_prc_patterns() const {
   return _prc_patterns.size();
   return _prc_patterns.size();
 }
 }
@@ -79,8 +79,8 @@ get_num_prc_patterns() const {
 //               get_num_prc_patterns().
 //               get_num_prc_patterns().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigPageManager::
 INLINE string ConfigPageManager::
-get_prc_pattern(int n) const {
-  nassertr(n >= 0 && n < (int)_prc_patterns.size(), string());
+get_prc_pattern(size_t n) const {
+  nassertr(n < _prc_patterns.size(), string());
   return _prc_patterns[n].get_pattern();
   return _prc_patterns[n].get_pattern();
 }
 }
 
 
@@ -91,7 +91,7 @@ get_prc_pattern(int n) const {
 //               are compiled in that will be searched for as special
 //               are compiled in that will be searched for as special
 //               config files that are understood to be encrypted.
 //               config files that are understood to be encrypted.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigPageManager::
+INLINE size_t ConfigPageManager::
 get_num_prc_encrypted_patterns() const {
 get_num_prc_encrypted_patterns() const {
   return _prc_encrypted_patterns.size();
   return _prc_encrypted_patterns.size();
 }
 }
@@ -104,8 +104,8 @@ get_num_prc_encrypted_patterns() const {
 //               file.  See get_num_prc_encrypted_patterns().
 //               file.  See get_num_prc_encrypted_patterns().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigPageManager::
 INLINE string ConfigPageManager::
-get_prc_encrypted_pattern(int n) const {
-  nassertr(n >= 0 && n < (int)_prc_patterns.size(), string());
+get_prc_encrypted_pattern(size_t n) const {
+  nassertr(n < _prc_patterns.size(), string());
   return _prc_encrypted_patterns[n].get_pattern();
   return _prc_encrypted_patterns[n].get_pattern();
 }
 }
 
 
@@ -118,7 +118,7 @@ get_prc_encrypted_pattern(int n) const {
 //               and their output taken to be input.  This is normally
 //               and their output taken to be input.  This is normally
 //               empty.
 //               empty.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigPageManager::
+INLINE size_t ConfigPageManager::
 get_num_prc_executable_patterns() const {
 get_num_prc_executable_patterns() const {
   return _prc_executable_patterns.size();
   return _prc_executable_patterns.size();
 }
 }
@@ -131,8 +131,8 @@ get_num_prc_executable_patterns() const {
 //               file.  See get_num_prc_executable_patterns().
 //               file.  See get_num_prc_executable_patterns().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigPageManager::
 INLINE string ConfigPageManager::
-get_prc_executable_pattern(int n) const {
-  nassertr(n >= 0 && n < (int)_prc_patterns.size(), string());
+get_prc_executable_pattern(size_t n) const {
+  nassertr(n < _prc_patterns.size(), string());
   return _prc_executable_patterns[n].get_pattern();
   return _prc_executable_patterns[n].get_pattern();
 }
 }
 
 
@@ -144,7 +144,7 @@ get_prc_executable_pattern(int n) const {
 //               were automatically discovered on the disk as .prc
 //               were automatically discovered on the disk as .prc
 //               files.
 //               files.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigPageManager::
+INLINE size_t ConfigPageManager::
 get_num_implicit_pages() const {
 get_num_implicit_pages() const {
   return _implicit_pages.size();
   return _implicit_pages.size();
 }
 }
@@ -156,9 +156,9 @@ get_num_implicit_pages() const {
 //               See get_num_implicit_pages().
 //               See get_num_implicit_pages().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE ConfigPage *ConfigPageManager::
 INLINE ConfigPage *ConfigPageManager::
-get_implicit_page(int n) const {
+get_implicit_page(size_t n) const {
   check_sort_pages();
   check_sort_pages();
-  nassertr(n >= 0 && n < (int)_implicit_pages.size(), (ConfigPage *)NULL);
+  nassertr(n < _implicit_pages.size(), (ConfigPage *)NULL);
   return _implicit_pages[n];
   return _implicit_pages[n];
 }
 }
 
 
@@ -170,7 +170,7 @@ get_implicit_page(int n) const {
 //               were loaded dynamically at runtime by explicit calls
 //               were loaded dynamically at runtime by explicit calls
 //               to ConfigPageManager::make_explicit_page().
 //               to ConfigPageManager::make_explicit_page().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigPageManager::
+INLINE size_t ConfigPageManager::
 get_num_explicit_pages() const {
 get_num_explicit_pages() const {
   return _explicit_pages.size();
   return _explicit_pages.size();
 }
 }
@@ -182,9 +182,9 @@ get_num_explicit_pages() const {
 //               See get_num_explicit_pages().
 //               See get_num_explicit_pages().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE ConfigPage *ConfigPageManager::
 INLINE ConfigPage *ConfigPageManager::
-get_explicit_page(int n) const {
+get_explicit_page(size_t n) const {
   check_sort_pages();
   check_sort_pages();
-  nassertr(n >= 0 && n < (int)_explicit_pages.size(), (ConfigPage *)NULL);
+  nassertr(n < _explicit_pages.size(), (ConfigPage *)NULL);
   return _explicit_pages[n];
   return _explicit_pages[n];
 }
 }
 
 

+ 10 - 10
dtool/src/prc/configPageManager.h

@@ -43,23 +43,23 @@ PUBLISHED:
 
 
   INLINE DSearchPath &get_search_path();
   INLINE DSearchPath &get_search_path();
 
 
-  INLINE int get_num_prc_patterns() const;
-  INLINE string get_prc_pattern(int n) const;
+  INLINE size_t get_num_prc_patterns() const;
+  INLINE string get_prc_pattern(size_t n) const;
 
 
-  INLINE int get_num_prc_encrypted_patterns() const;
-  INLINE string get_prc_encrypted_pattern(int n) const;
+  INLINE size_t get_num_prc_encrypted_patterns() const;
+  INLINE string get_prc_encrypted_pattern(size_t n) const;
 
 
-  INLINE int get_num_prc_executable_patterns() const;
-  INLINE string get_prc_executable_pattern(int n) const;
+  INLINE size_t get_num_prc_executable_patterns() const;
+  INLINE string get_prc_executable_pattern(size_t n) const;
 
 
   ConfigPage *make_explicit_page(const string &name);
   ConfigPage *make_explicit_page(const string &name);
   bool delete_explicit_page(ConfigPage *page);
   bool delete_explicit_page(ConfigPage *page);
 
 
-  INLINE int get_num_implicit_pages() const;
-  INLINE ConfigPage *get_implicit_page(int n) const;
+  INLINE size_t get_num_implicit_pages() const;
+  INLINE ConfigPage *get_implicit_page(size_t n) const;
 
 
-  INLINE int get_num_explicit_pages() const;
-  INLINE ConfigPage *get_explicit_page(int n) const;
+  INLINE size_t get_num_explicit_pages() const;
+  INLINE ConfigPage *get_explicit_page(size_t n) const;
 
 
   void output(ostream &out) const;
   void output(ostream &out) const;
   void write(ostream &out) const;
   void write(ostream &out) const;

+ 16 - 16
dtool/src/prc/configVariable.I

@@ -122,7 +122,7 @@ clear_value() {
 //               value.  A word is defined as a sequence of
 //               value.  A word is defined as a sequence of
 //               non-whitespace characters delimited by whitespace.
 //               non-whitespace characters delimited by whitespace.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariable::
+INLINE size_t ConfigVariable::
 get_num_words() const {
 get_num_words() const {
   nassertr(is_constructed(), 0);
   nassertr(is_constructed(), 0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
@@ -138,7 +138,7 @@ get_num_words() const {
 //               the value.
 //               the value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigVariable::
 INLINE bool ConfigVariable::
-has_string_word(int n) const {
+has_string_word(size_t n) const {
   nassertr(is_constructed(), false);
   nassertr(is_constructed(), false);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->has_string_word(n);
   return decl->has_string_word(n);
@@ -151,7 +151,7 @@ has_string_word(int n) const {
 //               boolean value for the nth word.
 //               boolean value for the nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigVariable::
 INLINE bool ConfigVariable::
-has_bool_word(int n) const {
+has_bool_word(size_t n) const {
   nassertr(is_constructed(), false);
   nassertr(is_constructed(), false);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->has_bool_word(n);
   return decl->has_bool_word(n);
@@ -164,7 +164,7 @@ has_bool_word(int n) const {
 //               integer value for the nth word.
 //               integer value for the nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigVariable::
 INLINE bool ConfigVariable::
-has_int_word(int n) const {
+has_int_word(size_t n) const {
   nassertr(is_constructed(), false);
   nassertr(is_constructed(), false);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->has_int_word(n);
   return decl->has_int_word(n);
@@ -177,7 +177,7 @@ has_int_word(int n) const {
 //               64-bit integer value for the nth word.
 //               64-bit integer value for the nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigVariable::
 INLINE bool ConfigVariable::
-has_int64_word(int n) const {
+has_int64_word(size_t n) const {
   nassertr(is_constructed(), false);
   nassertr(is_constructed(), false);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->has_int64_word(n);
   return decl->has_int64_word(n);
@@ -190,7 +190,7 @@ has_int64_word(int n) const {
 //               integer value for the nth word.
 //               integer value for the nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigVariable::
 INLINE bool ConfigVariable::
-has_double_word(int n) const {
+has_double_word(size_t n) const {
   nassertr(is_constructed(), false);
   nassertr(is_constructed(), false);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->has_double_word(n);
   return decl->has_double_word(n);
@@ -204,7 +204,7 @@ has_double_word(int n) const {
 //               nth value.  See also has_string_word().
 //               nth value.  See also has_string_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigVariable::
 INLINE string ConfigVariable::
-get_string_word(int n) const {
+get_string_word(size_t n) const {
   nassertr(is_constructed(), string());
   nassertr(is_constructed(), string());
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->get_string_word(n);
   return decl->get_string_word(n);
@@ -218,7 +218,7 @@ get_string_word(int n) const {
 //               value.  See also has_bool_word().
 //               value.  See also has_bool_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigVariable::
 INLINE bool ConfigVariable::
-get_bool_word(int n) const {
+get_bool_word(size_t n) const {
   nassertr(is_constructed(), false);
   nassertr(is_constructed(), false);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->get_bool_word(n);
   return decl->get_bool_word(n);
@@ -232,7 +232,7 @@ get_bool_word(int n) const {
 //               See also has_int_word().
 //               See also has_int_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE int ConfigVariable::
 INLINE int ConfigVariable::
-get_int_word(int n) const {
+get_int_word(size_t n) const {
   nassertr(is_constructed(), 0);
   nassertr(is_constructed(), 0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->get_int_word(n);
   return decl->get_int_word(n);
@@ -246,7 +246,7 @@ get_int_word(int n) const {
 //               See also has_int_word().
 //               See also has_int_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PN_int64 ConfigVariable::
 INLINE PN_int64 ConfigVariable::
-get_int64_word(int n) const {
+get_int64_word(size_t n) const {
   nassertr(is_constructed(), 0);
   nassertr(is_constructed(), 0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->get_int64_word(n);
   return decl->get_int64_word(n);
@@ -260,7 +260,7 @@ get_int64_word(int n) const {
 //               See also has_double_word().
 //               See also has_double_word().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE double ConfigVariable::
 INLINE double ConfigVariable::
-get_double_word(int n) const {
+get_double_word(size_t n) const {
   nassertr(is_constructed(), 0.0);
   nassertr(is_constructed(), 0.0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   const ConfigDeclaration *decl = _core->get_declaration(0);
   return decl->get_double_word(n);
   return decl->get_double_word(n);
@@ -273,7 +273,7 @@ get_double_word(int n) const {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariable::
 INLINE void ConfigVariable::
-set_string_word(int n, const string &value) {
+set_string_word(size_t n, const string &value) {
   nassertv(is_constructed());
   nassertv(is_constructed());
   _core->make_local_value()->set_string_word(n, value);
   _core->make_local_value()->set_string_word(n, value);
 }
 }
@@ -285,7 +285,7 @@ set_string_word(int n, const string &value) {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariable::
 INLINE void ConfigVariable::
-set_bool_word(int n, bool value) {
+set_bool_word(size_t n, bool value) {
   nassertv(is_constructed());
   nassertv(is_constructed());
   _core->make_local_value()->set_bool_word(n, value);
   _core->make_local_value()->set_bool_word(n, value);
 }
 }
@@ -297,7 +297,7 @@ set_bool_word(int n, bool value) {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariable::
 INLINE void ConfigVariable::
-set_int_word(int n, int value) {
+set_int_word(size_t n, int value) {
   nassertv(is_constructed());
   nassertv(is_constructed());
   _core->make_local_value()->set_int_word(n, value);
   _core->make_local_value()->set_int_word(n, value);
 }
 }
@@ -309,7 +309,7 @@ set_int_word(int n, int value) {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariable::
 INLINE void ConfigVariable::
-set_int64_word(int n, PN_int64 value) {
+set_int64_word(size_t n, PN_int64 value) {
   nassertv(is_constructed());
   nassertv(is_constructed());
   _core->make_local_value()->set_int64_word(n, value);
   _core->make_local_value()->set_int64_word(n, value);
 }
 }
@@ -321,7 +321,7 @@ set_int64_word(int n, PN_int64 value) {
 //               affecting the other words.
 //               affecting the other words.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariable::
 INLINE void ConfigVariable::
-set_double_word(int n, double value) {
+set_double_word(size_t n, double value) {
   nassertv(is_constructed());
   nassertv(is_constructed());
   _core->make_local_value()->set_double_word(n, value);
   _core->make_local_value()->set_double_word(n, value);
 }
 }

+ 16 - 16
dtool/src/prc/configVariable.h

@@ -48,25 +48,25 @@ PUBLISHED:
   INLINE void set_string_value(const string &value);
   INLINE void set_string_value(const string &value);
   INLINE void clear_value();
   INLINE void clear_value();
 
 
-  INLINE int get_num_words() const;
+  INLINE size_t get_num_words() const;
 
 
-  INLINE bool has_string_word(int n) const;
-  INLINE bool has_bool_word(int n) const;
-  INLINE bool has_int_word(int n) const;
-  INLINE bool has_int64_word(int n) const;
-  INLINE bool has_double_word(int n) const;
+  INLINE bool has_string_word(size_t n) const;
+  INLINE bool has_bool_word(size_t n) const;
+  INLINE bool has_int_word(size_t n) const;
+  INLINE bool has_int64_word(size_t n) const;
+  INLINE bool has_double_word(size_t n) const;
 
 
-  INLINE string get_string_word(int n) const;
-  INLINE bool get_bool_word(int n) const;
-  INLINE int get_int_word(int n) const;
-  INLINE PN_int64 get_int64_word(int n) const;
-  INLINE double get_double_word(int n) const;
+  INLINE string get_string_word(size_t n) const;
+  INLINE bool get_bool_word(size_t n) const;
+  INLINE int get_int_word(size_t n) const;
+  INLINE PN_int64 get_int64_word(size_t n) const;
+  INLINE double get_double_word(size_t n) const;
 
 
-  INLINE void set_string_word(int n, const string &value);
-  INLINE void set_bool_word(int n, bool value);
-  INLINE void set_int_word(int n, int value);
-  INLINE void set_int64_word(int n, PN_int64 value);
-  INLINE void set_double_word(int n, double value);
+  INLINE void set_string_word(size_t n, const string &value);
+  INLINE void set_bool_word(size_t n, bool value);
+  INLINE void set_int_word(size_t n, int value);
+  INLINE void set_int64_word(size_t n, PN_int64 value);
+  INLINE void set_double_word(size_t n, double value);
 
 
 protected:
 protected:
   INLINE bool is_constructed() const;
   INLINE bool is_constructed() const;

+ 4 - 4
dtool/src/prc/configVariableBool.I

@@ -89,7 +89,7 @@ operator bool () const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of unique words in the variable.
 //  Description: Returns the number of unique words in the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableBool::
+INLINE size_t ConfigVariableBool::
 size() const {
 size() const {
   return get_num_words();
   return get_num_words();
 }
 }
@@ -100,7 +100,7 @@ size() const {
 //  Description: Returns the value of the variable's nth word.
 //  Description: Returns the value of the variable's nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigVariableBool::
 INLINE bool ConfigVariableBool::
-operator [] (int n) const {
+operator [] (size_t n) const {
   return get_word(n);
   return get_word(n);
 }
 }
 
 
@@ -150,7 +150,7 @@ get_default_value() const {
 //  Description: Returns the variable's nth value.
 //  Description: Returns the variable's nth value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE bool ConfigVariableBool::
 INLINE bool ConfigVariableBool::
-get_word(int n) const {
+get_word(size_t n) const {
   return get_bool_word(n);
   return get_bool_word(n);
 }
 }
 
 
@@ -161,6 +161,6 @@ get_word(int n) const {
 //               local copy of the variable's overall value.
 //               local copy of the variable's overall value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariableBool::
 INLINE void ConfigVariableBool::
-set_word(int n, bool value) {
+set_word(size_t n, bool value) {
   set_bool_word(n, value);
   set_bool_word(n, value);
 }
 }

+ 4 - 4
dtool/src/prc/configVariableBool.h

@@ -34,15 +34,15 @@ PUBLISHED:
   INLINE void operator = (bool value);
   INLINE void operator = (bool value);
   INLINE operator bool () const;
   INLINE operator bool () const;
 
 
-  INLINE int size() const;
-  INLINE bool operator [] (int n) const;
+  INLINE size_t size() const;
+  INLINE bool operator [] (size_t n) const;
 
 
   INLINE void set_value(bool value);
   INLINE void set_value(bool value);
   INLINE bool get_value() const;
   INLINE bool get_value() const;
   INLINE bool get_default_value() const;
   INLINE bool get_default_value() const;
 
 
-  INLINE bool get_word(int n) const;
-  INLINE void set_word(int n, bool value);
+  INLINE bool get_word(size_t n) const;
+  INLINE void set_word(size_t n, bool value);
 
 
 private:
 private:
   AtomicAdjust::Integer _local_modified;
   AtomicAdjust::Integer _local_modified;

+ 10 - 10
dtool/src/prc/configVariableCore.I

@@ -166,7 +166,7 @@ has_local_value() const {
 //               variable.  This is not exactly the same as the number
 //               variable.  This is not exactly the same as the number
 //               of declarations; see get_reference().
 //               of declarations; see get_reference().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableCore::
+INLINE size_t ConfigVariableCore::
 get_num_references() const {
 get_num_references() const {
   check_sort_declarations();
   check_sort_declarations();
   return _declarations.size();
   return _declarations.size();
@@ -184,9 +184,9 @@ get_num_references() const {
 //               untrusted files.
 //               untrusted files.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const ConfigDeclaration *ConfigVariableCore::
 INLINE const ConfigDeclaration *ConfigVariableCore::
-get_reference(int n) const {
+get_reference(size_t n) const {
   check_sort_declarations();
   check_sort_declarations();
-  nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL);
+  nassertr(n < _declarations.size(), (ConfigDeclaration *)NULL);
   return _declarations[n];
   return _declarations[n];
 }
 }
 
 
@@ -197,7 +197,7 @@ get_reference(int n) const {
 //               reference this variable.  See also
 //               reference this variable.  See also
 //               get_num_references().
 //               get_num_references().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableCore::
+INLINE size_t ConfigVariableCore::
 get_num_trusted_references() const {
 get_num_trusted_references() const {
   check_sort_declarations();
   check_sort_declarations();
   return _trusted_declarations.size();
   return _trusted_declarations.size();
@@ -218,9 +218,9 @@ get_num_trusted_references() const {
 //               untrusted ones.
 //               untrusted ones.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const ConfigDeclaration *ConfigVariableCore::
 INLINE const ConfigDeclaration *ConfigVariableCore::
-get_trusted_reference(int n) const {
+get_trusted_reference(size_t n) const {
   check_sort_declarations();
   check_sort_declarations();
-  nassertr(n >= 0 && n < (int)_trusted_declarations.size(), (ConfigDeclaration *)NULL);
+  nassertr(n < _trusted_declarations.size(), (ConfigDeclaration *)NULL);
   return _trusted_declarations[n];
   return _trusted_declarations[n];
 }
 }
 
 
@@ -230,7 +230,7 @@ get_trusted_reference(int n) const {
 //  Description: Returns the number of trusted, unique (by string
 //  Description: Returns the number of trusted, unique (by string
 //               value) values there exist for this variable.
 //               value) values there exist for this variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableCore::
+INLINE size_t ConfigVariableCore::
 get_num_unique_references() const {
 get_num_unique_references() const {
   check_sort_declarations();
   check_sort_declarations();
   return _unique_declarations.size();
   return _unique_declarations.size();
@@ -245,9 +245,9 @@ get_num_unique_references() const {
 //               are removed.
 //               are removed.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const ConfigDeclaration *ConfigVariableCore::
 INLINE const ConfigDeclaration *ConfigVariableCore::
-get_unique_reference(int n) const {
+get_unique_reference(size_t n) const {
   check_sort_declarations();
   check_sort_declarations();
-  nassertr(n >= 0 && n < (int)_unique_declarations.size(), (ConfigDeclaration *)NULL);
+  nassertr(n < _unique_declarations.size(), (ConfigDeclaration *)NULL);
   return _unique_declarations[n];
   return _unique_declarations[n];
 }
 }
 
 
@@ -263,7 +263,7 @@ check_sort_declarations() const {
   // loaded.  This may unsort the list by adding a bunch more
   // loaded.  This may unsort the list by adding a bunch more
   // declarations.
   // declarations.
   ConfigPageManager::get_global_ptr()->load_implicit_pages();
   ConfigPageManager::get_global_ptr()->load_implicit_pages();
-  
+
   // Then sort the list if it needs it.
   // Then sort the list if it needs it.
   if (!_declarations_sorted) {
   if (!_declarations_sorted) {
     ((ConfigVariableCore *)this)->sort_declarations();
     ((ConfigVariableCore *)this)->sort_declarations();

+ 3 - 3
dtool/src/prc/configVariableCore.cxx

@@ -318,7 +318,7 @@ has_value() const {
 //               defined, this will always be at least 1 (for the
 //               defined, this will always be at least 1 (for the
 //               default value, at least).
 //               default value, at least).
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int ConfigVariableCore::
+size_t ConfigVariableCore::
 get_num_declarations() const {
 get_num_declarations() const {
   if (has_local_value()) {
   if (has_local_value()) {
     return 1;
     return 1;
@@ -343,7 +343,7 @@ get_num_declarations() const {
 //               variable.
 //               variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 const ConfigDeclaration *ConfigVariableCore::
 const ConfigDeclaration *ConfigVariableCore::
-get_declaration(int n) const {
+get_declaration(size_t n) const {
   ((ConfigVariableCore *)this)->_value_queried = true;
   ((ConfigVariableCore *)this)->_value_queried = true;
   if (_default_value == (ConfigDeclaration *)NULL) {
   if (_default_value == (ConfigDeclaration *)NULL) {
     prc_cat->warning()
     prc_cat->warning()
@@ -356,7 +356,7 @@ get_declaration(int n) const {
     return _local_value;
     return _local_value;
   }
   }
   check_sort_declarations();
   check_sort_declarations();
-  if (n >= 0 && n < (int)_trusted_declarations.size()) {
+  if (n < _trusted_declarations.size()) {
     return _trusted_declarations[n];
     return _trusted_declarations[n];
   }
   }
   return _default_value;
   return _default_value;

+ 8 - 8
dtool/src/prc/configVariableCore.h

@@ -64,20 +64,20 @@ PUBLISHED:
   INLINE bool has_local_value() const;
   INLINE bool has_local_value() const;
 
 
   bool has_value() const;
   bool has_value() const;
-  int get_num_declarations() const;
-  const ConfigDeclaration *get_declaration(int n) const;
+  size_t get_num_declarations() const;
+  const ConfigDeclaration *get_declaration(size_t n) const;
   MAKE_SEQ(get_declarations, get_num_declarations, get_declaration);
   MAKE_SEQ(get_declarations, get_num_declarations, get_declaration);
 
 
-  INLINE int get_num_references() const;
-  INLINE const ConfigDeclaration *get_reference(int n) const;
+  INLINE size_t get_num_references() const;
+  INLINE const ConfigDeclaration *get_reference(size_t n) const;
   MAKE_SEQ(get_references, get_num_references, get_reference);
   MAKE_SEQ(get_references, get_num_references, get_reference);
 
 
-  INLINE int get_num_trusted_references() const;
-  INLINE const ConfigDeclaration *get_trusted_reference(int n) const;
+  INLINE size_t get_num_trusted_references() const;
+  INLINE const ConfigDeclaration *get_trusted_reference(size_t n) const;
   MAKE_SEQ(get_trusted_references, get_num_trusted_references, get_trusted_reference);
   MAKE_SEQ(get_trusted_references, get_num_trusted_references, get_trusted_reference);
 
 
-  INLINE int get_num_unique_references() const;
-  INLINE const ConfigDeclaration *get_unique_reference(int n) const;
+  INLINE size_t get_num_unique_references() const;
+  INLINE const ConfigDeclaration *get_unique_reference(size_t n) const;
   MAKE_SEQ(get_unique_references, get_num_unique_references, get_unique_reference);
   MAKE_SEQ(get_unique_references, get_num_unique_references, get_unique_reference);
 
 
   void output(ostream &out) const;
   void output(ostream &out) const;

+ 4 - 4
dtool/src/prc/configVariableDouble.I

@@ -89,7 +89,7 @@ operator double () const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of unique words in the variable.
 //  Description: Returns the number of unique words in the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableDouble::
+INLINE size_t ConfigVariableDouble::
 size() const {
 size() const {
   return get_num_words();
   return get_num_words();
 }
 }
@@ -100,7 +100,7 @@ size() const {
 //  Description: Returns the value of the variable's nth word.
 //  Description: Returns the value of the variable's nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE double ConfigVariableDouble::
 INLINE double ConfigVariableDouble::
-operator [] (int n) const {
+operator [] (size_t n) const {
   return get_word(n);
   return get_word(n);
 }
 }
 
 
@@ -150,7 +150,7 @@ get_default_value() const {
 //  Description: Returns the variable's nth value.
 //  Description: Returns the variable's nth value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE double ConfigVariableDouble::
 INLINE double ConfigVariableDouble::
-get_word(int n) const {
+get_word(size_t n) const {
   return get_double_word(n);
   return get_double_word(n);
 }
 }
 
 
@@ -161,6 +161,6 @@ get_word(int n) const {
 //               local copy of the variable's overall value.
 //               local copy of the variable's overall value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariableDouble::
 INLINE void ConfigVariableDouble::
-set_word(int n, double value) {
+set_word(size_t n, double value) {
   set_double_word(n, value);
   set_double_word(n, value);
 }
 }

+ 4 - 4
dtool/src/prc/configVariableDouble.h

@@ -36,15 +36,15 @@ PUBLISHED:
   INLINE void operator = (double value);
   INLINE void operator = (double value);
   INLINE operator double () const;
   INLINE operator double () const;
 
 
-  INLINE int size() const;
-  INLINE double operator [] (int n) const;
+  INLINE size_t size() const;
+  INLINE double operator [] (size_t n) const;
 
 
   INLINE void set_value(double value);
   INLINE void set_value(double value);
   INLINE double get_value() const;
   INLINE double get_value() const;
   INLINE double get_default_value() const;
   INLINE double get_default_value() const;
 
 
-  INLINE double get_word(int n) const;
-  INLINE void set_word(int n, double value);
+  INLINE double get_word(size_t n) const;
+  INLINE void set_word(size_t n, double value);
 
 
 private:
 private:
   void set_default_value(double default_value);
   void set_default_value(double default_value);

+ 4 - 4
dtool/src/prc/configVariableEnum.I

@@ -95,7 +95,7 @@ operator EnumType () const {
 //  Description: Returns the number of unique words in the variable.
 //  Description: Returns the number of unique words in the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 template<class EnumType>
 template<class EnumType>
-INLINE int ConfigVariableEnum<EnumType>::
+INLINE size_t ConfigVariableEnum<EnumType>::
 size() const {
 size() const {
   return get_num_words();
   return get_num_words();
 }
 }
@@ -107,7 +107,7 @@ size() const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 template<class EnumType>
 template<class EnumType>
 INLINE EnumType ConfigVariableEnum<EnumType>::
 INLINE EnumType ConfigVariableEnum<EnumType>::
-operator [] (int n) const {
+operator [] (size_t n) const {
   return get_word(n);
   return get_word(n);
 }
 }
 
 
@@ -163,7 +163,7 @@ get_default_value() const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 template<class EnumType>
 template<class EnumType>
 INLINE EnumType ConfigVariableEnum<EnumType>::
 INLINE EnumType ConfigVariableEnum<EnumType>::
-get_word(int n) const {
+get_word(size_t n) const {
   return (EnumType)parse_string(get_string_word(n));
   return (EnumType)parse_string(get_string_word(n));
 }
 }
 
 
@@ -175,7 +175,7 @@ get_word(int n) const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 template<class EnumType>
 template<class EnumType>
 INLINE void ConfigVariableEnum<EnumType>::
 INLINE void ConfigVariableEnum<EnumType>::
-set_word(int n, EnumType value) {
+set_word(size_t n, EnumType value) {
   set_string_word(n, format_enum(value));
   set_string_word(n, format_enum(value));
 }
 }
 
 

+ 4 - 4
dtool/src/prc/configVariableEnum.h

@@ -45,15 +45,15 @@ public:
   INLINE void operator = (EnumType value);
   INLINE void operator = (EnumType value);
   INLINE operator EnumType () const;
   INLINE operator EnumType () const;
 
 
-  INLINE int size() const;
-  INLINE EnumType operator [] (int n) const;
+  INLINE size_t size() const;
+  INLINE EnumType operator [] (size_t n) const;
 
 
   INLINE void set_value(EnumType value);
   INLINE void set_value(EnumType value);
   INLINE EnumType get_value() const;
   INLINE EnumType get_value() const;
   INLINE EnumType get_default_value() const;
   INLINE EnumType get_default_value() const;
 
 
-  INLINE EnumType get_word(int n) const;
-  INLINE void set_word(int n, EnumType value);
+  INLINE EnumType get_word(size_t n) const;
+  INLINE void set_word(size_t n, EnumType value);
 
 
 private:
 private:
   INLINE EnumType parse_string(const string &value) const;
   INLINE EnumType parse_string(const string &value) const;

+ 3 - 3
dtool/src/prc/configVariableFilename.I

@@ -101,7 +101,7 @@ length() const {
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE char ConfigVariableFilename::
 INLINE char ConfigVariableFilename::
-operator [] (int n) const {
+operator [] (size_t n) const {
   return get_ref_value()[n];
   return get_ref_value()[n];
 }
 }
 
 
@@ -254,7 +254,7 @@ get_default_value() const {
 //  Description: Returns the variable's nth value.
 //  Description: Returns the variable's nth value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE Filename ConfigVariableFilename::
 INLINE Filename ConfigVariableFilename::
-get_word(int n) const {
+get_word(size_t n) const {
   return Filename::expand_from(get_string_word(n));
   return Filename::expand_from(get_string_word(n));
 }
 }
 
 
@@ -265,7 +265,7 @@ get_word(int n) const {
 //               local copy of the variable's overall value.
 //               local copy of the variable's overall value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariableFilename::
 INLINE void ConfigVariableFilename::
-set_word(int n, const Filename &value) {
+set_word(size_t n, const Filename &value) {
   set_string_word(n, value);
   set_string_word(n, value);
 }
 }
 
 

+ 3 - 3
dtool/src/prc/configVariableFilename.h

@@ -41,7 +41,7 @@ PUBLISHED:
   INLINE const char *c_str() const;
   INLINE const char *c_str() const;
   INLINE bool empty() const;
   INLINE bool empty() const;
   INLINE size_t length() const;
   INLINE size_t length() const;
-  INLINE char operator [] (int n) const;
+  INLINE char operator [] (size_t n) const;
 
 
   INLINE string get_fullpath() const;
   INLINE string get_fullpath() const;
   INLINE string get_dirname() const;
   INLINE string get_dirname() const;
@@ -59,8 +59,8 @@ PUBLISHED:
   INLINE Filename get_value() const;
   INLINE Filename get_value() const;
   INLINE Filename get_default_value() const;
   INLINE Filename get_default_value() const;
 
 
-  INLINE Filename get_word(int n) const;
-  INLINE void set_word(int n, const Filename &value);
+  INLINE Filename get_word(size_t n) const;
+  INLINE void set_word(size_t n, const Filename &value);
 
 
 private:
 private:
   void reload_cache();
   void reload_cache();

+ 4 - 4
dtool/src/prc/configVariableInt.I

@@ -89,7 +89,7 @@ operator int () const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of unique words in the variable.
 //  Description: Returns the number of unique words in the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableInt::
+INLINE size_t ConfigVariableInt::
 size() const {
 size() const {
   return get_num_words();
   return get_num_words();
 }
 }
@@ -100,7 +100,7 @@ size() const {
 //  Description: Returns the value of the variable's nth word.
 //  Description: Returns the value of the variable's nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE int ConfigVariableInt::
 INLINE int ConfigVariableInt::
-operator [] (int n) const {
+operator [] (size_t n) const {
   return get_word(n);
   return get_word(n);
 }
 }
 
 
@@ -150,7 +150,7 @@ get_default_value() const {
 //  Description: Returns the variable's nth value.
 //  Description: Returns the variable's nth value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE int ConfigVariableInt::
 INLINE int ConfigVariableInt::
-get_word(int n) const {
+get_word(size_t n) const {
   return get_int_word(n);
   return get_int_word(n);
 }
 }
 
 
@@ -161,7 +161,7 @@ get_word(int n) const {
 //               local copy of the variable's overall value.
 //               local copy of the variable's overall value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariableInt::
 INLINE void ConfigVariableInt::
-set_word(int n, int value) {
+set_word(size_t n, int value) {
   set_int_word(n, value);
   set_int_word(n, value);
 }
 }
 
 

+ 4 - 4
dtool/src/prc/configVariableInt.h

@@ -36,15 +36,15 @@ PUBLISHED:
   INLINE void operator = (int value);
   INLINE void operator = (int value);
   INLINE operator int () const;
   INLINE operator int () const;
 
 
-  INLINE int size() const;
-  INLINE int operator [] (int n) const;
+  INLINE size_t size() const;
+  INLINE int operator [] (size_t n) const;
 
 
   INLINE void set_value(int value);
   INLINE void set_value(int value);
   INLINE int get_value() const;
   INLINE int get_value() const;
   INLINE int get_default_value() const;
   INLINE int get_default_value() const;
 
 
-  INLINE int get_word(int n) const;
-  INLINE void set_word(int n, int value);
+  INLINE int get_word(size_t n) const;
+  INLINE void set_word(size_t n, int value);
 
 
 private:
 private:
   void set_default_value(int default_value);
   void set_default_value(int default_value);

+ 10 - 10
dtool/src/prc/configVariableInt64.I

@@ -29,11 +29,11 @@ ConfigVariableInt64(const string &name) :
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: ConfigVariableInt64::Constructor
 //     Function: ConfigVariableInt64::Constructor
 //       Access: Published
 //       Access: Published
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE ConfigVariableInt64::
 INLINE ConfigVariableInt64::
-ConfigVariableInt64(const string &name, PN_int64 default_value, 
-                  const string &description, PN_int64 flags) :
+ConfigVariableInt64(const string &name, PN_int64 default_value,
+                    const string &description, int flags) :
 #ifdef PRC_SAVE_DESCRIPTIONS
 #ifdef PRC_SAVE_DESCRIPTIONS
   ConfigVariable(name, ConfigVariableCore::VT_int64, description, flags),
   ConfigVariable(name, ConfigVariableCore::VT_int64, description, flags),
 #else
 #else
@@ -48,11 +48,11 @@ ConfigVariableInt64(const string &name, PN_int64 default_value,
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: ConfigVariableInt64::Constructor
 //     Function: ConfigVariableInt64::Constructor
 //       Access: Published
 //       Access: Published
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE ConfigVariableInt64::
 INLINE ConfigVariableInt64::
-ConfigVariableInt64(const string &name, const string &default_value, 
-                  const string &description, PN_int64 flags) :
+ConfigVariableInt64(const string &name, const string &default_value,
+                    const string &description, int flags) :
 #ifdef PRC_SAVE_DESCRIPTIONS
 #ifdef PRC_SAVE_DESCRIPTIONS
   ConfigVariable(name, ConfigVariableCore::VT_int64, description, flags),
   ConfigVariable(name, ConfigVariableCore::VT_int64, description, flags),
 #else
 #else
@@ -89,7 +89,7 @@ operator PN_int64 () const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of unique words in the variable.
 //  Description: Returns the number of unique words in the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE PN_int64 ConfigVariableInt64::
+INLINE size_t ConfigVariableInt64::
 size() const {
 size() const {
   return get_num_words();
   return get_num_words();
 }
 }
@@ -100,7 +100,7 @@ size() const {
 //  Description: Returns the value of the variable's nth word.
 //  Description: Returns the value of the variable's nth word.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PN_int64 ConfigVariableInt64::
 INLINE PN_int64 ConfigVariableInt64::
-operator [] (int n) const {
+operator [] (size_t n) const {
   return get_word(n);
   return get_word(n);
 }
 }
 
 
@@ -150,7 +150,7 @@ get_default_value() const {
 //  Description: Returns the variable's nth value.
 //  Description: Returns the variable's nth value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PN_int64 ConfigVariableInt64::
 INLINE PN_int64 ConfigVariableInt64::
-get_word(int n) const {
+get_word(size_t n) const {
   return get_int64_word(n);
   return get_int64_word(n);
 }
 }
 
 
@@ -161,7 +161,7 @@ get_word(int n) const {
 //               local copy of the variable's overall value.
 //               local copy of the variable's overall value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariableInt64::
 INLINE void ConfigVariableInt64::
-set_word(int n, PN_int64 value) {
+set_word(size_t n, PN_int64 value) {
   set_int64_word(n, value);
   set_int64_word(n, value);
 }
 }
 
 

+ 8 - 8
dtool/src/prc/configVariableInt64.h

@@ -28,24 +28,24 @@ class EXPCL_DTOOLCONFIG ConfigVariableInt64 : public ConfigVariable {
 PUBLISHED:
 PUBLISHED:
   INLINE ConfigVariableInt64(const string &name);
   INLINE ConfigVariableInt64(const string &name);
   INLINE ConfigVariableInt64(const string &name, PN_int64 default_value,
   INLINE ConfigVariableInt64(const string &name, PN_int64 default_value,
-                             const string &description = string(), 
-                             PN_int64 flags = 0);
+                             const string &description = string(),
+                             int flags = 0);
   INLINE ConfigVariableInt64(const string &name, const string &default_value,
   INLINE ConfigVariableInt64(const string &name, const string &default_value,
-                             const string &description = string(), 
-                             PN_int64 flags = 0);
+                             const string &description = string(),
+                             int flags = 0);
 
 
   INLINE void operator = (PN_int64 value);
   INLINE void operator = (PN_int64 value);
   INLINE operator PN_int64 () const;
   INLINE operator PN_int64 () const;
 
 
-  INLINE PN_int64 size() const;
-  INLINE PN_int64 operator [] (int n) const;
+  INLINE size_t size() const;
+  INLINE PN_int64 operator [] (size_t n) const;
 
 
   INLINE void set_value(PN_int64 value);
   INLINE void set_value(PN_int64 value);
   INLINE PN_int64 get_value() const;
   INLINE PN_int64 get_value() const;
   INLINE PN_int64 get_default_value() const;
   INLINE PN_int64 get_default_value() const;
 
 
-  INLINE PN_int64 get_word(int n) const;
-  INLINE void set_word(int n, PN_int64 value);
+  INLINE PN_int64 get_word(size_t n) const;
+  INLINE void set_word(size_t n, PN_int64 value);
 
 
 private:
 private:
   void set_default_value(PN_int64 default_value);
   void set_default_value(PN_int64 default_value);

+ 6 - 6
dtool/src/prc/configVariableList.I

@@ -50,7 +50,7 @@ ConfigVariableList(const string &name,
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of values in the variable.
 //  Description: Returns the number of values in the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableList::
+INLINE size_t ConfigVariableList::
 get_num_values() const {
 get_num_values() const {
   nassertr(_core != (ConfigVariableCore *)NULL, 0);
   nassertr(_core != (ConfigVariableCore *)NULL, 0);
   return _core->get_num_trusted_references();
   return _core->get_num_trusted_references();
@@ -62,7 +62,7 @@ get_num_values() const {
 //  Description: Returns the nth value of the variable.
 //  Description: Returns the nth value of the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigVariableList::
 INLINE string ConfigVariableList::
-get_string_value(int n) const {
+get_string_value(size_t n) const {
   nassertr(_core != (ConfigVariableCore *)NULL, string());
   nassertr(_core != (ConfigVariableCore *)NULL, string());
   const ConfigDeclaration *decl = _core->get_trusted_reference(n);
   const ConfigDeclaration *decl = _core->get_trusted_reference(n);
   if (decl != (ConfigDeclaration *)NULL) {
   if (decl != (ConfigDeclaration *)NULL) {
@@ -76,7 +76,7 @@ get_string_value(int n) const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of unique values in the variable.
 //  Description: Returns the number of unique values in the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableList::
+INLINE size_t ConfigVariableList::
 get_num_unique_values() const {
 get_num_unique_values() const {
   nassertr(_core != (ConfigVariableCore *)NULL, 0);
   nassertr(_core != (ConfigVariableCore *)NULL, 0);
   return _core->get_num_unique_references();
   return _core->get_num_unique_references();
@@ -88,7 +88,7 @@ get_num_unique_values() const {
 //  Description: Returns the nth unique value of the variable.
 //  Description: Returns the nth unique value of the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigVariableList::
 INLINE string ConfigVariableList::
-get_unique_value(int n) const {
+get_unique_value(size_t n) const {
   nassertr(_core != (ConfigVariableCore *)NULL, string());
   nassertr(_core != (ConfigVariableCore *)NULL, string());
   const ConfigDeclaration *decl = _core->get_unique_reference(n);
   const ConfigDeclaration *decl = _core->get_unique_reference(n);
   if (decl != (ConfigDeclaration *)NULL) {
   if (decl != (ConfigDeclaration *)NULL) {
@@ -102,7 +102,7 @@ get_unique_value(int n) const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of unique values of the variable.
 //  Description: Returns the number of unique values of the variable.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableList::
+INLINE size_t ConfigVariableList::
 size() const {
 size() const {
   return get_num_unique_values();
   return get_num_unique_values();
 }
 }
@@ -116,7 +116,7 @@ size() const {
 //               get_num_unique_values().
 //               get_num_unique_values().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigVariableList::
 INLINE string ConfigVariableList::
-operator [] (int n) const {
+operator [] (size_t n) const {
   return get_unique_value(n);
   return get_unique_value(n);
 }
 }
 
 

+ 4 - 4
dtool/src/prc/configVariableList.cxx

@@ -17,7 +17,7 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: ConfigVariableList::output
 //     Function: ConfigVariableList::output
 //       Access: Published
 //       Access: Published
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigVariableList::
 void ConfigVariableList::
 output(ostream &out) const {
 output(ostream &out) const {
@@ -27,12 +27,12 @@ output(ostream &out) const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: ConfigVariableList::write
 //     Function: ConfigVariableList::write
 //       Access: Published
 //       Access: Published
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void ConfigVariableList::
 void ConfigVariableList::
 write(ostream &out) const {
 write(ostream &out) const {
-  int num_values = get_num_values();
-  for (int i = 0; i < num_values; ++i) {
+  size_t num_values = get_num_values();
+  for (size_t i = 0; i < num_values; ++i) {
     out << get_string_value(i) << "\n";
     out << get_string_value(i) << "\n";
   }
   }
 }
 }

+ 6 - 6
dtool/src/prc/configVariableList.h

@@ -39,14 +39,14 @@ PUBLISHED:
                             int flags = 0);
                             int flags = 0);
   INLINE ~ConfigVariableList();
   INLINE ~ConfigVariableList();
 
 
-  INLINE int get_num_values() const;
-  INLINE string get_string_value(int n) const;
+  INLINE size_t get_num_values() const;
+  INLINE string get_string_value(size_t n) const;
 
 
-  INLINE int get_num_unique_values() const;
-  INLINE string get_unique_value(int n) const;
+  INLINE size_t get_num_unique_values() const;
+  INLINE string get_unique_value(size_t n) const;
 
 
-  INLINE int size() const;
-  INLINE string operator [] (int n) const;
+  INLINE size_t size() const;
+  INLINE string operator [] (size_t n) const;
 
 
   void output(ostream &out) const;
   void output(ostream &out) const;
   void write(ostream &out) const;
   void write(ostream &out) const;

+ 3 - 3
dtool/src/prc/configVariableManager.I

@@ -19,7 +19,7 @@
 //  Description: Returns the current number of active ConfigVariableCores in
 //  Description: Returns the current number of active ConfigVariableCores in
 //               the world.
 //               the world.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableManager::
+INLINE size_t ConfigVariableManager::
 get_num_variables() const {
 get_num_variables() const {
   return _variables.size();
   return _variables.size();
 }
 }
@@ -30,8 +30,8 @@ get_num_variables() const {
 //  Description: Returns the nth active ConfigVariableCore in the world.
 //  Description: Returns the nth active ConfigVariableCore in the world.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE ConfigVariableCore *ConfigVariableManager::
 INLINE ConfigVariableCore *ConfigVariableManager::
-get_variable(int n) const {
-  nassertr(n >= 0 && n < (int)_variables.size(), (ConfigVariableCore *)NULL);
+get_variable(size_t n) const {
+  nassertr(n < _variables.size(), (ConfigVariableCore *)NULL);
   return _variables[n];
   return _variables[n];
 }
 }
 
 

+ 14 - 14
dtool/src/prc/configVariableManager.cxx

@@ -178,8 +178,8 @@ make_variable_template(const string &pattern,
 //               the list.
 //               the list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 string ConfigVariableManager::
 string ConfigVariableManager::
-get_variable_name(int n) const {
-  if (n >= 0 && n < (int)_variables.size()) {
+get_variable_name(size_t n) const {
+  if (n < _variables.size()) {
     return _variables[n]->get_name();
     return _variables[n]->get_name();
   }
   }
   return string();
   return string();
@@ -192,8 +192,8 @@ get_variable_name(int n) const {
 //               the list has been used by code, false otherwise.
 //               the list has been used by code, false otherwise.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool ConfigVariableManager::
 bool ConfigVariableManager::
-is_variable_used(int n) const {
-  if (n >= 0 && n < (int)_variables.size()) {
+is_variable_used(size_t n) const {
+  if (n < _variables.size()) {
     return _variables[n]->is_used();
     return _variables[n]->is_used();
   }
   }
   return false;
   return false;
@@ -251,22 +251,22 @@ write_prc_variables(ostream &out) const {
       if (variable->get_value_type() == ConfigVariableCore::VT_list ||
       if (variable->get_value_type() == ConfigVariableCore::VT_list ||
           variable->get_value_type() == ConfigVariableCore::VT_search_path) {
           variable->get_value_type() == ConfigVariableCore::VT_search_path) {
         // List all of the values for a "list" variable.
         // List all of the values for a "list" variable.
-        int num_references = variable->get_num_trusted_references();
-        for (int i = 0; i < num_references; i++) {
-          out << variable->get_name() << " " 
+        size_t num_references = variable->get_num_trusted_references();
+        for (size_t i = 0; i < num_references; ++i) {
+          out << variable->get_name() << " "
               << variable->get_trusted_reference(i)->get_string_value()
               << variable->get_trusted_reference(i)->get_string_value()
               << "\n";
               << "\n";
         }
         }
       } else {
       } else {
         // List just the one value for a non-list variable.
         // List just the one value for a non-list variable.
-        out << variable->get_name() << " " 
+        out << variable->get_name() << " "
             << variable->get_trusted_reference(0)->get_string_value()
             << variable->get_trusted_reference(0)->get_string_value()
             << "\n";
             << "\n";
       }
       }
     }
     }
   }
   }
 }
 }
-  
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: ConfigVariableManager::list_unused_variables
 //     Function: ConfigVariableManager::list_unused_variables
 //       Access: Published
 //       Access: Published
@@ -283,8 +283,8 @@ list_unused_variables() const {
     ConfigVariableCore *variable = (*ni).second;
     ConfigVariableCore *variable = (*ni).second;
     if (!variable->is_used()) {
     if (!variable->is_used()) {
       nout << variable->get_name() << "\n";
       nout << variable->get_name() << "\n";
-      int num_references = variable->get_num_references();
-      for (int i = 0; i < num_references; i++) {
+      size_t num_references = variable->get_num_references();
+      for (size_t i = 0; i < num_references; i++) {
         nout << "  " << variable->get_reference(i)->get_page()->get_name()
         nout << "  " << variable->get_reference(i)->get_page()->get_name()
              << "\n";
              << "\n";
       }
       }
@@ -380,13 +380,13 @@ list_variable(const ConfigVariableCore *variable,
       // We treat a "list" variable as a special case: list all of
       // We treat a "list" variable as a special case: list all of
       // its values.
       // its values.
       nout << "  current value:\n";
       nout << "  current value:\n";
-      int num_references = variable->get_num_trusted_references();
-      for (int i = 0; i < num_references; i++) {
+      size_t num_references = variable->get_num_trusted_references();
+      for (size_t i = 0; i < num_references; ++i) {
         decl = variable->get_trusted_reference(i);
         decl = variable->get_trusted_reference(i);
         nout << "    " << decl->get_string_value()
         nout << "    " << decl->get_string_value()
              << "  (from " << decl->get_page()->get_name() << ")\n";
              << "  (from " << decl->get_page()->get_name() << ")\n";
       }
       }
-      
+
     } else {
     } else {
       // An ordinary, non-list variable gets one line for its
       // An ordinary, non-list variable gets one line for its
       // current value (if it has one) and another line for its
       // current value (if it has one) and another line for its

+ 4 - 4
dtool/src/prc/configVariableManager.h

@@ -45,11 +45,11 @@ PUBLISHED:
                                              int flags = 0);
                                              int flags = 0);
 
 
 
 
-  INLINE int get_num_variables() const;
-  INLINE ConfigVariableCore *get_variable(int n) const;
+  INLINE size_t get_num_variables() const;
+  INLINE ConfigVariableCore *get_variable(size_t n) const;
   MAKE_SEQ(get_variables, get_num_variables, get_variable);
   MAKE_SEQ(get_variables, get_num_variables, get_variable);
-  string get_variable_name(int n) const;
-  bool is_variable_used(int n) const;
+  string get_variable_name(size_t n) const;
+  bool is_variable_used(size_t n) const;
 
 
   void output(ostream &out) const;
   void output(ostream &out) const;
   void write(ostream &out) const;
   void write(ostream &out) const;

+ 3 - 3
dtool/src/prc/configVariableSearchPath.I

@@ -240,7 +240,7 @@ is_empty() const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of directories on the search list.
 //  Description: Returns the number of directories on the search list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableSearchPath::
+INLINE size_t ConfigVariableSearchPath::
 get_num_directories() const {
 get_num_directories() const {
   return get_value().get_num_directories();
   return get_value().get_num_directories();
 }
 }
@@ -251,7 +251,7 @@ get_num_directories() const {
 //  Description: Returns the nth directory on the search list.
 //  Description: Returns the nth directory on the search list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const Filename &ConfigVariableSearchPath::
 INLINE const Filename &ConfigVariableSearchPath::
-get_directory(int n) const {
+get_directory(size_t n) const {
   return get_value().get_directory(n);
   return get_value().get_directory(n);
 }
 }
 
 
@@ -280,7 +280,7 @@ find_file(const Filename &filename) const {
 //               the results list first; otherwise, the newly-found
 //               the results list first; otherwise, the newly-found
 //               files will be appended to the list.
 //               files will be appended to the list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int ConfigVariableSearchPath::
+INLINE size_t ConfigVariableSearchPath::
 find_all_files(const Filename &filename,
 find_all_files(const Filename &filename,
                DSearchPath::Results &results) const {
                DSearchPath::Results &results) const {
   return get_value().find_all_files(filename, results);
   return get_value().find_all_files(filename, results);

+ 2 - 2
dtool/src/prc/configVariableSearchPath.cxx

@@ -28,8 +28,8 @@ reload_search_path() {
   _cache.clear();
   _cache.clear();
 
 
   _cache.append_path(_prefix);
   _cache.append_path(_prefix);
-  int num_unique_references = _core->get_num_unique_references();
-  for (int i = 0; i < num_unique_references; i++) {
+  size_t num_unique_references = _core->get_num_unique_references();
+  for (size_t i = 0; i < num_unique_references; i++) {
     const ConfigDeclaration *decl = _core->get_unique_reference(i);
     const ConfigDeclaration *decl = _core->get_unique_reference(i);
     const ConfigPage *page = decl->get_page();
     const ConfigPage *page = decl->get_page();
 
 

+ 4 - 4
dtool/src/prc/configVariableSearchPath.h

@@ -69,13 +69,13 @@ PUBLISHED:
   INLINE void prepend_path(const DSearchPath &path);
   INLINE void prepend_path(const DSearchPath &path);
 
 
   INLINE bool is_empty() const;
   INLINE bool is_empty() const;
-  INLINE int get_num_directories() const;
-  INLINE const Filename &get_directory(int n) const;
+  INLINE size_t get_num_directories() const;
+  INLINE const Filename &get_directory(size_t n) const;
   MAKE_SEQ(get_directories, get_num_directories, get_directory);
   MAKE_SEQ(get_directories, get_num_directories, get_directory);
 
 
   INLINE Filename find_file(const Filename &filename) const;
   INLINE Filename find_file(const Filename &filename) const;
-  INLINE int find_all_files(const Filename &filename, 
-                            DSearchPath::Results &results) const;
+  INLINE size_t find_all_files(const Filename &filename,
+                               DSearchPath::Results &results) const;
   INLINE DSearchPath::Results find_all_files(const Filename &filename) const;
   INLINE DSearchPath::Results find_all_files(const Filename &filename) const;
 
 
   INLINE void output(ostream &out) const;
   INLINE void output(ostream &out) const;

+ 4 - 4
dtool/src/prc/configVariableString.I

@@ -101,8 +101,8 @@ length() const {
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE char ConfigVariableString::
 INLINE char ConfigVariableString::
-operator [] (int n) const {
-  assert(n >= 0 && n < (int)length());
+operator [] (size_t n) const {
+  assert(n < length());
   return get_value()[n];
   return get_value()[n];
 }
 }
 
 
@@ -181,7 +181,7 @@ get_default_value() const {
 //  Description: Returns the variable's nth value.
 //  Description: Returns the variable's nth value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string ConfigVariableString::
 INLINE string ConfigVariableString::
-get_word(int n) const {
+get_word(size_t n) const {
   return get_string_word(n);
   return get_string_word(n);
 }
 }
 
 
@@ -192,6 +192,6 @@ get_word(int n) const {
 //               local copy of the variable's overall value.
 //               local copy of the variable's overall value.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void ConfigVariableString::
 INLINE void ConfigVariableString::
-set_word(int n, const string &value) {
+set_word(size_t n, const string &value) {
   set_string_word(n, value);
   set_string_word(n, value);
 }
 }

+ 3 - 3
dtool/src/prc/configVariableString.h

@@ -37,7 +37,7 @@ PUBLISHED:
   INLINE const char *c_str() const;
   INLINE const char *c_str() const;
   INLINE bool empty() const;
   INLINE bool empty() const;
   INLINE size_t length() const;
   INLINE size_t length() const;
-  INLINE char operator [] (int n) const;
+  INLINE char operator [] (size_t n) const;
 
 
   // Comparison operators are handy.
   // Comparison operators are handy.
   INLINE bool operator == (const string &other) const;
   INLINE bool operator == (const string &other) const;
@@ -48,8 +48,8 @@ PUBLISHED:
   INLINE const string &get_value() const;
   INLINE const string &get_value() const;
   INLINE string get_default_value() const;
   INLINE string get_default_value() const;
 
 
-  INLINE string get_word(int n) const;
-  INLINE void set_word(int n, const string &value);
+  INLINE string get_word(size_t n) const;
+  INLINE void set_word(size_t n, const string &value);
 
 
 private:
 private:
   AtomicAdjust::Integer _local_modified;
   AtomicAdjust::Integer _local_modified;

+ 7 - 7
dtool/src/prc/encryptStreamBuf.cxx

@@ -289,11 +289,11 @@ open_write(ostream *dest, bool owns_dest, const string &password) {
   // Now write the header information to the stream.
   // Now write the header information to the stream.
   StreamWriter sw(_dest, false);
   StreamWriter sw(_dest, false);
   nassertv((PN_uint16)nid == nid);
   nassertv((PN_uint16)nid == nid);
-  sw.add_uint16(nid);
+  sw.add_uint16((PN_uint16)nid);
   nassertv((PN_uint16)key_length == key_length);
   nassertv((PN_uint16)key_length == key_length);
-  sw.add_uint16(key_length);
+  sw.add_uint16((PN_uint16)key_length);
   nassertv((PN_uint16)count == count);
   nassertv((PN_uint16)count == count);
-  sw.add_uint16(count);
+  sw.add_uint16((PN_uint16)count);
   sw.append_data(iv, iv_length);
   sw.append_data(iv, iv_length);
 
 
   _write_valid = true;
   _write_valid = true;
@@ -347,7 +347,7 @@ overflow(int ch) {
 
 
   if (ch != EOF) {
   if (ch != EOF) {
     // Write one more character.
     // Write one more character.
-    char c = ch;
+    char c = (char)ch;
     write_chars(&c, 1);
     write_chars(&c, 1);
   }
   }
 
 
@@ -364,7 +364,7 @@ int EncryptStreamBuf::
 sync() {
 sync() {
   if (_source != (istream *)NULL) {
   if (_source != (istream *)NULL) {
     size_t n = egptr() - gptr();
     size_t n = egptr() - gptr();
-    gbump(n);
+    gbump((int)n);
   }
   }
 
 
   if (_dest != (ostream *)NULL) {
   if (_dest != (ostream *)NULL) {
@@ -396,7 +396,7 @@ underflow() {
     if (read_count != num_bytes) {
     if (read_count != num_bytes) {
       // Oops, we didn't read what we thought we would.
       // Oops, we didn't read what we thought we would.
       if (read_count == 0) {
       if (read_count == 0) {
-        gbump(num_bytes);
+        gbump((int)num_bytes);
         return EOF;
         return EOF;
       }
       }
 
 
@@ -404,7 +404,7 @@ underflow() {
       nassertr(read_count < num_bytes, EOF);
       nassertr(read_count < num_bytes, EOF);
       size_t delta = num_bytes - read_count;
       size_t delta = num_bytes - read_count;
       memmove(gptr() + delta, gptr(), read_count);
       memmove(gptr() + delta, gptr(), read_count);
-      gbump(delta);
+      gbump((int)delta);
     }
     }
   }
   }
 
 

+ 1 - 1
dtool/src/prc/notify.cxx

@@ -447,7 +447,7 @@ string_severity(const string &str) {
   for (string::const_iterator si = str.begin();
   for (string::const_iterator si = str.begin();
        si != str.end();
        si != str.end();
        ++si) {
        ++si) {
-    lstring += tolower(*si);
+    lstring += (char)tolower(*si);
   }
   }
 
 
   if (lstring == "spam") {
   if (lstring == "spam") {

+ 3 - 3
dtool/src/prc/notifyCategory.cxx

@@ -125,7 +125,7 @@ out(NotifySeverity severity, bool prefix) const {
 //  Description: Returns the number of child Categories of this
 //  Description: Returns the number of child Categories of this
 //               particular Category.
 //               particular Category.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int NotifyCategory::
+size_t NotifyCategory::
 get_num_children() const {
 get_num_children() const {
   return _children.size();
   return _children.size();
 }
 }
@@ -137,8 +137,8 @@ get_num_children() const {
 //               Category.
 //               Category.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 NotifyCategory *NotifyCategory::
 NotifyCategory *NotifyCategory::
-get_child(int i) const {
-  assert(i >= 0 && i < (int)_children.size());
+get_child(size_t i) const {
+  assert(i < _children.size());
   return _children[i];
   return _children[i];
 }
 }
 
 

+ 3 - 2
dtool/src/prc/notifyCategory.h

@@ -72,8 +72,9 @@ PUBLISHED:
   INLINE ostream &error(bool prefix = true) const;
   INLINE ostream &error(bool prefix = true) const;
   INLINE ostream &fatal(bool prefix = true) const;
   INLINE ostream &fatal(bool prefix = true) const;
 
 
-  int get_num_children() const;
-  NotifyCategory *get_child(int i) const;
+  size_t get_num_children() const;
+  NotifyCategory *get_child(size_t i) const;
+  MAKE_SEQ(get_children, get_num_children, get_child);
 
 
   static void set_server_delta(long delta);
   static void set_server_delta(long delta);
 
 

+ 11 - 11
dtool/src/prc/prcKeyRegistry.cxx

@@ -59,12 +59,12 @@ PrcKeyRegistry::
 //               code generated by the make-prc-key utility.
 //               code generated by the make-prc-key utility.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PrcKeyRegistry::
 void PrcKeyRegistry::
-record_keys(const KeyDef *key_def, int num_keys) {
-  for (int i = 0; i < num_keys; i++) {
+record_keys(const KeyDef *key_def, size_t num_keys) {
+  for (size_t i = 0; i < num_keys; i++) {
     const KeyDef *def = &key_def[i];
     const KeyDef *def = &key_def[i];
     if (def->_data != (char *)NULL) {
     if (def->_data != (char *)NULL) {
       // Clear the ith key.
       // Clear the ith key.
-      while ((int)_keys.size() <= i) {
+      while (_keys.size() <= i) {
         Key key;
         Key key;
         key._def = NULL;
         key._def = NULL;
         key._pkey = NULL;
         key._pkey = NULL;
@@ -93,9 +93,9 @@ record_keys(const KeyDef *key_def, int num_keys) {
 //               be freed via EVP_PKEY_free().
 //               be freed via EVP_PKEY_free().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PrcKeyRegistry::
 void PrcKeyRegistry::
-set_key(int n, EVP_PKEY *pkey, time_t generated_time) {
+set_key(size_t n, EVP_PKEY *pkey, time_t generated_time) {
   // Clear the nth key.
   // Clear the nth key.
-  while ((int)_keys.size() <= n) {
+  while (_keys.size() <= n) {
     Key key;
     Key key;
     key._def = NULL;
     key._def = NULL;
     key._pkey = NULL;
     key._pkey = NULL;
@@ -119,7 +119,7 @@ set_key(int n, EVP_PKEY *pkey, time_t generated_time) {
 //               might not strictly be the number of keys, since there
 //               might not strictly be the number of keys, since there
 //               may be holes in the list.
 //               may be holes in the list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int PrcKeyRegistry::
+size_t PrcKeyRegistry::
 get_num_keys() const {
 get_num_keys() const {
   return _keys.size();
   return _keys.size();
 }
 }
@@ -131,8 +131,8 @@ get_num_keys() const {
 //               not defined.
 //               not defined.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 EVP_PKEY *PrcKeyRegistry::
 EVP_PKEY *PrcKeyRegistry::
-get_key(int n) const {
-  nassertr(n >= 0 && n < (int)_keys.size(), (EVP_PKEY *)NULL);
+get_key(size_t n) const {
+  nassertr(n < _keys.size(), (EVP_PKEY *)NULL);
 
 
   if (_keys[n]._def != (KeyDef *)NULL) {
   if (_keys[n]._def != (KeyDef *)NULL) {
     if (_keys[n]._pkey == (EVP_PKEY *)NULL) {
     if (_keys[n]._pkey == (EVP_PKEY *)NULL) {
@@ -160,8 +160,8 @@ get_key(int n) const {
 //               generated, or 0 if the key is not defined.
 //               generated, or 0 if the key is not defined.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 time_t PrcKeyRegistry::
 time_t PrcKeyRegistry::
-get_generated_time(int n) const {
-  nassertr(n >= 0 && n < (int)_keys.size(), 0);
+get_generated_time(size_t n) const {
+  nassertr(n < _keys.size(), 0);
 
 
   return _keys[n]._generated_time;
   return _keys[n]._generated_time;
 }
 }
@@ -169,7 +169,7 @@ get_generated_time(int n) const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: PrcKeyRegistry::get_global_ptr
 //     Function: PrcKeyRegistry::get_global_ptr
 //       Access: Public, Static
 //       Access: Public, Static
-//  Description: 
+//  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 PrcKeyRegistry *PrcKeyRegistry::
 PrcKeyRegistry *PrcKeyRegistry::
 get_global_ptr() {
 get_global_ptr() {

+ 5 - 10
dtool/src/prc/prcKeyRegistry.h

@@ -52,12 +52,12 @@ public:
     time_t _generated_time;
     time_t _generated_time;
   };
   };
 
 
-  void record_keys(const KeyDef *key_def, int num_keys);
-  void set_key(int n, EVP_PKEY *pkey, time_t generated_time);
+  void record_keys(const KeyDef *key_def, size_t num_keys);
+  void set_key(size_t n, EVP_PKEY *pkey, time_t generated_time);
 
 
-  int get_num_keys() const;
-  EVP_PKEY *get_key(int n) const;
-  time_t get_generated_time(int n) const;
+  size_t get_num_keys() const;
+  EVP_PKEY *get_key(size_t n) const;
+  time_t get_generated_time(size_t n) const;
 
 
   static PrcKeyRegistry *get_global_ptr();
   static PrcKeyRegistry *get_global_ptr();
 
 
@@ -81,8 +81,3 @@ private:
 #endif  // HAVE_OPENSSL
 #endif  // HAVE_OPENSSL
 
 
 #endif
 #endif
-
-    
-  
-  
-

+ 2 - 2
dtool/src/prc/streamReader.cxx

@@ -68,7 +68,7 @@ get_z_string() {
   string result;
   string result;
   int ch = _in->get();
   int ch = _in->get();
   while (!_in->eof() && !_in->fail() && ch != '\0') {
   while (!_in->eof() && !_in->fail() && ch != '\0') {
-    result += ch;
+    result += (char)ch;
     ch = _in->get();
     ch = _in->get();
   }
   }
 
 
@@ -167,7 +167,7 @@ readline() {
   string line;
   string line;
   int ch = _in->get();
   int ch = _in->get();
   while (!_in->eof() && !_in->fail()) {
   while (!_in->eof() && !_in->fail()) {
-    line += ch;
+    line += (char)ch;
     if (ch == '\n') {
     if (ch == '\n') {
       // Here's the newline character.
       // Here's the newline character.
       return line;
       return line;

+ 2 - 2
dtool/src/prc/streamWriter.I

@@ -335,7 +335,7 @@ add_string(const string &str) {
   nassertv(str.length() <= (PN_uint16)0xffff);
   nassertv(str.length() <= (PN_uint16)0xffff);
 
 
   // Strings always are preceded by their length
   // Strings always are preceded by their length
-  add_uint16(str.length());
+  add_uint16((PN_uint16)str.length());
 
 
   // Add the string
   // Add the string
   append_data(str);
   append_data(str);
@@ -350,7 +350,7 @@ add_string(const string &str) {
 INLINE void StreamWriter::
 INLINE void StreamWriter::
 add_string32(const string &str) {
 add_string32(const string &str) {
   // Strings always are preceded by their length
   // Strings always are preceded by their length
-  add_uint32(str.length());
+  add_uint32((PN_uint32)str.length());
 
 
   // Add the string
   // Add the string
   append_data(str);
   append_data(str);

+ 5 - 5
dtool/src/prckeys/makePrcKey.cxx

@@ -74,7 +74,7 @@ output_ssl_errors() {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void
 void
 output_c_string(ostream &out, const string &string_name, 
 output_c_string(ostream &out, const string &string_name, 
-                int index, BIO *mbio) {
+                size_t index, BIO *mbio) {
   char *data_ptr;
   char *data_ptr;
   size_t data_size = BIO_get_mem_data(mbio, &data_ptr);
   size_t data_size = BIO_get_mem_data(mbio, &data_ptr);
 
 
@@ -151,13 +151,13 @@ write_public_keys(Filename outfile) {
     "\n"
     "\n"
     "#include \"prcKeyRegistry.h\"\n"
     "#include \"prcKeyRegistry.h\"\n"
     "\n";
     "\n";
-  
+
   PrcKeyRegistry *pkr = PrcKeyRegistry::get_global_ptr();
   PrcKeyRegistry *pkr = PrcKeyRegistry::get_global_ptr();
 
 
   BIO *mbio = BIO_new(BIO_s_mem());
   BIO *mbio = BIO_new(BIO_s_mem());
 
 
-  int num_keys = pkr->get_num_keys();
-  int i;
+  size_t num_keys = pkr->get_num_keys();
+  size_t i;
   for (i = 0; i < num_keys; i++) {
   for (i = 0; i < num_keys; i++) {
     EVP_PKEY *pkey = pkr->get_key(i);
     EVP_PKEY *pkey = pkr->get_key(i);
 
 
@@ -403,7 +403,7 @@ main(int argc, char **argv) {
   for (int i = 1; i < argc; i++) {
   for (int i = 1; i < argc; i++) {
     KeyNumber key;
     KeyNumber key;
     char *endptr;
     char *endptr;
-    key._number = strtol(argv[i], &endptr, 0);
+    key._number = (int)strtol(argv[i], &endptr, 0);
     key._got_pass_phrase = got_pass_phrase;
     key._got_pass_phrase = got_pass_phrase;
     key._pass_phrase = pass_phrase;
     key._pass_phrase = pass_phrase;
 
 

+ 1 - 1
panda/src/display/windowProperties.h

@@ -197,7 +197,7 @@ private:
   Filename _cursor_filename;
   Filename _cursor_filename;
   Filename _icon_filename;
   Filename _icon_filename;
   ZOrder _z_order;
   ZOrder _z_order;
-  unsigned int _flags;
+  int _flags;
   PT(WindowHandle) _parent_window;
   PT(WindowHandle) _parent_window;
 
 
   static WindowProperties *_default_properties;
   static WindowProperties *_default_properties;

+ 2 - 2
panda/src/express/datagram.cxx

@@ -91,13 +91,13 @@ dump_hex(ostream &out, unsigned int indent) const {
 void Datagram::
 void Datagram::
 add_wstring(const wstring &str) {
 add_wstring(const wstring &str) {
   // By convention, wstrings are marked with 32-bit lengths.
   // By convention, wstrings are marked with 32-bit lengths.
-  add_uint32(str.length());
+  add_uint32((PN_uint32)str.length());
 
 
   // Now append each character in the string.  We store each code
   // Now append each character in the string.  We store each code
   // little-endian, for no real good reason.
   // little-endian, for no real good reason.
   wstring::const_iterator ci;
   wstring::const_iterator ci;
   for (ci = str.begin(); ci != str.end(); ++ci) {
   for (ci = str.begin(); ci != str.end(); ++ci) {
-    add_uint16(*ci);
+    add_uint16((PN_uint16)*ci);
   }
   }
 }
 }
 
 

+ 2 - 2
panda/src/express/datagramIterator.I

@@ -513,7 +513,7 @@ get_remaining_bytes() const {
   nassertr(_current_index <= _datagram->get_length(), "");
   nassertr(_current_index <= _datagram->get_length(), "");
 
 
   const char *ptr = (const char *)_datagram->get_data();
   const char *ptr = (const char *)_datagram->get_data();
-  int remaining_size = _datagram->get_length() - _current_index;
+  size_t remaining_size = _datagram->get_length() - _current_index;
   return string(ptr + _current_index, remaining_size);
   return string(ptr + _current_index, remaining_size);
 }
 }
 
 
@@ -522,7 +522,7 @@ get_remaining_bytes() const {
 //       Access: Public
 //       Access: Public
 //  Description: Return the bytes left in the datagram.
 //  Description: Return the bytes left in the datagram.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int DatagramIterator::
+INLINE size_t DatagramIterator::
 get_remaining_size() const {
 get_remaining_size() const {
   return _datagram->get_length() - _current_index;
   return _datagram->get_length() - _current_index;
 }
 }

+ 4 - 4
panda/src/express/datagramIterator.cxx

@@ -31,7 +31,7 @@ get_string() {
   nassertr(_current_index + s_len <= _datagram->get_length(), "");
   nassertr(_current_index + s_len <= _datagram->get_length(), "");
 
 
   const char *ptr = (const char *)_datagram->get_data();
   const char *ptr = (const char *)_datagram->get_data();
-  int last_index = _current_index;
+  size_t last_index = _current_index;
 
 
   _current_index += s_len;
   _current_index += s_len;
 
 
@@ -53,7 +53,7 @@ get_string32() {
   nassertr(_current_index + s_len <= _datagram->get_length(), "");
   nassertr(_current_index + s_len <= _datagram->get_length(), "");
 
 
   const char *ptr = (const char *)_datagram->get_data();
   const char *ptr = (const char *)_datagram->get_data();
-  int last_index = _current_index;
+  size_t last_index = _current_index;
 
 
   _current_index += s_len;
   _current_index += s_len;
 
 
@@ -79,7 +79,7 @@ get_z_string() {
   }
   }
   nassertr(p < length, "");  // no NULL character?
   nassertr(p < length, "");  // no NULL character?
 
 
-  int last_index = _current_index;
+  size_t last_index = _current_index;
   _current_index = p + 1;
   _current_index = p + 1;
 
 
   return string(ptr + last_index, p - last_index);
   return string(ptr + last_index, p - last_index);
@@ -143,7 +143,7 @@ extract_bytes(size_t size) {
   nassertr(_current_index + size <= _datagram->get_length(), "");
   nassertr(_current_index + size <= _datagram->get_length(), "");
 
 
   const char *ptr = (const char *)_datagram->get_data();
   const char *ptr = (const char *)_datagram->get_data();
-  int last_index = _current_index;
+  size_t last_index = _current_index;
 
 
   _current_index += size;
   _current_index += size;
 
 

+ 1 - 1
panda/src/express/datagramIterator.h

@@ -72,7 +72,7 @@ PUBLISHED:
   size_t extract_bytes(unsigned char *into, size_t size);
   size_t extract_bytes(unsigned char *into, size_t size);
 
 
   INLINE string get_remaining_bytes() const;
   INLINE string get_remaining_bytes() const;
-  INLINE int get_remaining_size() const;
+  INLINE size_t get_remaining_size() const;
 
 
   INLINE const Datagram &get_datagram() const;
   INLINE const Datagram &get_datagram() const;
   INLINE size_t get_current_index() const;
   INLINE size_t get_current_index() const;

+ 2 - 2
panda/src/express/hashVal.cxx

@@ -51,7 +51,7 @@ input_hex(istream &in) {
 
 
   while (!in.eof() && !in.fail() && isxdigit(ch)) {
   while (!in.eof() && !in.fail() && isxdigit(ch)) {
     if (i < 32) {
     if (i < 32) {
-      buffer[i] = ch;
+      buffer[i] = (char)ch;
     }
     }
     i++;
     i++;
     ch = in.get();
     ch = in.get();
@@ -63,7 +63,7 @@ input_hex(istream &in) {
   }
   }
 
 
   if (!in.eof()) {
   if (!in.eof()) {
-    in.putback(ch);
+    in.putback((char)ch);
   } else {
   } else {
     in.clear();
     in.clear();
   }
   }

+ 11 - 11
panda/src/express/memoryUsagePointers.cxx

@@ -43,7 +43,7 @@ MemoryUsagePointers::
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of pointers in the set.
 //  Description: Returns the number of pointers in the set.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int MemoryUsagePointers::
+size_t MemoryUsagePointers::
 get_num_pointers() const {
 get_num_pointers() const {
   return _entries.size();
   return _entries.size();
 }
 }
@@ -54,8 +54,8 @@ get_num_pointers() const {
 //  Description: Returns the nth pointer of the set.
 //  Description: Returns the nth pointer of the set.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 ReferenceCount *MemoryUsagePointers::
 ReferenceCount *MemoryUsagePointers::
-get_pointer(int n) const {
-  nassertr(n >= 0 && n < get_num_pointers(), NULL);
+get_pointer(size_t n) const {
+  nassertr(n < get_num_pointers(), NULL);
   return _entries[n]._ref_ptr;
   return _entries[n]._ref_ptr;
 }
 }
 
 
@@ -68,8 +68,8 @@ get_pointer(int n) const {
 //               NULL.
 //               NULL.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 TypedObject *MemoryUsagePointers::
 TypedObject *MemoryUsagePointers::
-get_typed_pointer(int n) const {
-  nassertr(n >= 0 && n < get_num_pointers(), NULL);
+get_typed_pointer(size_t n) const {
+  nassertr(n < get_num_pointers(), NULL);
   TypedObject *typed_ptr = _entries[n]._typed_ptr;
   TypedObject *typed_ptr = _entries[n]._typed_ptr;
 
 
   if (typed_ptr != (TypedObject *)NULL) {
   if (typed_ptr != (TypedObject *)NULL) {
@@ -106,8 +106,8 @@ get_typed_pointer(int n) const {
 //               known.
 //               known.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 TypeHandle MemoryUsagePointers::
 TypeHandle MemoryUsagePointers::
-get_type(int n) const {
-  nassertr(n >= 0 && n < get_num_pointers(), TypeHandle::none());
+get_type(size_t n) const {
+  nassertr(n < get_num_pointers(), TypeHandle::none());
   return _entries[n]._type;
   return _entries[n]._type;
 }
 }
 
 
@@ -118,8 +118,8 @@ get_type(int n) const {
 //               known.
 //               known.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 string MemoryUsagePointers::
 string MemoryUsagePointers::
-get_type_name(int n) const {
-  nassertr(n >= 0 && n < get_num_pointers(), "");
+get_type_name(size_t n) const {
+  nassertr(n < get_num_pointers(), "");
   return get_type(n).get_name();
   return get_type(n).get_name();
 }
 }
 
 
@@ -132,8 +132,8 @@ get_type_name(int n) const {
 //               MemoryUsage::get_pointers().
 //               MemoryUsage::get_pointers().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 double MemoryUsagePointers::
 double MemoryUsagePointers::
-get_age(int n) const {
-  nassertr(n >= 0 && n < get_num_pointers(), 0.0);
+get_age(size_t n) const {
+  nassertr(n < get_num_pointers(), 0.0);
   return _entries[n]._age;
   return _entries[n]._age;
 }
 }
 
 

+ 7 - 7
panda/src/express/memoryUsagePointers.h

@@ -50,17 +50,17 @@ PUBLISHED:
   MemoryUsagePointers();
   MemoryUsagePointers();
   ~MemoryUsagePointers();
   ~MemoryUsagePointers();
 
 
-  int get_num_pointers() const;
-  ReferenceCount *get_pointer(int n) const;
+  size_t get_num_pointers() const;
+  ReferenceCount *get_pointer(size_t n) const;
   MAKE_SEQ(get_pointers, get_num_pointers, get_pointer);
   MAKE_SEQ(get_pointers, get_num_pointers, get_pointer);
-  TypedObject *get_typed_pointer(int n) const;
+  TypedObject *get_typed_pointer(size_t n) const;
   MAKE_SEQ(get_typed_pointers, get_num_pointers, get_typed_pointer);
   MAKE_SEQ(get_typed_pointers, get_num_pointers, get_typed_pointer);
 
 
-  TypeHandle get_type(int n) const;
-  string get_type_name(int n) const;
-  double get_age(int n) const;
+  TypeHandle get_type(size_t n) const;
+  string get_type_name(size_t n) const;
+  double get_age(size_t n) const;
 
 
-  EXTENSION(PyObject *get_python_pointer(int n) const);
+  EXTENSION(PyObject *get_python_pointer(size_t n) const);
 
 
   void clear();
   void clear();
 
 

+ 1 - 1
panda/src/express/memoryUsagePointers_ext.cxx

@@ -36,7 +36,7 @@ extern Dtool_PyTypedObject Dtool_ReferenceCount;
 //               type is known, which has a Python representation.
 //               type is known, which has a Python representation.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 PyObject *Extension<MemoryUsagePointers>::
 PyObject *Extension<MemoryUsagePointers>::
-get_python_pointer(int n) const {
+get_python_pointer(size_t n) const {
   TypedObject *typed_ptr = _this->get_typed_pointer(n);
   TypedObject *typed_ptr = _this->get_typed_pointer(n);
   ReferenceCount *ref_ptr = _this->get_pointer(n);
   ReferenceCount *ref_ptr = _this->get_pointer(n);
 
 

+ 1 - 1
panda/src/express/memoryUsagePointers_ext.h

@@ -32,7 +32,7 @@
 template<>
 template<>
 class Extension<MemoryUsagePointers> : public ExtensionBase<MemoryUsagePointers> {
 class Extension<MemoryUsagePointers> : public ExtensionBase<MemoryUsagePointers> {
 public:
 public:
-  PyObject *get_python_pointer(int n) const;
+  PyObject *get_python_pointer(size_t n) const;
 };
 };
 
 
 #endif  // HAVE_PYTHON && DO_MEMORY_USAGE
 #endif  // HAVE_PYTHON && DO_MEMORY_USAGE

+ 1 - 1
panda/src/express/multifile.cxx

@@ -969,7 +969,7 @@ add_signature(const Multifile::CertChain &cert_chain, EVP_PKEY *pkey) {
   // Now encode that list of certs to a stream in DER form.
   // Now encode that list of certs to a stream in DER form.
   stringstream der_stream;
   stringstream der_stream;
   StreamWriter der_writer(der_stream);
   StreamWriter der_writer(der_stream);
-  der_writer.add_uint32(cert_chain.size());
+  der_writer.add_uint32((PN_uint32)cert_chain.size());
 
 
   CertChain::const_iterator ci;
   CertChain::const_iterator ci;
   for (ci = cert_chain.begin(); ci != cert_chain.end(); ++ci) {
   for (ci = cert_chain.begin(); ci != cert_chain.end(); ++ci) {

+ 1 - 1
panda/src/express/nodeReferenceCount.I

@@ -137,7 +137,7 @@ get_node_ref_count() const {
 #ifdef _DEBUG
 #ifdef _DEBUG
   test_ref_count_integrity();
   test_ref_count_integrity();
 #endif
 #endif
-  return AtomicAdjust::get(_node_ref_count);
+  return (int)AtomicAdjust::get(_node_ref_count);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/express/referenceCount.I

@@ -156,7 +156,7 @@ get_ref_count() const {
 #ifdef _DEBUG
 #ifdef _DEBUG
   test_ref_count_integrity();
   test_ref_count_integrity();
 #endif
 #endif
-  return AtomicAdjust::get(_ref_count);
+  return (int)AtomicAdjust::get(_ref_count);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 6 - 6
panda/src/express/virtualFileList.I

@@ -46,7 +46,7 @@ add_file(VirtualFile *file) {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of files in the list.
 //  Description: Returns the number of files in the list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int VirtualFileList::
+INLINE size_t VirtualFileList::
 get_num_files() const {
 get_num_files() const {
   return _files.size();
   return _files.size();
 }
 }
@@ -57,8 +57,8 @@ get_num_files() const {
 //  Description: Returns the nth file in the list.
 //  Description: Returns the nth file in the list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE VirtualFile *VirtualFileList::
 INLINE VirtualFile *VirtualFileList::
-get_file(int n) const {
-  nassertr(n >= 0 && n < (int)_files.size(), NULL);
+get_file(size_t n) const {
+  nassertr(n < _files.size(), NULL);
   return _files[n];
   return _files[n];
 }
 }
 
 
@@ -68,8 +68,8 @@ get_file(int n) const {
 //  Description: Returns the nth file in the list.
 //  Description: Returns the nth file in the list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE VirtualFile *VirtualFileList::
 INLINE VirtualFile *VirtualFileList::
-operator [](int n) const {
-  nassertr(n >= 0 && n < (int)_files.size(), NULL);
+operator [](size_t n) const {
+  nassertr(n < _files.size(), NULL);
   return _files[n];
   return _files[n];
 }
 }
 
 
@@ -78,7 +78,7 @@ operator [](int n) const {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of files in the list.
 //  Description: Returns the number of files in the list.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int VirtualFileList::
+INLINE size_t VirtualFileList::
 size() const {
 size() const {
   return _files.size();
   return _files.size();
 }
 }

+ 4 - 4
panda/src/express/virtualFileList.h

@@ -36,12 +36,12 @@ public:
   INLINE void add_file(VirtualFile *file);
   INLINE void add_file(VirtualFile *file);
 
 
 PUBLISHED:
 PUBLISHED:
-  INLINE int get_num_files() const;
-  INLINE VirtualFile *get_file(int n) const;
+  INLINE size_t get_num_files() const;
+  INLINE VirtualFile *get_file(size_t n) const;
   MAKE_SEQ(get_files, get_num_files, get_file);
   MAKE_SEQ(get_files, get_num_files, get_file);
 
 
-  INLINE VirtualFile *operator [](int n) const;
-  INLINE int size() const;
+  INLINE VirtualFile *operator [](size_t n) const;
+  INLINE size_t size() const;
   INLINE void operator += (const VirtualFileList &other);
   INLINE void operator += (const VirtualFileList &other);
   INLINE VirtualFileList operator + (const VirtualFileList &other) const;
   INLINE VirtualFileList operator + (const VirtualFileList &other) const;
 
 

+ 1 - 1
panda/src/gobj/adaptiveLru.h

@@ -105,7 +105,7 @@ private:
   size_t _max_size;
   size_t _max_size;
 
 
   unsigned int _current_frame_identifier;
   unsigned int _current_frame_identifier;
-  double _weight;
+  PN_stdfloat _weight;
   int _max_updates_per_frame;
   int _max_updates_per_frame;
 
 
   // This array of linked lists keeps all of the active pages, grouped
   // This array of linked lists keeps all of the active pages, grouped

+ 1 - 1
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.
   // Validate the format and make sure to copy its numeric type.
   const GeomVertexArrayFormat *format = vertices->get_array_format();
   const GeomVertexArrayFormat *format = vertices->get_array_format();
   nassertv(format->get_num_columns() == 1);
   nassertv(format->get_num_columns() == 1);
-  cdata->_index_type = format->get_column(0)->get_numeric_type();
+  cdata->_index_type = format->get_column((size_t)0)->get_numeric_type();
 
 
   cdata->_modified = Geom::get_next_modified();
   cdata->_modified = Geom::get_next_modified();
   cdata->_got_minmax = false;
   cdata->_got_minmax = false;

+ 2 - 2
panda/src/gobj/geomVertexArrayData.I

@@ -137,7 +137,7 @@ clear_rows() {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of bytes stored in the array.
 //  Description: Returns the number of bytes stored in the array.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int GeomVertexArrayData::
+INLINE size_t GeomVertexArrayData::
 get_data_size_bytes() const {
 get_data_size_bytes() const {
   CDReader cdata(_cycler);
   CDReader cdata(_cycler);
   return cdata->_buffer.get_size();
   return cdata->_buffer.get_size();
@@ -464,7 +464,7 @@ clear_rows() {
 //       Access: Published
 //       Access: Published
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int GeomVertexArrayDataHandle::
+INLINE size_t GeomVertexArrayDataHandle::
 get_data_size_bytes() const {
 get_data_size_bytes() const {
   return _cdata->_buffer.get_size();
   return _cdata->_buffer.get_size();
 }
 }

+ 2 - 2
panda/src/gobj/geomVertexArrayData.h

@@ -90,7 +90,7 @@ PUBLISHED:
   INLINE bool reserve_num_rows(int n);
   INLINE bool reserve_num_rows(int n);
   INLINE void clear_rows();
   INLINE void clear_rows();
 
 
-  INLINE int get_data_size_bytes() const;
+  INLINE size_t get_data_size_bytes() const;
   INLINE UpdateSeq get_modified() const;
   INLINE UpdateSeq get_modified() const;
 
 
   void output(ostream &out) const;
   void output(ostream &out) const;
@@ -284,7 +284,7 @@ PUBLISHED:
   bool reserve_num_rows(int n);
   bool reserve_num_rows(int n);
   INLINE void clear_rows();
   INLINE void clear_rows();
 
 
-  INLINE int get_data_size_bytes() const;
+  INLINE size_t get_data_size_bytes() const;
   INLINE UpdateSeq get_modified() const;
   INLINE UpdateSeq get_modified() const;
 
 
   INLINE bool request_resident() const;
   INLINE bool request_resident() const;

+ 4 - 4
panda/src/gobj/geomVertexArrayFormat.I

@@ -151,9 +151,9 @@ get_total_bytes() const {
 //  Description: Returns the number of different columns in the
 //  Description: Returns the number of different columns in the
 //               array.
 //               array.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int GeomVertexArrayFormat::
+INLINE size_t GeomVertexArrayFormat::
 get_num_columns() const {
 get_num_columns() const {
-  return (int)_columns.size();
+  return _columns.size();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -162,8 +162,8 @@ get_num_columns() const {
 //  Description: Returns the ith column of the array.
 //  Description: Returns the ith column of the array.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const GeomVertexColumn *GeomVertexArrayFormat::
 INLINE const GeomVertexColumn *GeomVertexArrayFormat::
-get_column(int i) const {
-  nassertr(i >= 0 && i < (int)_columns.size(), NULL);
+get_column(size_t i) const {
+  nassertr(i < _columns.size(), NULL);
   consider_sort_columns();
   consider_sort_columns();
   return _columns[i];
   return _columns[i];
 }
 }

+ 2 - 2
panda/src/gobj/geomVertexArrayFormat.h

@@ -102,8 +102,8 @@ PUBLISHED:
   void pack_columns();
   void pack_columns();
   void align_columns_for_animation();
   void align_columns_for_animation();
 
 
-  INLINE int get_num_columns() const;
-  INLINE const GeomVertexColumn *get_column(int i) const;
+  INLINE size_t get_num_columns() const;
+  INLINE const GeomVertexColumn *get_column(size_t i) const;
   MAKE_SEQ(get_columns, get_num_columns, get_column);
   MAKE_SEQ(get_columns, get_num_columns, get_column);
 
 
   const GeomVertexColumn *get_column(const InternalName *name) const;
   const GeomVertexColumn *get_column(const InternalName *name) const;

+ 1 - 1
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);
     CPT(GeomVertexArrayFormat) blend_array_format = orig_format->get_array(blend_array_index);
 
 
     if (blend_array_format->get_stride() == 2 &&
     if (blend_array_format->get_stride() == 2 &&
-        blend_array_format->get_column(0)->get_component_bytes() == 2) {
+        blend_array_format->get_column((size_t)0)->get_component_bytes() == 2) {
       // The blend indices are a table of ushorts.  Optimize this
       // The blend indices are a table of ushorts.  Optimize this
       // common case.
       // common case.
       CPT(GeomVertexArrayDataHandle) blend_array_handle = cdata->_arrays[blend_array_index].get_read_pointer()->get_handle(current_thread);
       CPT(GeomVertexArrayDataHandle) blend_array_handle = cdata->_arrays[blend_array_index].get_read_pointer()->get_handle(current_thread);

+ 19 - 19
panda/src/gobj/geomVertexFormat.I

@@ -100,7 +100,7 @@ set_animation(const GeomVertexAnimationSpec &animation) {
 //               parallel, this will be the same as the number of data
 //               parallel, this will be the same as the number of data
 //               types.
 //               types.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int GeomVertexFormat::
+INLINE size_t GeomVertexFormat::
 get_num_arrays() const {
 get_num_arrays() const {
   return _arrays.size();
   return _arrays.size();
 }
 }
@@ -112,8 +112,8 @@ get_num_arrays() const {
 //               format.
 //               format.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const GeomVertexArrayFormat *GeomVertexFormat::
 INLINE const GeomVertexArrayFormat *GeomVertexFormat::
-get_array(int array) const {
-  nassertr(array >= 0 && array < (int)_arrays.size(), NULL);
+get_array(size_t array) const {
+  nassertr(array < _arrays.size(), NULL);
   return _arrays[array];
   return _arrays[array];
 }
 }
 
 
@@ -137,7 +137,7 @@ has_column(const InternalName *name) const {
 //               This may only be called after the format has been
 //               This may only be called after the format has been
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int GeomVertexFormat::
+INLINE size_t GeomVertexFormat::
 get_num_points() const {
 get_num_points() const {
   nassertr(_is_registered, 0);
   nassertr(_is_registered, 0);
   return _points.size();
   return _points.size();
@@ -154,9 +154,9 @@ get_num_points() const {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const InternalName *GeomVertexFormat::
 INLINE const InternalName *GeomVertexFormat::
-get_point(int n) const {
+get_point(size_t n) const {
   nassertr(_is_registered, NULL);
   nassertr(_is_registered, NULL);
-  nassertr(n >= 0 && n < (int)_points.size(), NULL);
+  nassertr(n < _points.size(), NULL);
   return _points[n];
   return _points[n];
 }
 }
 
 
@@ -169,7 +169,7 @@ get_point(int n) const {
 //               This may only be called after the format has been
 //               This may only be called after the format has been
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int GeomVertexFormat::
+INLINE size_t GeomVertexFormat::
 get_num_vectors() const {
 get_num_vectors() const {
   nassertr(_is_registered, 0);
   nassertr(_is_registered, 0);
   return _vectors.size();
   return _vectors.size();
@@ -187,9 +187,9 @@ get_num_vectors() const {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const InternalName *GeomVertexFormat::
 INLINE const InternalName *GeomVertexFormat::
-get_vector(int n) const {
+get_vector(size_t n) const {
   nassertr(_is_registered, NULL);
   nassertr(_is_registered, NULL);
-  nassertr(n >= 0 && n < (int)_vectors.size(), NULL);
+  nassertr(n < _vectors.size(), NULL);
   return _vectors[n];
   return _vectors[n];
 }
 }
 
 
@@ -202,7 +202,7 @@ get_vector(int n) const {
 //               This may only be called after the format has been
 //               This may only be called after the format has been
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int GeomVertexFormat::
+INLINE size_t GeomVertexFormat::
 get_num_texcoords() const {
 get_num_texcoords() const {
   nassertr(_is_registered, 0);
   nassertr(_is_registered, 0);
   return _texcoords.size();
   return _texcoords.size();
@@ -218,9 +218,9 @@ get_num_texcoords() const {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const InternalName *GeomVertexFormat::
 INLINE const InternalName *GeomVertexFormat::
-get_texcoord(int n) const {
+get_texcoord(size_t n) const {
   nassertr(_is_registered, NULL);
   nassertr(_is_registered, NULL);
-  nassertr(n >= 0 && n < (int)_texcoords.size(), NULL);
+  nassertr(n < _texcoords.size(), NULL);
   return _texcoords[n];
   return _texcoords[n];
 }
 }
 
 
@@ -233,7 +233,7 @@ get_texcoord(int n) const {
 //               This may only be called after the format has been
 //               This may only be called after the format has been
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int GeomVertexFormat::
+INLINE size_t GeomVertexFormat::
 get_num_morphs() const {
 get_num_morphs() const {
   nassertr(_is_registered, 0);
   nassertr(_is_registered, 0);
 
 
@@ -252,9 +252,9 @@ get_num_morphs() const {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const InternalName *GeomVertexFormat::
 INLINE const InternalName *GeomVertexFormat::
-get_morph_slider(int n) const {
+get_morph_slider(size_t n) const {
   nassertr(_is_registered, NULL);
   nassertr(_is_registered, NULL);
-  nassertr(n >= 0 && n < (int)_morphs.size(), NULL);
+  nassertr(n < _morphs.size(), NULL);
 
 
   return _morphs[n]._slider;
   return _morphs[n]._slider;
 }
 }
@@ -271,9 +271,9 @@ get_morph_slider(int n) const {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const InternalName *GeomVertexFormat::
 INLINE const InternalName *GeomVertexFormat::
-get_morph_base(int n) const {
+get_morph_base(size_t n) const {
   nassertr(_is_registered, NULL);
   nassertr(_is_registered, NULL);
-  nassertr(n >= 0 && n < (int)_morphs.size(), NULL);
+  nassertr(n < _morphs.size(), NULL);
 
 
   return _morphs[n]._base;
   return _morphs[n]._base;
 }
 }
@@ -292,9 +292,9 @@ get_morph_base(int n) const {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const InternalName *GeomVertexFormat::
 INLINE const InternalName *GeomVertexFormat::
-get_morph_delta(int n) const {
+get_morph_delta(size_t n) const {
   nassertr(_is_registered, NULL);
   nassertr(_is_registered, NULL);
-  nassertr(n >= 0 && n < (int)_morphs.size(), NULL);
+  nassertr(n < _morphs.size(), NULL);
 
 
   return _morphs[n]._delta;
   return _morphs[n]._delta;
 }
 }

+ 19 - 19
panda/src/gobj/geomVertexFormat.cxx

@@ -205,8 +205,8 @@ get_union_format(const GeomVertexFormat *other) const {
     // Add the columns from the first format.
     // Add the columns from the first format.
     if (ai < _arrays.size()) {
     if (ai < _arrays.size()) {
       GeomVertexArrayFormat *array_format = _arrays[ai];
       GeomVertexArrayFormat *array_format = _arrays[ai];
-      int num_columns = array_format->get_num_columns();
-      for (int i = 0; i < num_columns; ++i) {
+      size_t num_columns = array_format->get_num_columns();
+      for (size_t i = 0; i < num_columns; ++i) {
         const GeomVertexColumn *column_a = array_format->get_column(i);
         const GeomVertexColumn *column_a = array_format->get_column(i);
         bool inserted = column_names.insert(column_a->get_name()).second;
         bool inserted = column_names.insert(column_a->get_name()).second;
         if (inserted) {
         if (inserted) {
@@ -232,8 +232,8 @@ get_union_format(const GeomVertexFormat *other) const {
     // Add the columns from the second format.
     // Add the columns from the second format.
     if (ai < other->_arrays.size()) {
     if (ai < other->_arrays.size()) {
       GeomVertexArrayFormat *array_format = other->_arrays[ai];
       GeomVertexArrayFormat *array_format = other->_arrays[ai];
-      int num_columns = array_format->get_num_columns();
-      for (int i = 0; i < num_columns; ++i) {
+      size_t num_columns = array_format->get_num_columns();
+      for (size_t i = 0; i < num_columns; ++i) {
         const GeomVertexColumn *column_a = array_format->get_column(i);
         const GeomVertexColumn *column_a = array_format->get_column(i);
         bool inserted = column_names.insert(column_a->get_name()).second;
         bool inserted = column_names.insert(column_a->get_name()).second;
         if (inserted) {
         if (inserted) {
@@ -276,9 +276,9 @@ get_union_format(const GeomVertexFormat *other) const {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 GeomVertexArrayFormat *GeomVertexFormat::
 GeomVertexArrayFormat *GeomVertexFormat::
-modify_array(int array) {
+modify_array(size_t array) {
   nassertr(!is_registered(), NULL);
   nassertr(!is_registered(), NULL);
-  nassertr(array >= 0 && array < (int)_arrays.size(), NULL);
+  nassertr(array < _arrays.size(), NULL);
 
 
   if (_arrays[array]->is_registered() ||
   if (_arrays[array]->is_registered() ||
       _arrays[array]->get_ref_count() > 1) {
       _arrays[array]->get_ref_count() > 1) {
@@ -297,9 +297,9 @@ modify_array(int array) {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void GeomVertexFormat::
 void GeomVertexFormat::
-set_array(int array, const GeomVertexArrayFormat *format) {
+set_array(size_t array, const GeomVertexArrayFormat *format) {
   nassertv(!is_registered());
   nassertv(!is_registered());
-  nassertv(array >= 0 && array < (int)_arrays.size());
+  nassertv(array < _arrays.size());
   _arrays[array] = (GeomVertexArrayFormat *)format;
   _arrays[array] = (GeomVertexArrayFormat *)format;
 }
 }
 
 
@@ -312,10 +312,10 @@ set_array(int array, const GeomVertexArrayFormat *format) {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void GeomVertexFormat::
 void GeomVertexFormat::
-remove_array(int array) {
+remove_array(size_t array) {
   nassertv(!is_registered());
   nassertv(!is_registered());
 
 
-  nassertv(array >= 0 && array < (int)_arrays.size());
+  nassertv(array < _arrays.size());
   _arrays.erase(_arrays.begin() + array);
   _arrays.erase(_arrays.begin() + array);
 }
 }
 
 
@@ -330,11 +330,11 @@ remove_array(int array) {
 //               This may not be called once the format has been
 //               This may not be called once the format has been
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int GeomVertexFormat::
+size_t GeomVertexFormat::
 add_array(const GeomVertexArrayFormat *array_format) {
 add_array(const GeomVertexArrayFormat *array_format) {
-  nassertr(!is_registered(), -1);
+  nassertr(!is_registered(), 0);
 
 
-  int new_array = (int)_arrays.size();
+  size_t new_array = _arrays.size();
   _arrays.push_back((GeomVertexArrayFormat *)array_format);
   _arrays.push_back((GeomVertexArrayFormat *)array_format);
   return new_array;
   return new_array;
 }
 }
@@ -351,9 +351,9 @@ add_array(const GeomVertexArrayFormat *array_format) {
 //               registered.
 //               registered.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void GeomVertexFormat::
 void GeomVertexFormat::
-insert_array(int array, const GeomVertexArrayFormat *array_format) {
+insert_array(size_t array, const GeomVertexArrayFormat *array_format) {
   nassertv(!is_registered());
   nassertv(!is_registered());
-  nassertv(array >= 0 && array <= (int)_arrays.size());
+  nassertv(array <= _arrays.size());
 
 
   _arrays.insert(_arrays.begin() + array, (GeomVertexArrayFormat *)array_format);
   _arrays.insert(_arrays.begin() + array, (GeomVertexArrayFormat *)array_format);
 }
 }
@@ -403,9 +403,9 @@ remove_empty_arrays() {
 //  Description: Returns the total number of different columns in
 //  Description: Returns the total number of different columns in
 //               the specification, across all arrays.
 //               the specification, across all arrays.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int GeomVertexFormat::
+size_t GeomVertexFormat::
 get_num_columns() const {
 get_num_columns() const {
-  int num_columns = 0;
+  size_t num_columns = 0;
   Arrays::const_iterator ai;
   Arrays::const_iterator ai;
   for (ai = _arrays.begin(); ai != _arrays.end(); ++ai) {
   for (ai = _arrays.begin(); ai != _arrays.end(); ++ai) {
     num_columns += (*ai)->get_num_columns();
     num_columns += (*ai)->get_num_columns();
@@ -420,7 +420,7 @@ get_num_columns() const {
 //               across all arrays.
 //               across all arrays.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 const GeomVertexColumn *GeomVertexFormat::
 const GeomVertexColumn *GeomVertexFormat::
-get_column(int i) const {
+get_column(size_t i) const {
   Arrays::const_iterator ai;
   Arrays::const_iterator ai;
   for (ai = _arrays.begin(); ai != _arrays.end(); ++ai) {
   for (ai = _arrays.begin(); ai != _arrays.end(); ++ai) {
     if (i < (*ai)->get_num_columns()) {
     if (i < (*ai)->get_num_columns()) {
@@ -445,7 +445,7 @@ get_column(int i) const {
 //               array data.
 //               array data.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 int GeomVertexFormat::
 int GeomVertexFormat::
-get_array_with(int i) const {
+get_array_with(size_t i) const {
   int array_index = 0;
   int array_index = 0;
   for (array_index = 0; array_index < (int)_arrays.size(); array_index++) {
   for (array_index = 0; array_index < (int)_arrays.size(); array_index++) {
     if (i < _arrays[array_index]->get_num_columns()) {
     if (i < _arrays[array_index]->get_num_columns()) {

+ 20 - 20
panda/src/gobj/geomVertexFormat.h

@@ -78,20 +78,20 @@ PUBLISHED:
   CPT(GeomVertexFormat) get_post_animated_format() const;
   CPT(GeomVertexFormat) get_post_animated_format() const;
   CPT(GeomVertexFormat) get_union_format(const GeomVertexFormat *other) const;
   CPT(GeomVertexFormat) get_union_format(const GeomVertexFormat *other) const;
 
 
-  INLINE int get_num_arrays() const;
-  INLINE const GeomVertexArrayFormat *get_array(int array) const;
+  INLINE size_t get_num_arrays() const;
+  INLINE const GeomVertexArrayFormat *get_array(size_t array) const;
   MAKE_SEQ(get_arrays, get_num_arrays, get_array);
   MAKE_SEQ(get_arrays, get_num_arrays, get_array);
-  GeomVertexArrayFormat *modify_array(int array);
-  void set_array(int array, const GeomVertexArrayFormat *format);
-  void remove_array(int array);
-  int add_array(const GeomVertexArrayFormat *array_format);
-  void insert_array(int array, const GeomVertexArrayFormat *array_format);
+  GeomVertexArrayFormat *modify_array(size_t array);
+  void set_array(size_t array, const GeomVertexArrayFormat *format);
+  void remove_array(size_t array);
+  size_t add_array(const GeomVertexArrayFormat *array_format);
+  void insert_array(size_t array, const GeomVertexArrayFormat *array_format);
   void clear_arrays();
   void clear_arrays();
   void remove_empty_arrays();
   void remove_empty_arrays();
 
 
-  int get_num_columns() const;
-  int get_array_with(int i) const;
-  const GeomVertexColumn *get_column(int i) const;
+  size_t get_num_columns() const;
+  int get_array_with(size_t i) const;
+  const GeomVertexColumn *get_column(size_t i) const;
 
 
   int get_array_with(const InternalName *name) const;
   int get_array_with(const InternalName *name) const;
   const GeomVertexColumn *get_column(const InternalName *name) const;
   const GeomVertexColumn *get_column(const InternalName *name) const;
@@ -104,22 +104,22 @@ PUBLISHED:
   void align_columns_for_animation();
   void align_columns_for_animation();
   void maybe_align_columns_for_animation();
   void maybe_align_columns_for_animation();
 
 
-  INLINE int get_num_points() const;
-  INLINE const InternalName *get_point(int n) const;
+  INLINE size_t get_num_points() const;
+  INLINE const InternalName *get_point(size_t n) const;
   MAKE_SEQ(get_points, get_num_points, get_point);
   MAKE_SEQ(get_points, get_num_points, get_point);
 
 
-  INLINE int get_num_vectors() const;
-  INLINE const InternalName *get_vector(int n) const;
+  INLINE size_t get_num_vectors() const;
+  INLINE const InternalName *get_vector(size_t n) const;
   MAKE_SEQ(get_vectors, get_num_vectors, get_vector);
   MAKE_SEQ(get_vectors, get_num_vectors, get_vector);
 
 
-  INLINE int get_num_texcoords() const;
-  INLINE const InternalName *get_texcoord(int n) const;
+  INLINE size_t get_num_texcoords() const;
+  INLINE const InternalName *get_texcoord(size_t n) const;
   MAKE_SEQ(get_texcoords, get_num_texcoords, get_texcoord);
   MAKE_SEQ(get_texcoords, get_num_texcoords, get_texcoord);
 
 
-  INLINE int get_num_morphs() const;
-  INLINE const InternalName *get_morph_slider(int n) const;
-  INLINE const InternalName *get_morph_base(int n) const;
-  INLINE const InternalName *get_morph_delta(int n) const;
+  INLINE size_t get_num_morphs() const;
+  INLINE const InternalName *get_morph_slider(size_t n) const;
+  INLINE const InternalName *get_morph_base(size_t n) const;
+  INLINE const InternalName *get_morph_delta(size_t n) const;
   MAKE_SEQ(get_morph_sliders, get_num_morphs, get_morph_slider);
   MAKE_SEQ(get_morph_sliders, get_num_morphs, get_morph_slider);
   MAKE_SEQ(get_morph_bases, get_num_morphs, get_morph_base);
   MAKE_SEQ(get_morph_bases, get_num_morphs, get_morph_base);
   MAKE_SEQ(get_morph_deltas, get_num_morphs, get_morph_delta);
   MAKE_SEQ(get_morph_deltas, get_num_morphs, get_morph_delta);

+ 2 - 2
panda/src/gobj/lens.I

@@ -802,7 +802,7 @@ get_last_change() const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void Lens::
 INLINE void Lens::
 do_adjust_user_flags(CData *cdata, int clear_flags, int set_flags) {
 do_adjust_user_flags(CData *cdata, int clear_flags, int set_flags) {
-  cdata->_user_flags = (cdata->_user_flags & ~clear_flags) | set_flags;
+  cdata->_user_flags = (cdata->_user_flags & ~clear_flags) | (short)set_flags;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -813,7 +813,7 @@ do_adjust_user_flags(CData *cdata, int clear_flags, int set_flags) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void Lens::
 INLINE void Lens::
 do_adjust_comp_flags(CData *cdata, int clear_flags, int set_flags) {
 do_adjust_comp_flags(CData *cdata, int clear_flags, int set_flags) {
-  cdata->_comp_flags = (cdata->_comp_flags & ~clear_flags) | set_flags;
+  cdata->_comp_flags = (cdata->_comp_flags & ~clear_flags) | (short)set_flags;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 5 - 5
panda/src/gobj/sliderTable.I

@@ -62,7 +62,7 @@ register_table(const SliderTable *table) {
 //       Access: Published
 //       Access: Published
 //  Description: Returns the number of sliders in the table.
 //  Description: Returns the number of sliders in the table.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int SliderTable::
+INLINE size_t SliderTable::
 get_num_sliders() const {
 get_num_sliders() const {
   return _sliders.size();
   return _sliders.size();
 }
 }
@@ -73,8 +73,8 @@ get_num_sliders() const {
 //  Description: Returns the nth slider in the table.
 //  Description: Returns the nth slider in the table.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const VertexSlider *SliderTable::
 INLINE const VertexSlider *SliderTable::
-get_slider(int n) const {
-  nassertr(n >= 0 && n < (int)_sliders.size(), NULL);
+get_slider(size_t n) const {
+  nassertr(n < _sliders.size(), NULL);
   return _sliders[n]._slider;
   return _sliders[n]._slider;
 }
 }
 
 
@@ -85,8 +85,8 @@ get_slider(int n) const {
 //               nth slider in the table.
 //               nth slider in the table.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const SparseArray &SliderTable::
 INLINE const SparseArray &SliderTable::
-get_slider_rows(int n) const {
-  nassertr(n >= 0 && n < (int)_sliders.size(), _empty_array);
+get_slider_rows(size_t n) const {
+  nassertr(n < _sliders.size(), _empty_array);
   return _sliders[n]._rows;
   return _sliders[n]._rows;
 }
 }
 
 

+ 9 - 9
panda/src/gobj/sliderTable.cxx

@@ -75,9 +75,9 @@ SliderTable::
 //               unregistered tables.
 //               unregistered tables.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void SliderTable::
 void SliderTable::
-set_slider(int n, const VertexSlider *slider) {
+set_slider(size_t n, const VertexSlider *slider) {
   nassertv(!_is_registered);
   nassertv(!_is_registered);
-  nassertv(n >= 0 && n < (int)_sliders.size());
+  nassertv(n < _sliders.size());
 
 
   if (_sliders[n]._slider->get_name() != slider->get_name()) {
   if (_sliders[n]._slider->get_name() != slider->get_name()) {
     _sliders_by_name[_sliders[n]._slider->get_name()].clear_bit(n);
     _sliders_by_name[_sliders[n]._slider->get_name()].clear_bit(n);
@@ -94,12 +94,12 @@ set_slider(int n, const VertexSlider *slider) {
 //               valid for unregistered tables.
 //               valid for unregistered tables.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void SliderTable::
 void SliderTable::
-set_slider_rows(int n, const SparseArray &rows) {
+set_slider_rows(size_t n, const SparseArray &rows) {
   // We don't actually enforce the registration requirement, since
   // We don't actually enforce the registration requirement, since
   // gee, it doesn't actually matter here; and the GeomVertexData
   // gee, it doesn't actually matter here; and the GeomVertexData
   // needs to be able to change the SparseArrays in the bam reader.
   // needs to be able to change the SparseArrays in the bam reader.
   //  nassertv(!_is_registered);
   //  nassertv(!_is_registered);
-  nassertv(n >= 0 && n < (int)_sliders.size());
+  nassertv(n < _sliders.size());
 
 
   _sliders[n]._rows = rows;
   _sliders[n]._rows = rows;
 }
 }
@@ -111,9 +111,9 @@ set_slider_rows(int n, const SparseArray &rows) {
 //               unregistered tables.
 //               unregistered tables.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void SliderTable::
 void SliderTable::
-remove_slider(int n) {
+remove_slider(size_t n) {
   nassertv(!_is_registered);
   nassertv(!_is_registered);
-  nassertv(n >= 0 && n < (int)_sliders.size());
+  nassertv(n < _sliders.size());
 
 
   _sliders_by_name[_sliders[n]._slider->get_name()].clear_bit(n);
   _sliders_by_name[_sliders[n]._slider->get_name()].clear_bit(n);
   _sliders.erase(_sliders.begin() + n);
   _sliders.erase(_sliders.begin() + n);
@@ -126,11 +126,11 @@ remove_slider(int n) {
 //               index number of the new slider.  Only valid for
 //               index number of the new slider.  Only valid for
 //               unregistered tables.
 //               unregistered tables.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int SliderTable::
+size_t SliderTable::
 add_slider(const VertexSlider *slider, const SparseArray &rows) {
 add_slider(const VertexSlider *slider, const SparseArray &rows) {
-  nassertr(!_is_registered, -1);
+  nassertr(!_is_registered, 0);
 
 
-  int new_index = (int)_sliders.size();
+  size_t new_index = _sliders.size();
 
 
   SliderDef slider_def;
   SliderDef slider_def;
   slider_def._slider = slider;
   slider_def._slider = slider;

+ 7 - 7
panda/src/gobj/sliderTable.h

@@ -49,20 +49,20 @@ PUBLISHED:
   INLINE bool is_registered() const;
   INLINE bool is_registered() const;
   INLINE static CPT(SliderTable) register_table(const SliderTable *table);
   INLINE static CPT(SliderTable) register_table(const SliderTable *table);
 
 
-  INLINE int get_num_sliders() const;
-  INLINE const VertexSlider *get_slider(int n) const;
+  INLINE size_t get_num_sliders() const;
+  INLINE const VertexSlider *get_slider(size_t n) const;
   MAKE_SEQ(get_sliders, get_num_sliders, get_slider);
   MAKE_SEQ(get_sliders, get_num_sliders, get_slider);
-  INLINE const SparseArray &get_slider_rows(int n) const;
+  INLINE const SparseArray &get_slider_rows(size_t n) const;
 
 
   INLINE const SparseArray &find_sliders(const InternalName *name) const;
   INLINE const SparseArray &find_sliders(const InternalName *name) const;
   INLINE bool has_slider(const InternalName *name) const;
   INLINE bool has_slider(const InternalName *name) const;
   INLINE bool is_empty() const;
   INLINE bool is_empty() const;
   INLINE UpdateSeq get_modified(Thread *current_thread) const;
   INLINE UpdateSeq get_modified(Thread *current_thread) const;
 
 
-  void set_slider(int n, const VertexSlider *slider);
-  void set_slider_rows(int n, const SparseArray &rows);
-  void remove_slider(int n);
-  int add_slider(const VertexSlider *slider, const SparseArray &rows);
+  void set_slider(size_t n, const VertexSlider *slider);
+  void set_slider_rows(size_t n, const SparseArray &rows);
+  void remove_slider(size_t n);
+  size_t add_slider(const VertexSlider *slider, const SparseArray &rows);
 
 
   void write(ostream &out) const;
   void write(ostream &out) const;
 
 

+ 1 - 1
panda/src/gobj/texture.I

@@ -344,7 +344,7 @@ INLINE string Texture::
 get_clear_data() const {
 get_clear_data() const {
   CDReader cdata(_cycler);
   CDReader cdata(_cycler);
   unsigned char data[16];
   unsigned char data[16];
-  int size = do_get_clear_data(cdata, data);
+  size_t size = do_get_clear_data(cdata, data);
   return string((char *)data, size);
   return string((char *)data, size);
 }
 }
 
 

+ 1 - 1
panda/src/gobj/texture.cxx

@@ -4432,7 +4432,7 @@ do_set_ram_mipmap_image(CData *cdata, int n, CPTA_uchar image, size_t page_size)
 //               be initialized with this string repeated for
 //               be initialized with this string repeated for
 //               every pixel.
 //               every pixel.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-int Texture::
+size_t Texture::
 do_get_clear_data(const CData *cdata, unsigned char *into) const {
 do_get_clear_data(const CData *cdata, unsigned char *into) const {
   nassertr(cdata->_has_clear_color, 0);
   nassertr(cdata->_has_clear_color, 0);
   nassertr(cdata->_num_components <= 4, 0);
   nassertr(cdata->_num_components <= 4, 0);

+ 1 - 1
panda/src/gobj/texture.h

@@ -597,7 +597,7 @@ protected:
   PTA_uchar do_modify_ram_mipmap_image(CData *cdata, int n);
   PTA_uchar do_modify_ram_mipmap_image(CData *cdata, int n);
   PTA_uchar do_make_ram_mipmap_image(CData *cdata, int n);
   PTA_uchar do_make_ram_mipmap_image(CData *cdata, int n);
   void do_set_ram_mipmap_image(CData *cdata, int n, CPTA_uchar image, size_t page_size);
   void do_set_ram_mipmap_image(CData *cdata, int n, CPTA_uchar image, size_t page_size);
-  int do_get_clear_data(const CData *cdata, unsigned char *into) const;
+  size_t do_get_clear_data(const CData *cdata, unsigned char *into) const;
 
 
   bool consider_auto_process_ram_image(bool generate_mipmaps, bool allow_compression);
   bool consider_auto_process_ram_image(bool generate_mipmaps, bool allow_compression);
   bool do_consider_auto_process_ram_image(CData *cdata, bool generate_mipmaps,
   bool do_consider_auto_process_ram_image(CData *cdata, bool generate_mipmaps,

+ 9 - 9
panda/src/gobj/transformBlend.I

@@ -145,7 +145,7 @@ operator != (const TransformBlend &other) const {
 //  Description: Returns the number of transforms stored in the blend
 //  Description: Returns the number of transforms stored in the blend
 //               object.
 //               object.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE int TransformBlend::
+INLINE size_t TransformBlend::
 get_num_transforms() const {
 get_num_transforms() const {
   return _entries.size();
   return _entries.size();
 }
 }
@@ -157,8 +157,8 @@ get_num_transforms() const {
 //               object.
 //               object.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const VertexTransform *TransformBlend::
 INLINE const VertexTransform *TransformBlend::
-get_transform(int n) const {
-  nassertr(n >= 0 && n < (int)_entries.size(), NULL);
+get_transform(size_t n) const {
+  nassertr(n < _entries.size(), NULL);
   return _entries[n]._transform;
   return _entries[n]._transform;
 }
 }
 
 
@@ -169,8 +169,8 @@ get_transform(int n) const {
 //               stored in the blend object.
 //               stored in the blend object.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PN_stdfloat TransformBlend::
 INLINE PN_stdfloat TransformBlend::
-get_weight(int n) const {
-  nassertr(n >= 0 && n < (int)_entries.size(), 0.0f);
+get_weight(size_t n) const {
+  nassertr(n < _entries.size(), 0.0f);
   return _entries[n]._weight;
   return _entries[n]._weight;
 }
 }
 
 
@@ -181,8 +181,8 @@ get_weight(int n) const {
 //               object.
 //               object.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void TransformBlend::
 INLINE void TransformBlend::
-set_transform(int n, const VertexTransform *transform) {
-  nassertv(n >= 0 && n < (int)_entries.size());
+set_transform(size_t n, const VertexTransform *transform) {
+  nassertv(n < _entries.size());
   _entries[n]._transform = transform;
   _entries[n]._transform = transform;
 }
 }
 
 
@@ -193,8 +193,8 @@ set_transform(int n, const VertexTransform *transform) {
 //               stored in the blend object.
 //               stored in the blend object.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void TransformBlend::
 INLINE void TransformBlend::
-set_weight(int n, PN_stdfloat weight) {
-  nassertv(n >= 0 && n < (int)_entries.size());
+set_weight(size_t n, PN_stdfloat weight) {
+  nassertv(n < _entries.size());
   _entries[n]._weight = weight;
   _entries[n]._weight = weight;
 }
 }
 
 

Some files were not shown because too many files changed in this diff