summaryrefslogtreecommitdiff
path: root/examples/renderdemo.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2005-11-04 23:55:38 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2005-11-04 23:55:38 +0000
commitb6942a337fd03b0f24a49f3b7336b9137828c5f4 (patch)
treead95f548fbe6765cdea8bfcae095e42652697e26 /examples/renderdemo.c
parent933f541030f770b446d95bb0b5b3c85d561a63e5 (diff)
downloadpango-b6942a337fd03b0f24a49f3b7336b9137828c5f4.tar.gz
Turn various gcc warnings off. Adding const, adding static, fully
2005-11-04 Behdad Esfahbod <behdad@gnome.org> * configure.in, examples/argcontext.c examples/cairoview.c, examples/renderdemo.c, examples/renderdemo.h examples/xftview.c, modules/basic/basic-x.c, modules/hangul/hangul-fc.c, modules/hebrew/hebrew-shaper.c, modules/hebrew/hebrew-shaper.h, modules/indic/indic-fc.c, modules/indic/mprefixups.c, modules/syriac/syriac-fc.c, pango/break.c pango/fonts.c, pango/modules.c, pango/pango-coverage.c pango/pango-engine.c, pango/pango-engine.h, pango/pango-fontmap.c, pango/pango-fontset.c, pango/pango-impl-utils.h, pango/pango-layout.c, pango/pango-layout.h, pango/pango-renderer.c, pango/pango-script.c, pango/pango-utils.c, pango/pangocairo-fc.h, pango/pangocairo-font.c, pango/pangocairo-fontmap.c, pango/pangocairo-private.h, pango/pangofc-decoder.c, pango/pangofc-font.c, pango/pangofc-fontmap.c pango/pangoft2.c, pango/pangox-fontcache.c, pango/pangox-fontmap.c pango/pangox.c, pango/pangoxft-font.c, pango/querymodules.c, pango/opentype/ftglue.c, pango/opentype/ftxgpos.c, pango/opentype/ftxopen.c, pango/opentype/pango-ot-buffer.c, pango/opentype/pango-ot-info.c, pango/opentype/pango-ot-ruleset.c, tests/dump-boundaries.c, tests/testboundaries.c, tests/testcolor.c tests/testiter.c, tests/testscript.c: Turn various gcc warnings off. Adding const, adding static, fully initializing structs, match signedness in comparisons. (#317804) * tests/testscript.c, tools/gen-script-for-lang.c: (scripts_for_file): Pass error->message instead of error to fail(), which was wrong. (compare_lang): Fix typo comparing a and a instead of a and b.
Diffstat (limited to 'examples/renderdemo.c')
-rw-r--r--examples/renderdemo.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/examples/renderdemo.c b/examples/renderdemo.c
index a1225121..07ca1615 100644
--- a/examples/renderdemo.c
+++ b/examples/renderdemo.c
@@ -42,7 +42,7 @@ char *prog_name;
gboolean opt_display = FALSE;
int opt_dpi = 96;
-char *opt_font = MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE);
+const char *opt_font = MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE);
gboolean opt_header = FALSE;
char *opt_output = NULL;
int opt_margin = 10;
@@ -74,7 +74,7 @@ fail (const char *format, ...)
exit (1);
}
-PangoFontDescription *
+static PangoFontDescription *
get_font_description (void)
{
PangoFontDescription *font_description = pango_font_description_from_string (opt_font);
@@ -304,6 +304,12 @@ static void
show_help (ArgContext *context,
const char *name,
const char *arg,
+ gpointer data) G_GNUC_NORETURN;
+
+static void
+show_help (ArgContext *context,
+ const char *name,
+ const char *arg,
gpointer data)
{
g_print ("%s - An example viewer for Pango\n"
@@ -379,42 +385,42 @@ parse_options (int argc, char *argv[])
{
static const ArgDesc args[] = {
{ "no-auto-dir","Don't set layout direction according to contents",
- ARG_NOBOOL, &opt_auto_dir },
+ ARG_NOBOOL, &opt_auto_dir, NULL },
{ "display", "Show output using ImageMagick",
- ARG_BOOL, &opt_display },
+ ARG_BOOL, &opt_display, NULL },
{ "dpi", "Set the dpi'",
- ARG_INT, &opt_dpi },
+ ARG_INT, &opt_dpi, NULL },
{ "ellipsize", "Ellipsization mode [=none/start/middle/end]",
ARG_CALLBACK, NULL, parse_ellipsis },
{ "font", "Set the font name",
- ARG_STRING, &opt_font },
+ ARG_STRING, &opt_font, NULL },
{ "header", "Display the options in the output",
- ARG_BOOL, &opt_header },
+ ARG_BOOL, &opt_header, NULL },
{ "help", "Show this output",
- ARG_CALLBACK, NULL, show_help, },
+ ARG_CALLBACK, NULL, show_help },
{ "hinting", "Hinting style [=none/auto/full]",
- ARG_CALLBACK, NULL, parse_hinting, },
+ ARG_CALLBACK, NULL, parse_hinting },
{ "margin", "Set the margin on the output in pixels",
- ARG_INT, &opt_margin },
+ ARG_INT, &opt_margin, NULL },
{ "markup", "Interpret contents as Pango markup",
- ARG_BOOL, &opt_markup },
+ ARG_BOOL, &opt_markup, NULL },
{ "output", "Name of output file",
- ARG_STRING, &opt_output },
+ ARG_STRING, &opt_output, NULL },
{ "rtl", "Set base dir to RTL",
- ARG_BOOL, &opt_rtl },
+ ARG_BOOL, &opt_rtl, NULL },
{ "rotate", "Angle at which to rotate results",
- ARG_INT, &opt_rotate },
+ ARG_INT, &opt_rotate, NULL },
{ "text", "Text to display (instead of a file)",
- ARG_STRING, &opt_text },
+ ARG_STRING, &opt_text, NULL },
{ "waterfall", "Create a waterfall display",
- ARG_BOOL, &opt_waterfall },
+ ARG_BOOL, &opt_waterfall, NULL },
{ "width", "Width in points to which to wrap output",
- ARG_INT, &opt_width },
+ ARG_INT, &opt_width, NULL },
{ "indent", "Width in points to indent paragraphs",
- ARG_INT, &opt_indent },
+ ARG_INT, &opt_indent, NULL },
{ "runs", "Render text this many times",
- ARG_INT, &opt_runs },
- { NULL }
+ ARG_INT, &opt_runs, NULL },
+ { NULL, NULL, 0, NULL, NULL }
};
ArgContext *arg_context;