unsigned short flags;
unsigned short flags_extended;
- const char *path;
+ char *path;
} git_index_entry;
/** Representation of an unmerged file entry in the index. */
typedef struct git_index_entry_unmerged {
unsigned int mode[3];
git_oid oid[3];
- const char *path;
+ char *path;
} git_index_entry_unmerged;
/**
for (i = 0; i < index->entries.length; ++i) {
git_index_entry *e;
e = git_vector_get(&index->entries, i);
- free((char *)e->path);
+ free(e->path);
free(e);
}
for (i = 0; i < index->unmerged.length; ++i) {
git_index_entry_unmerged *e;
e = git_vector_get(&index->unmerged, i);
- free((char *)e->path);
+ free(e->path);
free(e);
}
/* exists, replace it */
entry_array = (git_index_entry **) index->entries.contents;
- free((char *)entry_array[position]->path);
+ free(entry_array[position]->path);
free(entry_array[position]);
entry_array[position] = entry;
return GIT_SUCCESS;
cleanup_oom:
- free((char *)entry->path);
+ free(entry->path);
free(entry);
return GIT_ENOMEM;;
}
continue;
if (size < 20)
return git__throw(GIT_ERROR, "Failed to read unmerged entries");
- git_oid_fromraw(&lost->oid[i], (unsigned char *) buffer);
+ git_oid_fromraw(&lost->oid[i], (const unsigned char *) buffer);
size -= 20;
buffer += 20;
}
dest->flags = ntohs(source->flags);
if (dest->flags & GIT_IDXENTRY_EXTENDED) {
- struct entry_long *source_l = (struct entry_long *)source;
+ const struct entry_long *source_l = (const struct entry_long *)source;
path_ptr = source_l->path;
flags_raw = ntohs(source_l->flags_extended);