From a363ce573c3aa706de3aecf0515519a5d7842af2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 1 Aug 2021 22:11:13 -0600 Subject: [PATCH] [util/hb-subset] Minor refactor of batch mode To match recent changes to hb-shape. --- util/hb-subset.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/util/hb-subset.cc b/util/hb-subset.cc index 4ad3f54b9..511173079 100644 --- a/util/hb-subset.cc +++ b/util/hb-subset.cc @@ -127,6 +127,9 @@ struct subset_consumer_t hb_subset_input_t *input; }; +template +using driver_t = main_font_text_t; + int main (int argc, char **argv) { @@ -138,7 +141,7 @@ main (int argc, char **argv) { size_t l = strlen (buf); if (l && buf[l - 1] == '\n') buf[l - 1] = '\0'; - main_font_text_t driver; + char *args[32]; argc = 0; char *p = buf, *e; @@ -151,13 +154,12 @@ main (int argc, char **argv) e++; args[argc++] = p = e; } + + driver_t driver; int result = driver.main (argc, args); - if (result == 0) - fprintf (stdout, "success\n"); - else - fprintf (stdout, "failure\n"); - ret |= result; + fprintf (stdout, result == 0 ? "success\n" : "failure\n"); fflush (stdout); + ret |= result; if (ret) break;