Re: [PATCH v3] graph API: Added logic for colored edges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allan Caffee <allan.caffee@xxxxxxxxx> writes:

>> > +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).

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]