Commits

Serge Zaitsev committed 061cebe

fixed some type names

  • Participants
  • Parent commits 8384d19

Comments (0)

Files changed (1)

 struct index {
 	/* Indexed file names */
 	char **files;
-	uint32_t files_count;
+	size_t files_count;
 	/* Postings (only file ids, compressed) */
-	char *fileids;
+	unsigned char *fileids;
 	size_t fileids_count;
 	size_t fileids_size;
 	/* Postings index */
 struct index_writer {
 	/* Indexed file names */
 	char **files;
-	uint32_t files_count;
+	size_t files_count;
 	/* Postings */
 	struct posting *postings;
 	size_t postings_count;
 	char *p = map;
 	struct index *index;
 	index = index_create();
-	index->files_count = *(uint32_t *)p; p += sizeof(uint32_t);
+	index->files_count = *(size_t *) p; p += sizeof(index->files_count);
 	index->files = malloc(sizeof(index->files[0]) * index->files_count);
 	for (i = 0; i < index->files_count; i++) {
 		uint32_t len = *(uint32_t *) p; p += sizeof(uint32_t);
 
 	index->fileids_count = *(size_t *) p; p += sizeof(size_t);
 	index->fileids_size = *(size_t *) p; p += sizeof(size_t);
-	index->fileids = p; p += index->fileids_size;
+	index->fileids = (unsigned char *) p; p += index->fileids_size;
 
 	index->entries_count = *(size_t *) p; p += sizeof(size_t);
 	index->entries = (struct post_entry *) p;
 		size_t k;
 		int offset = index->entries[j].offset;
 		for (k = 0; k < index->entries[j].count; k++) {
-			uint32_t fileid;
-			int n = varint_decode((uint8_t*) (index->fileids + offset), 5, &fileid);
+			maxint_t fileid;
+			int n = varint_decode((index->fileids + offset), 5, &fileid);
 			if (n < 0) {
 				//
 			}
 	entry.count = entry.offset = 0;
 
 	for (i = 0; i < writer->postings_count; i++) {
-		uint32_t id = writer->postings[i].fileno;
+		int id = writer->postings[i].fileno;
 		uint32_t t = writer->postings[i].trigram;
 
 		/* save file id (compressed), increase size */