Cleanup TRUE/FALSE vs true/false
diff --git a/util/hb-shape.cc b/util/hb-shape.cc
index d459b89..b23519b 100644
--- a/util/hb-shape.cc
+++ b/util/hb-shape.cc
@@ -75,7 +75,7 @@
void finish (const font_options_t *font_opts)
{
hb_font_destroy (font);
- g_string_free (gs, TRUE);
+ g_string_free (gs, true);
gs = NULL;
font = NULL;
}
diff --git a/util/helper-cairo.cc b/util/helper-cairo.cc
index 77fd1a6..0cdfd63 100644
--- a/util/helper-cairo.cc
+++ b/util/helper-cairo.cc
@@ -50,7 +50,7 @@
cairo_surface_t *surface;
surface = cairo_ps_surface_create_for_stream (write_func, closure, width, height);
- cairo_ps_surface_set_eps (surface, TRUE);
+ cairo_ps_surface_set_eps (surface, true);
return surface;
}
@@ -121,7 +121,7 @@
closure->write_func,
closure->closure);
if (status != CAIRO_STATUS_SUCCESS)
- fail (FALSE, "Failed to write output: %s",
+ fail (false, "Failed to write output: %s",
cairo_status_to_string (status));
}
@@ -150,7 +150,7 @@
}
cairo_status_t status = cairo_surface_status (surface);
if (status != CAIRO_STATUS_SUCCESS)
- fail (FALSE, "Failed to create cairo surface: %s",
+ fail (false, "Failed to create cairo surface: %s",
cairo_status_to_string (status));
finalize_closure_t *ansi_closure = g_new0 (finalize_closure_t, 1);
@@ -179,7 +179,7 @@
closure->write_func,
closure->closure);
if (status != CAIRO_STATUS_SUCCESS)
- fail (FALSE, "Failed to write output: %s",
+ fail (false, "Failed to write output: %s",
cairo_status_to_string (status));
}
@@ -208,7 +208,7 @@
}
cairo_status_t status = cairo_surface_status (surface);
if (status != CAIRO_STATUS_SUCCESS)
- fail (FALSE, "Failed to create cairo surface: %s",
+ fail (false, "Failed to create cairo surface: %s",
cairo_status_to_string (status));
finalize_closure_t *png_closure = g_new0 (finalize_closure_t, 1);
@@ -240,7 +240,7 @@
size -= ret;
data += ret;
if (size && ferror (fp))
- fail (FALSE, "Failed to write output: %s", strerror (errno));
+ fail (false, "Failed to write output: %s", strerror (errno));
}
return CAIRO_STATUS_SUCCESS;
@@ -317,7 +317,7 @@
else if (constructor2)
surface = constructor2 (stdio_write_func, f, w, h, content);
else
- fail (FALSE, "Unknown output format `%s'", extension);
+ fail (false, "Unknown output format `%s'", extension);
cairo_t *cr = cairo_create (surface);
content = cairo_surface_get_content (surface);
@@ -356,7 +356,7 @@
cairo_status_t status = cairo_status (cr);
if (status != CAIRO_STATUS_SUCCESS)
- fail (FALSE, "Failed: %s",
+ fail (false, "Failed: %s",
cairo_status_to_string (status));
cairo_destroy (cr);
}
diff --git a/util/main-font-text.hh b/util/main-font-text.hh
index 1dbaaff..44e3bfb 100644
--- a/util/main-font-text.hh
+++ b/util/main-font-text.hh
@@ -49,7 +49,7 @@
if (argc && !font_opts.font_file) font_opts.font_file = argv[0], argc--, argv++;
if (argc && !input.text && !input.text_file) input.text = argv[0], argc--, argv++;
if (argc)
- fail (TRUE, "Too many arguments on the command line");
+ fail (true, "Too many arguments on the command line");
if (!font_opts.font_file)
options.usage ();
if (!input.text && !input.text_file)
diff --git a/util/options.cc b/util/options.cc
index 785222b..db1b244 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -48,7 +48,7 @@
}
-hb_bool_t debug = FALSE;
+hb_bool_t debug = false;
static gchar *
shapers_to_string (void)
@@ -62,7 +62,7 @@
}
g_string_truncate (shapers, MAX (0, (gint)shapers->len - 1));
- return g_string_free (shapers, FALSE);
+ return g_string_free (shapers, false);
}
static G_GNUC_NORETURN gboolean
@@ -141,10 +141,10 @@
if (!g_option_context_parse (context, argc, argv, &parse_error))
{
if (parse_error != NULL) {
- fail (TRUE, "%s", parse_error->message);
+ fail (true, "%s", parse_error->message);
//g_error_free (parse_error);
} else
- fail (TRUE, "Option parse error");
+ fail (true, "Option parse error");
}
}
@@ -161,12 +161,12 @@
case 1: m.r = m.t;
case 2: m.b = m.t;
case 3: m.l = m.r;
- case 4: return TRUE;
+ case 4: return true;
default:
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
"%s argument should be one to four space-separated numbers",
name);
- return FALSE;
+ return false;
}
}
@@ -180,7 +180,7 @@
shape_options_t *shape_opts = (shape_options_t *) data;
g_free (shape_opts->shapers);
shape_opts->shapers = g_strsplit (arg, ",", 0);
- return TRUE;
+ return true;
}
static G_GNUC_NORETURN gboolean
@@ -213,10 +213,10 @@
parse_space (pp);
if (**pp != c)
- return FALSE;
+ return false;
(*pp)++;
- return TRUE;
+ return true;
}
static hb_bool_t
@@ -228,10 +228,10 @@
v = strtol (p, pp, 0);
if (p == *pp)
- return FALSE;
+ return false;
*pv = v;
- return TRUE;
+ return true;
}
@@ -245,7 +245,7 @@
feature->value = 1;
}
- return TRUE;
+ return true;
}
static hb_bool_t
@@ -261,10 +261,10 @@
#undef ISALNUM
if (p == *pp)
- return FALSE;
+ return false;
feature->tag = hb_tag_from_string (p, *pp - p);
- return TRUE;
+ return true;
}
static hb_bool_t
@@ -278,7 +278,7 @@
feature->end = (unsigned int) -1;
if (!parse_char (pp, '['))
- return TRUE;
+ return true;
has_start = parse_uint (pp, &feature->start);
@@ -335,7 +335,7 @@
shape_opts->features = NULL;
if (!*s)
- return TRUE;
+ return true;
/* count the features first, so we can allocate memory */
p = s;
@@ -358,7 +358,7 @@
skip_one_feature (&p);
}
- return TRUE;
+ return true;
}
@@ -518,7 +518,7 @@
/* This is a hell of a lot of code for just reading a file! */
if (!font_file)
- fail (TRUE, "No font file set");
+ fail (true, "No font file set");
if (0 == strcmp (font_file, "-")) {
/* read it */
@@ -530,18 +530,18 @@
while (!feof (stdin)) {
size_t ret = fread (buf, 1, sizeof (buf), stdin);
if (ferror (stdin))
- fail (FALSE, "Failed reading font from standard input: %s",
+ fail (false, "Failed reading font from standard input: %s",
strerror (errno));
g_string_append_len (gs, buf, ret);
}
len = gs->len;
- font_data = g_string_free (gs, FALSE);
+ font_data = g_string_free (gs, false);
user_data = font_data;
destroy = (hb_destroy_func_t) g_free;
mm = HB_MEMORY_MODE_WRITABLE;
} else {
GError *error = NULL;
- GMappedFile *mf = g_mapped_file_new (font_file, FALSE, &error);
+ GMappedFile *mf = g_mapped_file_new (font_file, false, &error);
if (mf) {
font_data = g_mapped_file_get_contents (mf);
len = g_mapped_file_get_length (mf);
@@ -552,7 +552,7 @@
} else
g_mapped_file_unref (mf);
} else {
- fail (FALSE, "%s", error->message);
+ fail (false, "%s", error->message);
//g_error_free (error);
}
if (!len) {
@@ -567,7 +567,7 @@
user_data = (void *) font_data;
mm = HB_MEMORY_MODE_WRITABLE;
} else {
- fail (FALSE, "%s", error->message);
+ fail (false, "%s", error->message);
//g_error_free (error);
}
}
@@ -626,7 +626,7 @@
if (!fp) {
if (!text_file)
- fail (TRUE, "At least one of text or text-file must be set");
+ fail (true, "At least one of text or text-file must be set");
if (0 != strcmp (text_file, "-"))
fp = fopen (text_file, "r");
@@ -634,7 +634,7 @@
fp = stdin;
if (!fp)
- fail (FALSE, "Failed opening text file `%s': %s",
+ fail (false, "Failed opening text file `%s': %s",
text_file, strerror (errno));
gs = g_string_new (NULL);
@@ -652,7 +652,7 @@
g_string_append_len (gs, buf, bytes);
}
if (ferror (fp))
- fail (FALSE, "Failed reading text: %s",
+ fail (false, "Failed reading text: %s",
strerror (errno));
*len = gs->len;
return !*len && feof (fp) ? NULL : gs->str;
@@ -674,7 +674,7 @@
fp = stdout;
}
if (!fp)
- fail (FALSE, "Cannot open output file `%s': %s",
+ fail (false, "Cannot open output file `%s': %s",
g_filename_display_name (output_file), strerror (errno));
return fp;
@@ -687,8 +687,8 @@
GError **error G_GNUC_UNUSED)
{
format_options_t *format_opts = (format_options_t *) data;
- format_opts->show_text = format_opts->show_unicode = format_opts->show_line_num = TRUE;
- return TRUE;
+ format_opts->show_text = format_opts->show_unicode = format_opts->show_line_num = true;
+ return true;
}
void
diff --git a/util/options.hh b/util/options.hh
index 6e73a1c..9b7baa7 100644
--- a/util/options.hh
+++ b/util/options.hh
@@ -251,7 +251,7 @@
}
~text_options_t (void) {
if (gs)
- g_string_free (gs, TRUE);
+ g_string_free (gs, true);
if (fp)
fclose (fp);
}
diff --git a/util/view-cairo.hh b/util/view-cairo.hh
index 9b000b5..c621984 100644
--- a/util/view-cairo.hh
+++ b/util/view-cairo.hh
@@ -42,7 +42,7 @@
void init (const font_options_t *font_opts)
{
- lines = g_array_new (FALSE, FALSE, sizeof (helper_cairo_line_t));
+ lines = g_array_new (false, false, sizeof (helper_cairo_line_t));
scale = double (view_options.font_size) / hb_face_get_upem (hb_font_get_face (font_opts->get_font ()));
}
void new_line (void)