medfall

A super great game engine
Log | Files | Refs

changes.diff (2606B)


      1 +-- tinyobjloader.h	2017-04-21 00:24:31.306840996 +0300
      2 -++ orig.h	2017-04-21 00:22:18.111693195 +0300
      3 @@ -499,13 +499,12 @@
      4    size_t n;
      5  } hash_table_t;
      6  
      7 -static unsigned long hash_djb2(const unsigned char* str)
      8 +static unsigned long hash_djb2(const void* p)
      9  {
     10 +  const unsigned char* str = (const unsigned char*)p;
     11    unsigned long hash = 5381;
     12    int c;
     13  
     14 -  while (c = *str++)
     15 +  while ((c = *str++))
     16      hash = ((hash << 5) + hash) + c;
     17  
     18    return hash;
     19 @@ -601,7 +600,7 @@
     20    new_hash_table.n = hash_table->n;
     21  
     22    // Rehash
     23 -  for (int i = 0; i < hash_table->capacity; i++)
     24 +  for (size_t i = 0; i < hash_table->capacity; i++)
     25    {
     26      hash_table_entry_t* entry = hash_table_find(hash_table->hashes[i], hash_table);
     27      hash_table_insert_value(hash_table->hashes[i], entry->value, &new_hash_table);
     28 @@ -1362,7 +1361,7 @@
     29      const char *prev_shape_name = NULL;
     30      unsigned int prev_shape_name_len = 0;
     31      unsigned int prev_shape_face_offset = 0;
     32 -    unsigned int prev_shape_length = 0;
     33 +    // unsigned int prev_shape_length = 0;
     34      unsigned int prev_face_offset = 0;
     35      tinyobj_shape_t prev_shape = {NULL, 0, 0};
     36  
     37 @@ -1376,7 +1375,7 @@
     38      /* Allocate array of shapes with maximum possible size(+1 for unnamed
     39       * group/object).
     40       * Actual # of shapes found in .obj is determined in the later */
     41 -    (*shapes) = malloc(sizeof(tinyobj_shape_t) * (n + 1));
     42 +    (*shapes) = (tinyobj_shape_t*)malloc(sizeof(tinyobj_shape_t) * (n + 1));
     43  
     44      for (i = 0; i < num_lines; i++) {
     45        if (commands[i].type == COMMAND_O || commands[i].type == COMMAND_G) {
     46 @@ -1403,7 +1402,7 @@
     47              (*shapes)[shape_idx].length = face_count - prev_face_offset;
     48              shape_idx++;
     49  
     50 -            prev_shape_length = face_count - prev_face_offset;
     51 +            // prev_shape_length = face_count - prev_face_offset;
     52              prev_face_offset = face_count;
     53  
     54            } else {
     55 @@ -1413,7 +1412,7 @@
     56                (*shapes)[shape_idx].face_offset = prev_face_offset;
     57                (*shapes)[shape_idx].length = face_count - prev_face_offset;
     58                shape_idx++;
     59 -              prev_shape_length = face_count - prev_face_offset;
     60 +              // prev_shape_length = face_count - prev_face_offset;
     61                prev_face_offset = face_count;
     62              }
     63            }
     64 @@ -1422,7 +1421,7 @@
     65            prev_shape_name = shape_name;
     66            prev_shape_name_len = shape_name_len;
     67            prev_shape_face_offset = face_count;
     68 -          prev_shape_length = 0;
     69 +          // prev_shape_length = 0;
     70          }
     71        }
     72        if (commands[i].type == COMMAND_F) {