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>
This commit is contained in:
parent
5be1f00a9a
commit
6ca32f4714
@ -76,7 +76,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
|
|||||||
buf = NULL;
|
buf = NULL;
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 't':
|
case 't':
|
||||||
oi.typename = &sb;
|
oi.type_name = &sb;
|
||||||
if (sha1_object_info_extended(oid.hash, &oi, flags) < 0)
|
if (sha1_object_info_extended(oid.hash, &oi, flags) < 0)
|
||||||
die("git cat-file: could not get object info");
|
die("git cat-file: could not get object info");
|
||||||
if (sb.len) {
|
if (sb.len) {
|
||||||
|
2
cache.h
2
cache.h
@ -1744,7 +1744,7 @@ struct object_info {
|
|||||||
unsigned long *sizep;
|
unsigned long *sizep;
|
||||||
off_t *disk_sizep;
|
off_t *disk_sizep;
|
||||||
unsigned char *delta_base_sha1;
|
unsigned char *delta_base_sha1;
|
||||||
struct strbuf *typename;
|
struct strbuf *type_name;
|
||||||
void **contentp;
|
void **contentp;
|
||||||
|
|
||||||
/* Response */
|
/* Response */
|
||||||
|
@ -1350,16 +1350,16 @@ int packed_object_info(struct packed_git *p, off_t obj_offset,
|
|||||||
*oi->disk_sizep = revidx[1].offset - obj_offset;
|
*oi->disk_sizep = revidx[1].offset - obj_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oi->typep || oi->typename) {
|
if (oi->typep || oi->type_name) {
|
||||||
enum object_type ptot;
|
enum object_type ptot;
|
||||||
ptot = packed_to_object_type(p, obj_offset, type, &w_curs,
|
ptot = packed_to_object_type(p, obj_offset, type, &w_curs,
|
||||||
curpos);
|
curpos);
|
||||||
if (oi->typep)
|
if (oi->typep)
|
||||||
*oi->typep = ptot;
|
*oi->typep = ptot;
|
||||||
if (oi->typename) {
|
if (oi->type_name) {
|
||||||
const char *tn = typename(ptot);
|
const char *tn = typename(ptot);
|
||||||
if (tn)
|
if (tn)
|
||||||
strbuf_addstr(oi->typename, tn);
|
strbuf_addstr(oi->type_name, tn);
|
||||||
}
|
}
|
||||||
if (ptot < 0) {
|
if (ptot < 0) {
|
||||||
type = OBJ_BAD;
|
type = OBJ_BAD;
|
||||||
|
10
sha1_file.c
10
sha1_file.c
@ -1087,8 +1087,8 @@ static int parse_sha1_header_extended(const char *hdr, struct object_info *oi,
|
|||||||
}
|
}
|
||||||
|
|
||||||
type = type_from_string_gently(type_buf, type_len, 1);
|
type = type_from_string_gently(type_buf, type_len, 1);
|
||||||
if (oi->typename)
|
if (oi->type_name)
|
||||||
strbuf_add(oi->typename, type_buf, type_len);
|
strbuf_add(oi->type_name, type_buf, type_len);
|
||||||
/*
|
/*
|
||||||
* Set type to 0 if its an unknown object and
|
* Set type to 0 if its an unknown object and
|
||||||
* we're obtaining the type using '--allow-unknown-type'
|
* we're obtaining the type using '--allow-unknown-type'
|
||||||
@ -1158,7 +1158,7 @@ static int sha1_loose_object_info(const unsigned char *sha1,
|
|||||||
* return value implicitly indicates whether the
|
* return value implicitly indicates whether the
|
||||||
* object even exists.
|
* object even exists.
|
||||||
*/
|
*/
|
||||||
if (!oi->typep && !oi->typename && !oi->sizep && !oi->contentp) {
|
if (!oi->typep && !oi->type_name && !oi->sizep && !oi->contentp) {
|
||||||
const char *path;
|
const char *path;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat_sha1_file(sha1, &st, &path) < 0)
|
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,
|
|||||||
*(oi->disk_sizep) = 0;
|
*(oi->disk_sizep) = 0;
|
||||||
if (oi->delta_base_sha1)
|
if (oi->delta_base_sha1)
|
||||||
hashclr(oi->delta_base_sha1);
|
hashclr(oi->delta_base_sha1);
|
||||||
if (oi->typename)
|
if (oi->type_name)
|
||||||
strbuf_addstr(oi->typename, typename(co->type));
|
strbuf_addstr(oi->type_name, typename(co->type));
|
||||||
if (oi->contentp)
|
if (oi->contentp)
|
||||||
*oi->contentp = xmemdupz(co->buf, co->size);
|
*oi->contentp = xmemdupz(co->buf, co->size);
|
||||||
oi->whence = OI_CACHED;
|
oi->whence = OI_CACHED;
|
||||||
|
Loading…
Reference in New Issue
Block a user