Thread (39 messages) flat view 39 messages, 3 authors, 2016-11-09

Re: [PATCH v1 09/19] config: add git_config_get_max_percent_split_change()

From: Duy Nguyen <hidden>
Date: 2016-10-25 10:06:40

On Sun, Oct 23, 2016 at 4:26 PM, Christian Couder
[off-list ref] wrote:
This new function will be used in a following commit to get the
+int git_config_get_max_percent_split_change(void)
+{
+       int val = -1;
+
+       if (!git_config_get_int("splitindex.maxpercentchange", &val)) {
+               if (0 <= val && val <= 100)
+                       return val;
+
+               error("splitindex.maxpercentchange value '%d' "
We should keep camelCase form for easy reading. And wrap this string with _().
+                     "should be between 0 and 100", val);
I wonder if anybody would try to put 12.3 here and confused by the
error message, because 0 <= 12.3 <= 100, but it's not an integer..
Ah.. never mind, die_bad_number() would be called first in this case
with a loud and clear complaint.
+               return -1;
+       }
+
+       return -1; /* default value */
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help