commit 116d19d9395e2c1d7502e32441724cda7b408ad2 from: Mark Jamsek date: Fri Sep 02 07:26:45 2022 UTC sync files from diff.git 35eae7fa6b782ae1d000183ef2efc4383dfec4cd This removes the gcc ternary if extension (includes follow-up diff.git fix for missing '\' in wrapped macro 7a38b3a33f8b124c9c01da154dfdf711d328b01d) commit - 2db401bd3a14512e3a1f1cbe686fff37b2c56764 commit + 116d19d9395e2c1d7502e32441724cda7b408ad2 blob - 8b503d2f97ddd5ce74010697dc9c40b1e8a4b7af blob + 453b71cedd7f9b2a173beaa9d2db148724f992e4 --- lib/arraylist.h +++ lib/arraylist.h @@ -65,7 +65,8 @@ (ARRAY_LIST).allocated + \ ((ARRAY_LIST).allocated ? \ (ARRAY_LIST).allocated / 2 : \ - (ARRAY_LIST).alloc_blocksize ? : 8), \ + (ARRAY_LIST).alloc_blocksize ? \ + (ARRAY_LIST).alloc_blocksize : 8), \ sizeof(*(ARRAY_LIST).head)); \ if ((ARRAY_LIST).p == NULL) { \ NEW_ITEM_P = NULL; \ @@ -74,7 +75,8 @@ (ARRAY_LIST).allocated += \ (ARRAY_LIST).allocated ? \ (ARRAY_LIST).allocated / 2 : \ - (ARRAY_LIST).alloc_blocksize ? : 8, \ + (ARRAY_LIST).alloc_blocksize ? \ + (ARRAY_LIST).alloc_blocksize : 8, \ (ARRAY_LIST).head = (ARRAY_LIST).p; \ (ARRAY_LIST).p = NULL; \ }; \ blob - dd83abd4cdf8024f27f362b535f73b9a965c0073 blob + c531ad29bc45c650dd4e3dbc4773479aafd7676b --- lib/diff_main.c +++ lib/diff_main.c @@ -602,7 +602,8 @@ diff_main(const struct diff_config *config, struct dif struct diff_state state = { .result = result, - .recursion_depth_left = config->max_recursion_depth ? : UINT_MAX, + .recursion_depth_left = config->max_recursion_depth ? + config->max_recursion_depth : UINT_MAX, .kd_buf = NULL, .kd_buf_size = 0, }; blob - f9f748fd298e5716a0fbfa2a0ff0277abc7a331e blob + 3047221aa5a15e4fc2a5dea8267e97864da21264 --- lib/diff_output.c +++ lib/diff_output.c @@ -365,7 +365,7 @@ diff_output_get_label_left(const struct diff_input_inf if (info->flags & DIFF_INPUT_LEFT_NONEXISTENT) return "/dev/null"; - return info->left_path ? : "a"; + return info->left_path ? info->left_path : "a"; } const char * @@ -374,5 +374,5 @@ diff_output_get_label_right(const struct diff_input_in if (info->flags & DIFF_INPUT_RIGHT_NONEXISTENT) return "/dev/null"; - return info->right_path ? : "b"; + return info->right_path ? info->right_path : "b"; }