From 8d1e479d1dcf7789be99a6cd0db0b883a90299dc Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 18 Oct 2018 22:18:42 +0700 Subject: [PATCH] Use bool literals instead of 0/1. --- src/hb-common.cc | 2 +- src/hb-coretext.cc | 4 ++-- src/hb-ot-layout-gpos-table.hh | 2 +- src/hb-ot-tag.cc | 2 +- src/hb-shape-plan.cc | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hb-common.cc b/src/hb-common.cc index 4940e7fb5..ba48dd561 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -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) diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc index aa3921a3f..9f7745dbf 100644 --- a/src/hb-coretext.cc +++ b/src/hb-coretext.cc @@ -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); diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 4f81b3278..dad6c4ea9 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -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); } diff --git a/src/hb-ot-tag.cc b/src/hb-ot-tag.cc index 3d4e8b066..4dba9c31a 100644 --- a/src/hb-ot-tag.cc +++ b/src/hb-ot-tag.cc @@ -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 diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index b0cf1e92d..b2289f869 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -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) && \