Use bool literals instead of 0/1.
authorBruce Mitchener <bruce.mitchener@gmail.com>
Thu, 18 Oct 2018 15:18:42 +0000 (22:18 +0700)
committerKhaled Hosny <khaledhosny@eglug.org>
Fri, 19 Oct 2018 16:05:46 +0000 (18:05 +0200)
src/hb-common.cc
src/hb-coretext.cc
src/hb-ot-layout-gpos-table.hh
src/hb-ot-tag.cc
src/hb-shape-plan.cc

index 4940e7f..ba48dd5 100644 (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)
index aa3921a..9f7745d 100644 (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);
index 4f81b32..dad6c4e 100644 (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); }
index 3d4e8b0..4dba9c3 100644 (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
index b0cf1e9..b2289f8 100644 (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) && \