diff options
author | Russell Belfer <rb@github.com> | 2012-09-25 16:31:46 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-09-25 16:35:05 -0700 |
commit | bae957b95d59a840df72a725b06f00635471cfd8 (patch) | |
tree | 64eb7f9f52c9d27f4aa0ad00d2249af39e0ee2fc /include/git2/diff.h | |
parent | 642863086575a61b3ed0bbbe909f4f07d87ff9db (diff) | |
download | libgit2-bae957b95d59a840df72a725b06f00635471cfd8.tar.gz |
Add const to all shared pointers in diff API
There are a lot of places where the diff API gives the user access
to internal data structures and many of these were being exposed
through non-const pointers. This replaces them all with const
pointers for any object that the user can access but is still
owned internally to the git_diff_list or git_diff_patch objects.
This will probably break some bindings... Sorry!
Diffstat (limited to 'include/git2/diff.h')
-rw-r--r-- | include/git2/diff.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h index 154264546..1c41a54ba 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -122,7 +122,7 @@ typedef enum { */ typedef struct { git_oid oid; - char *path; + const char *path; git_off_t size; unsigned int flags; uint16_t mode; @@ -154,7 +154,7 @@ typedef struct { */ typedef int (*git_diff_file_fn)( void *cb_data, - git_diff_delta *delta, + const git_diff_delta *delta, float progress); /** @@ -172,8 +172,8 @@ typedef struct { */ typedef int (*git_diff_hunk_fn)( void *cb_data, - git_diff_delta *delta, - git_diff_range *range, + const git_diff_delta *delta, + const git_diff_range *range, const char *header, size_t header_len); @@ -213,8 +213,8 @@ enum { */ typedef int (*git_diff_data_fn)( void *cb_data, - git_diff_delta *delta, - git_diff_range *range, + const git_diff_delta *delta, + const git_diff_range *range, char line_origin, /**< GIT_DIFF_LINE_... value from above */ const char *content, size_t content_len); @@ -486,7 +486,7 @@ GIT_EXTERN(size_t) git_diff_num_deltas_of_type( */ GIT_EXTERN(int) git_diff_get_patch( git_diff_patch **patch, - git_diff_delta **delta, + const git_diff_delta **delta, git_diff_list *diff, size_t idx); @@ -525,7 +525,7 @@ GIT_EXTERN(size_t) git_diff_patch_num_hunks( * @return 0 on success, GIT_ENOTFOUND if hunk_idx out of range, <0 on error */ GIT_EXTERN(int) git_diff_patch_get_hunk( - git_diff_range **range, + const git_diff_range **range, const char **header, size_t *header_len, size_t *lines_in_hunk, @@ -595,7 +595,7 @@ GIT_EXTERN(int) git_diff_patch_get_line_in_hunk( GIT_EXTERN(int) git_diff_blobs( git_blob *old_blob, git_blob *new_blob, - git_diff_options *options, + const git_diff_options *options, void *cb_data, git_diff_file_fn file_cb, git_diff_hunk_fn hunk_cb, |