Re: [PATCH v3] graph API: Added logic for colored edges
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 12, 2009, 18:45 UTC
- Message-ID
- <7vk55p7lu3.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <b2e43f8f0904121043o425ac311ib32c18625fac2c0e@mail.gmail.com>
Allan Caffee <allan.caffee@gmail.com> writes:
Show 6 quoted lines
>> > +const unsigned short GIT_NOT_A_COLOR = -1; >> >> That (-1) is an unusual value for an *unsigned* short variable. > > Perhaps you would prefer USHRT_MAX? I noticed that none of the existing > code #includes limits.h. Is it safe to assume this header is present?
I expected to see something like
#define COLUMN_COLORS_MAX (ARRAY_SIZE(column_colors)+1)
write_with_color(...) {
if (c->color < COLUMN_COLORS_MAX)
add color prefix;
add string
if (c->color < COLUMN_COLORS_MAX)
add color suffix;
}instead, actually, and was a bit surprised with (-1).