From 97796453aab56873809a15b5e316cba8acea7449 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 15 Aug 2011 19:03:43 +0200 Subject: [PATCH] Fix falloffs of the GOption conversion --- util/options.cc | 8 ++++---- util/options.hh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/util/options.cc b/util/options.cc index 2bc2c7066..d6232430c 100644 --- a/util/options.cc +++ b/util/options.cc @@ -31,6 +31,8 @@ view_options_t view_opts[1]; shape_options_t shape_opts[1]; font_options_t font_opts[1]; +const char *out_file = "/dev/stdout"; +hb_bool_t debug = FALSE; static gboolean @@ -40,7 +42,7 @@ parse_margin (const char *name G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { view_options_t::margin_t &m = view_opts->margin; - switch (sscanf (arg, "%f %f %f %f", &m.t, &m.r, &m.b, &m.l)) { + switch (sscanf (arg, "%lf %lf %lf %lf", &m.t, &m.r, &m.b, &m.l)) { case 1: m.r = m.t; case 2: m.b = m.t; case 3: m.l = m.r; @@ -268,7 +270,7 @@ parse_options (int argc, char *argv[]) GOptionEntry entries[] = { {"version", 0, G_OPTION_FLAG_NO_ARG, - G_OPTION_ARG_CALLBACK, (gpointer) &show_version, "Show version numbers", NULL}, + G_OPTION_ARG_CALLBACK, (gpointer) &show_version, "Show version numbers", NULL}, {"debug", 0, 0, G_OPTION_ARG_NONE, &debug, "Free all resources before exit", NULL}, {"output", 0, 0, G_OPTION_ARG_STRING, &out_file, "Set output file name", "filename"}, @@ -289,10 +291,8 @@ parse_options (int argc, char *argv[]) {NULL} }; - GError *error = NULL; GError *parse_error = NULL; GOptionContext *context; - size_t len; context = g_option_context_new ("- FONT-FILE TEXT"); diff --git a/util/options.hh b/util/options.hh index 4c6e97306..9be0b6ba7 100644 --- a/util/options.hh +++ b/util/options.hh @@ -76,8 +76,8 @@ extern struct font_options_t } font_opts[1]; -static const char *out_file = "/dev/stdout"; -static hb_bool_t debug = FALSE; +extern const char *out_file; +extern hb_bool_t debug; void parse_options (int argc, char *argv[]);