diff options
author | Ben Straub <bs@github.com> | 2012-11-27 18:59:22 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-27 18:59:22 -0800 |
commit | 64c5112188647fcbfbe2bbfb897abfbc21912ba8 (patch) | |
tree | 5113408a049178d14664f72cc1666655783d95d5 /examples/general.c | |
parent | 469827812f95e979e3c6468567b2c9ed138a9849 (diff) | |
parent | ca94e031fa21787ae6336f0aada1b01b2dd22077 (diff) | |
download | libgit2-64c5112188647fcbfbe2bbfb897abfbc21912ba8.tar.gz |
Merge pull request #1087 from libgit2/great-renaming
The Great Renaming of 2012
Diffstat (limited to 'examples/general.c')
-rw-r--r-- | examples/general.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/general.c b/examples/general.c index 9ccb4c56e..9ea264ec6 100644 --- a/examples/general.c +++ b/examples/general.c @@ -261,8 +261,8 @@ int main (int argc, char** argv) git_tree_lookup(&tree, repo, &oid); // Getting the count of entries in the tree so you can iterate over them if you want to. - int cnt = git_tree_entrycount(tree); // 3 - printf("tree entries: %d\n", cnt); + size_t cnt = git_tree_entrycount(tree); // 3 + printf("tree entries: %d\n", (int)cnt); entry = git_tree_entry_byindex(tree, 0); printf("Entry name: %s\n", git_tree_entry_name(entry)); // "hello.c" @@ -298,7 +298,7 @@ int main (int argc, char** argv) // Note that this buffer may not be contain ASCII data for certain blobs (e.g. binary files): // do not consider the buffer a NULL-terminated string, and use the `git_blob_rawsize` attribute to // find out its exact size in bytes - printf("Blob Size: %ld\n", git_blob_rawsize(blob)); // 8 + printf("Blob Size: %ld\n", (long)git_blob_rawsize(blob)); // 8 git_blob_rawcontent(blob); // "content" // ### Revwalking @@ -371,7 +371,7 @@ int main (int argc, char** argv) // All these properties are exported publicly in the `git_index_entry` struct ecount = git_index_entrycount(index); for (i = 0; i < ecount; ++i) { - git_index_entry *e = git_index_get_byindex(index, i); + const git_index_entry *e = git_index_get_byindex(index, i); printf("path: %s\n", e->path); printf("mtime: %d\n", (int)e->mtime.seconds); @@ -405,12 +405,12 @@ int main (int argc, char** argv) switch (git_reference_type(ref)) { case GIT_REF_OID: - git_oid_fmt(out, git_reference_oid(ref)); + git_oid_fmt(out, git_reference_target(ref)); printf("%s [%s]\n", refname, out); break; case GIT_REF_SYMBOLIC: - printf("%s => %s\n", refname, git_reference_target(ref)); + printf("%s => %s\n", refname, git_reference_symbolic_target(ref)); break; default: fprintf(stderr, "Unexpected reference type\n"); |