Commit a7f9d64ddf028029e3ef5123758712ec89840a5f

Stefan Sperling 2019-01-13T01:52:51

change GOT_INDEX_ENTRY prefix to GOT_FILEIDX

diff --git a/lib/fileindex.c b/lib/fileindex.c
index 3d56217..257b5a5 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -54,11 +54,11 @@ got_fileindex_entry_update(struct got_fileindex_entry *entry,
 	entry->gid = sb.st_gid;
 	entry->size = (sb.st_size & 0xffffffff);
 	if (sb.st_mode & S_IFLNK)
-		entry->mode = GOT_INDEX_ENTRY_MODE_SYMLINK;
+		entry->mode = GOT_FILEIDX_MODE_SYMLINK;
 	else
-		entry->mode = GOT_INDEX_ENTRY_MODE_REGULAR_FILE;
+		entry->mode = GOT_FILEIDX_MODE_REGULAR_FILE;
 	entry->mode |= ((sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) <<
-	    GOT_INDEX_ENTRY_MODE_PERMS_SHIFT);
+	    GOT_FILEIDX_MODE_PERMS_SHIFT);
 	memcpy(entry->blob_sha1, blob_sha1, SHA1_DIGEST_LENGTH);
 	memcpy(entry->commit_sha1, commit_sha1, SHA1_DIGEST_LENGTH);
 
@@ -85,8 +85,8 @@ got_fileindex_entry_alloc(struct got_fileindex_entry **entry,
 	}
 
 	len = strlen(relpath);
-	if (len > GOT_INDEX_ENTRY_F_PATH_LEN)
-		len = GOT_INDEX_ENTRY_F_PATH_LEN;
+	if (len > GOT_FILEIDX_F_PATH_LEN)
+		len = GOT_FILEIDX_F_PATH_LEN;
 	(*entry)->flags |= len;
 
 	return got_fileindex_entry_update(*entry, ondisk_path, blob_sha1,
@@ -116,7 +116,7 @@ got_fileindex_entry_add(struct got_fileindex *fileindex,
     struct got_fileindex_entry *entry)
 {
 	/* Flag this entry until it gets written out to disk. */
-	entry->flags |= GOT_INDEX_ENTRY_F_INTENT_TO_ADD;
+	entry->flags |= GOT_FILEIDX_F_INTENT_TO_ADD;
 
 	return add_entry(fileindex, entry);
 }
@@ -322,7 +322,7 @@ got_fileindex_write(struct got_fileindex *fileindex, FILE *outfile)
 		return got_ferror(outfile, GOT_ERR_IO);
 
 	RB_FOREACH(entry, got_fileindex_tree, &fileindex->entries) {
-		entry->flags &= ~GOT_INDEX_ENTRY_F_INTENT_TO_ADD;
+		entry->flags &= ~GOT_FILEIDX_F_INTENT_TO_ADD;
 		err = write_fileindex_entry(&ctx, entry, outfile);
 		if (err)
 			return err;
@@ -597,7 +597,7 @@ walk_fileindex(struct got_fileindex *fileindex, struct got_fileindex_entry *ie)
 	next = RB_NEXT(got_fileindex_tree, &fileindex->entries, ie);
 
 	/* Skip entries which were newly added by diff callbacks. */
-	while (next && (next->flags & GOT_INDEX_ENTRY_F_INTENT_TO_ADD))
+	while (next && (next->flags & GOT_FILEIDX_F_INTENT_TO_ADD))
 		next = RB_NEXT(got_fileindex_tree, &fileindex->entries, next);
 
 	return next;
diff --git a/lib/got_lib_fileindex.h b/lib/got_lib_fileindex.h
index 3aee1d3..4a01cb9 100644
--- a/lib/got_lib_fileindex.h
+++ b/lib/got_lib_fileindex.h
@@ -36,11 +36,11 @@ struct got_fileindex_entry {
 	uint32_t size;
 
 	uint16_t mode;
-#define GOT_INDEX_ENTRY_MODE_FILE_TYPE		0x000f
-#define GOT_INDEX_ENTRY_MODE_REGULAR_FILE	1
-#define GOT_INDEX_ENTRY_MODE_SYMLINK		2
-#define GOT_INDEX_ENTRY_MODE_PERMS		0xff10
-#define GOT_INDEX_ENTRY_MODE_PERMS_SHIFT	4
+#define GOT_FILEIDX_MODE_FILE_TYPE	0x000f
+#define GOT_FILEIDX_MODE_REGULAR_FILE	1
+#define GOT_FILEIDX_MODE_SYMLINK	2
+#define GOT_FILEIDX_MODE_PERMS		0xff10
+#define GOT_FILEIDX_MODE_PERMS_SHIFT	4
 
 	/* SHA1 of corresponding blob in repository. */
 	uint8_t blob_sha1[SHA1_DIGEST_LENGTH];
@@ -49,11 +49,11 @@ struct got_fileindex_entry {
 	uint8_t commit_sha1[SHA1_DIGEST_LENGTH];
 
 	uint32_t flags;
-#define GOT_INDEX_ENTRY_F_PATH_LEN	0x00000fff
-#define GOT_INDEX_ENTRY_F_STAGE		0x00003000
-#define GOT_INDEX_ENTRY_F_EXTENDED	0x00004000
-#define GOT_INDEX_ENTRY_F_ASSUME_VALID	0x00008000
-#define GOT_INDEX_ENTRY_F_INTENT_TO_ADD	0x20000000
+#define GOT_FILEIDX_F_PATH_LEN		0x00000fff
+#define GOT_FILEIDX_F_STAGE		0x00003000
+#define GOT_FILEIDX_F_EXTENDED		0x00004000
+#define GOT_FILEIDX_F_ASSUME_VALID	0x00008000
+#define GOT_FILEIDX_F_INTENT_TO_ADD	0x20000000
 
 	/*
 	 * UNIX-style path, relative to work tree root.
@@ -65,10 +65,10 @@ struct got_fileindex_entry {
 };
 
 /* "Stages" of a file afflicted by a 3-way merge conflict. */
-#define GOT_INDEX_ENTRY_STAGE_MERGED	0
-#define GOT_INDEX_ENTRY_STAGE_ANCESTOR	1
-#define GOT_INDEX_ENTRY_STAGE_OURS	2
-#define GOT_INDEX_ENTRY_STAGE_THEIRS	3
+#define GOT_FILEIDX_STAGE_MERGED	0
+#define GOT_FILEIDX_STAGE_ANCESTOR	1
+#define GOT_FILEIDX_STAGE_OURS		2
+#define GOT_FILEIDX_STAGE_THEIRS	3
 
 struct got_fileindex;