Fix falloffs of the GOption conversion

This commit is contained in:
Behdad Esfahbod 2011-08-15 19:03:43 +02:00
parent 4e9ff1dd6e
commit 97796453aa
2 changed files with 6 additions and 6 deletions

View File

@ -31,6 +31,8 @@ view_options_t view_opts[1];
shape_options_t shape_opts[1]; shape_options_t shape_opts[1];
font_options_t font_opts[1]; font_options_t font_opts[1];
const char *out_file = "/dev/stdout";
hb_bool_t debug = FALSE;
static gboolean static gboolean
@ -40,7 +42,7 @@ parse_margin (const char *name G_GNUC_UNUSED,
GError **error G_GNUC_UNUSED) GError **error G_GNUC_UNUSED)
{ {
view_options_t::margin_t &m = view_opts->margin; 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 1: m.r = m.t;
case 2: m.b = m.t; case 2: m.b = m.t;
case 3: m.l = m.r; case 3: m.l = m.r;
@ -289,10 +291,8 @@ parse_options (int argc, char *argv[])
{NULL} {NULL}
}; };
GError *error = NULL;
GError *parse_error = NULL; GError *parse_error = NULL;
GOptionContext *context; GOptionContext *context;
size_t len;
context = g_option_context_new ("- FONT-FILE TEXT"); context = g_option_context_new ("- FONT-FILE TEXT");

View File

@ -76,8 +76,8 @@ extern struct font_options_t
} font_opts[1]; } font_opts[1];
static const char *out_file = "/dev/stdout"; extern const char *out_file;
static hb_bool_t debug = FALSE; extern hb_bool_t debug;
void parse_options (int argc, char *argv[]); void parse_options (int argc, char *argv[]);