object_info: change member name from 'typename' to 'type_name'

Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Williams committed Feb 14, 2018 at 10:59 UTC 6ca32f47145370b6c0d956d1f8568d7e0595f195
4 files changed +10 -10
builtin/cat-file.c
+1 -1
@@ -76,7 +76,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
76 buf = NULL;
77 switch (opt) {
78 case 't':
79 - oi.typename = &sb;
79 + oi.type_name = &sb;
80 if (sha1_object_info_extended(oid.hash, &oi, flags) < 0)
81 die("git cat-file: could not get object info");
82 if (sb.len) {
cache.h
+1 -1
@@ -1744,7 +1744,7 @@ struct object_info {
1744 unsigned long *sizep;
1745 off_t *disk_sizep;
1746 unsigned char *delta_base_sha1;
1747 - struct strbuf *typename;
1747 + struct strbuf *type_name;
1748 void **contentp;
1749
1750 /* Response */
packfile.c
+3 -3
@@ -1350,16 +1350,16 @@ int packed_object_info(struct packed_git *p, off_t obj_offset,
1350 *oi->disk_sizep = revidx[1].offset - obj_offset;
1351 }
1352
1353 - if (oi->typep || oi->typename) {
1353 + if (oi->typep || oi->type_name) {
1354 enum object_type ptot;
1355 ptot = packed_to_object_type(p, obj_offset, type, &w_curs,
1356 curpos);
1357 if (oi->typep)
1358 *oi->typep = ptot;
1359 - if (oi->typename) {
1359 + if (oi->type_name) {
1360 const char *tn = typename(ptot);
1361 if (tn)
1362 - strbuf_addstr(oi->typename, tn);
1362 + strbuf_addstr(oi->type_name, tn);
1363 }
1364 if (ptot < 0) {
1365 type = OBJ_BAD;
sha1_file.c
+5 -5
@@ -1087,8 +1087,8 @@ static int parse_sha1_header_extended(const char *hdr, struct object_info *oi,
1087 }
1088
1089 type = type_from_string_gently(type_buf, type_len, 1);
1090 - if (oi->typename)
1091 - strbuf_add(oi->typename, type_buf, type_len);
1090 + if (oi->type_name)
1091 + strbuf_add(oi->type_name, type_buf, type_len);
1092 /*
1093 * Set type to 0 if its an unknown object and
1094 * we're obtaining the type using '--allow-unknown-type'
@@ -1158,7 +1158,7 @@ static int sha1_loose_object_info(const unsigned char *sha1,
1158 * return value implicitly indicates whether the
1159 * object even exists.
1160 */
1161 - if (!oi->typep && !oi->typename && !oi->sizep && !oi->contentp) {
1161 + if (!oi->typep && !oi->type_name && !oi->sizep && !oi->contentp) {
1162 const char *path;
1163 struct stat st;
1164 if (stat_sha1_file(sha1, &st, &path) < 0)
@@ -1239,8 +1239,8 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi,
1239 *(oi->disk_sizep) = 0;
1240 if (oi->delta_base_sha1)
1241 hashclr(oi->delta_base_sha1);
1242 - if (oi->typename)
1243 - strbuf_addstr(oi->typename, typename(co->type));
1242 + if (oi->type_name)
1243 + strbuf_addstr(oi->type_name, typename(co->type));
1244 if (oi->contentp)
1245 *oi->contentp = xmemdupz(co->buf, co->size);
1246 oi->whence = OI_CACHED;