When compiled with MSVC on a 64 bit platform, parent->num_children-1 yields 0xfffffff...
authorjefftk <jefftk@google.com>
Tue, 17 Feb 2015 14:58:20 +0000 (14:58 +0000)
committerjefftk <jefftk@google.com>
Tue, 17 Feb 2015 14:58:20 +0000 (14:58 +0000)
src/domain_registry/private/trie_search.c

index 0196997..4f68375 100644 (file)
@@ -160,7 +160,7 @@ const struct TrieNode* FindRegistryNode(const char* component,
 
     /* We'll be searching the specified parent node's children. */
     start = g_node_table + parent->first_child_offset;
-    end = start + (parent->num_children - 1);
+    end = start + ((int) parent->num_children - 1);
   }
   current = FindNodeInRange(component, start, end);
   if (current != NULL) {
@@ -229,7 +229,7 @@ const char* FindRegistryLeafNode(const char* component,
 
   offset = parent->first_child_offset - g_leaf_node_table_offset;
   leaf_start = g_leaf_node_table + offset;
-  leaf_end = leaf_start + (parent->num_children - 1);
+  leaf_end = leaf_start + ((int) parent->num_children - 1);
   match = FindLeafNodeInRange(component,
                               leaf_start,
                               leaf_end);