Use bool literals instead of 0/1.

This commit is contained in:
Bruce Mitchener 2018-10-18 22:18:42 +07:00 committed by Khaled Hosny
parent 257d0e5aa3
commit 8d1e479d1d
5 changed files with 9 additions and 9 deletions

View File

@ -45,7 +45,7 @@ _hb_options_init (void)
{
hb_options_union_t u;
u.i = 0;
u.opts.initialized = 1;
u.opts.initialized = true;
const char *c = getenv ("HB_OPTIONS");
if (c)

View File

@ -643,7 +643,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
CFStringRef string_ref = nullptr;
CTLineRef line = nullptr;
if (0)
if (false)
{
resize_and_retry:
DEBUG_MSG (CORETEXT, buffer, "Buffer resize");
@ -1054,7 +1054,7 @@ resize_and_retry:
*
* https://crbug.com/419769
*/
if (0)
if (false)
{
/* Make sure all runs had the expected direction. */
bool backward = HB_DIRECTION_IS_BACKWARD (buffer->props.direction);

View File

@ -1164,7 +1164,7 @@ struct MarkBasePosFormat1
))
break;
skippy_iter.reject ();
} while (1);
} while (true);
/* Checking that matched glyph is actually a base glyph by GDEF is too strong; disabled */
//if (!_hb_glyph_info_is_base_glyph (&buffer->info[skippy_iter.idx])) { return_trace (false); }

View File

@ -201,7 +201,7 @@ subtag_matches (const char *lang_str,
if (!ISALNUM (s[strlen (subtag)]))
return true;
lang_str = s + strlen (subtag);
} while (1);
} while (true);
}
static hb_bool_t

View File

@ -64,7 +64,7 @@ hb_shape_plan_plan (hb_shape_plan_t *shape_plan,
if (likely (!shaper_list)) {
for (unsigned int i = 0; i < HB_SHAPERS_COUNT; i++)
if (0)
if (false)
;
#define HB_SHAPER_IMPLEMENT(shaper) \
else if (shapers[i].func == _hb_##shaper##_shape) \
@ -73,7 +73,7 @@ hb_shape_plan_plan (hb_shape_plan_t *shape_plan,
#undef HB_SHAPER_IMPLEMENT
} else {
for (; *shaper_list; shaper_list++)
if (0)
if (false)
;
#define HB_SHAPER_IMPLEMENT(shaper) \
else if (0 == strcmp (*shaper_list, #shaper)) \
@ -346,7 +346,7 @@ hb_shape_plan_execute (hb_shape_plan_t *shape_plan,
_hb_##shaper##_shape (shape_plan, font, buffer, features, num_features); \
} HB_STMT_END
if (0)
if (false)
;
#define HB_SHAPER_IMPLEMENT(shaper) \
else if (shape_plan->shaper_func == _hb_##shaper##_shape) \
@ -501,7 +501,7 @@ hb_shape_plan_create_cached2 (hb_face_t *face,
/* Choose shaper. Adapted from hb_shape_plan_plan().
* Must choose shaper exactly the same way as that function. */
for (const char * const *shaper_item = shaper_list; *shaper_item; shaper_item++)
if (0)
if (false)
;
#define HB_SHAPER_IMPLEMENT(shaper) \
else if (0 == strcmp (*shaper_item, #shaper) && \