Thread (6 messages) 6 messages, 2 authors, 2016-06-15

Re: [PATCH] disable grafts during fetch/push/bundle

From: Eric Sunshine <hidden>
Date: 2016-06-15 23:00:11

On Tue, Mar 4, 2014 at 8:05 PM, Jeff King [off-list ref] wrote:
On Tue, Mar 04, 2014 at 08:00:44PM -0500, Eric Sunshine wrote:
quoted
quoted
quoted
quoted
+int commit_grafts_loaded(void)
+{
+       return !!commit_graft_nr;
+}
Did you mean !!commit_graft ?
Shouldn't they produce the same results?
Yes they should, but the use of !! seemed to imply that you wanted to
apply it to the pointer value. (If you indeed intended to use
commit_graft_nr, then 'return commit_graft_nr', without !!, would have
been sufficient and idiomatic C.)
I just wanted to normalize the return value to a boolean 0/1. Even when
the input is an int, it eliminates surprises when you try to assign the
result to a bitfield or other smaller-width type.
Thanks for the explanation.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help