Remove redundant void from C++ sources (#1486)
diff --git a/util/ansi-print.cc b/util/ansi-print.cc index 5e2845c..49a0477 100644 --- a/util/ansi-print.cc +++ b/util/ansi-print.cc
@@ -74,7 +74,7 @@ color_t c = {(0xFFu<<24) | ((0xFFu*(x&1))<<16) | ((0xFFu*((x >> 1)&1))<<8) | (0xFFu*((x >> 2)&1))}; return c; } - unsigned int to_ansi (void) + unsigned int to_ansi () { return ((v >> 23) & 1) | ((v >> 14)&2) | ((v >> 5)&4); } @@ -110,7 +110,7 @@ own_data (true), data ((color_t *) malloc (sizeof (data[0]) * width * height)), stride (width) {} - ~image_t (void) + ~image_t () { if (own_data) free (data); } color_t &operator () (unsigned int x, unsigned int y) @@ -161,7 +161,7 @@ height (height), bg (0), fg (0), unicolor (true), data ((uint8_t *) malloc (sizeof (data[0]) * width * height)) {} - ~biimage_t (void) + ~biimage_t () { free (data); } void set (const image_t &image)
diff --git a/util/hb-fc.cc b/util/hb-fc.cc index cb89991..2fe0146 100644 --- a/util/hb-fc.cc +++ b/util/hb-fc.cc
@@ -72,7 +72,7 @@ } static hb_font_funcs_t * -_hb_fc_get_font_funcs (void) +_hb_fc_get_font_funcs () { static const hb_font_funcs_t *fc_ffuncs;
diff --git a/util/hb-shape.cc b/util/hb-shape.cc index 1a67123..3ae3fa1 100644 --- a/util/hb-shape.cc +++ b/util/hb-shape.cc
@@ -83,10 +83,7 @@ if (format.trace) hb_buffer_set_message_func (buffer, message_func, this, nullptr); } - void new_line (void) - { - line_no++; - } + void new_line () { line_no++; } void consume_text (hb_buffer_t *buffer, const char *text, unsigned int text_len,
diff --git a/util/helper-cairo.cc b/util/helper-cairo.cc index 7a698f3..b4f94a9 100644 --- a/util/helper-cairo.cc +++ b/util/helper-cairo.cc
@@ -66,7 +66,7 @@ #ifdef HAVE_ATEXIT static inline -void free_ft_library (void) +void free_ft_library () { FT_Done_FreeType (ft_library); }
diff --git a/util/helper-cairo.hh b/util/helper-cairo.hh index 1613ce4..5bfbf7b 100644 --- a/util/helper-cairo.hh +++ b/util/helper-cairo.hh
@@ -60,7 +60,7 @@ unsigned int num_clusters; cairo_text_cluster_flags_t cluster_flags; - void finish (void) { + void finish () { if (glyphs) cairo_glyph_free (glyphs); if (clusters)
diff --git a/util/main-font-text.hh b/util/main-font-text.hh index 01bd2d4..36b654b 100644 --- a/util/main-font-text.hh +++ b/util/main-font-text.hh
@@ -50,7 +50,7 @@ template <typename consumer_t, int default_font_size, int subpixel_bits> struct main_font_text_t { - main_font_text_t (void) + main_font_text_t () : options ("[FONT-FILE] [TEXT]"), font_opts (&options, default_font_size, subpixel_bits), input (&options),
diff --git a/util/options.cc b/util/options.cc index 4e6e29b..04ddcf6 100644 --- a/util/options.cc +++ b/util/options.cc
@@ -62,7 +62,7 @@ static gchar * -shapers_to_string (void) +shapers_to_string () { GString *shapers = g_string_new (nullptr); const char **shaper_list = hb_shape_list_shapers (); @@ -95,7 +95,7 @@ void -option_parser_t::add_main_options (void) +option_parser_t::add_main_options () { GOptionEntry entries[] = { @@ -638,7 +638,7 @@ hb_font_t * -font_options_t::get_font (void) const +font_options_t::get_font () const { if (font) return font; @@ -795,7 +795,7 @@ FILE * -output_options_t::get_file_handle (void) +output_options_t::get_file_handle () { if (fp) return fp;
diff --git a/util/options.hh b/util/options.hh index a4210c2..d704519 100644 --- a/util/options.hh +++ b/util/options.hh
@@ -54,7 +54,7 @@ struct option_group_t { - virtual ~option_group_t (void) {} + virtual ~option_group_t () {} virtual void add_options (struct option_parser_t *parser) = 0; @@ -74,14 +74,14 @@ add_main_options (); } - ~option_parser_t (void) + ~option_parser_t () { g_option_context_free (context); g_ptr_array_foreach (to_free, (GFunc) g_free, nullptr); g_ptr_array_free (to_free, TRUE); } - void add_main_options (void); + void add_main_options (); void add_group (GOptionEntry *entries, const gchar *name, @@ -95,7 +95,7 @@ void parse (int *argc, char ***argv); - G_GNUC_NORETURN void usage (void) { + G_GNUC_NORETURN void usage () { g_printerr ("Usage: %s [OPTION...] %s\n", g_get_prgname (), usage_str); exit (1); } @@ -125,7 +125,7 @@ add_options (parser); } - virtual ~view_options_t (void) + virtual ~view_options_t () { g_free (fore); g_free (back); @@ -161,7 +161,7 @@ add_options (parser); } - virtual ~shape_options_t (void) + virtual ~shape_options_t () { g_free (direction); g_free (language); @@ -467,7 +467,7 @@ add_options (parser); } - virtual ~font_options_t (void) + virtual ~font_options_t () { g_free (font_file); free (variations); @@ -477,7 +477,7 @@ void add_options (option_parser_t *parser); - hb_font_t *get_font (void) const; + hb_font_t *get_font () const; char *font_file; mutable hb_blob_t *blob; @@ -517,7 +517,7 @@ add_options (parser); } - virtual ~text_options_t (void) + virtual ~text_options_t () { g_free (text_before); g_free (text_after); @@ -568,7 +568,7 @@ add_options (parser); } - virtual ~output_options_t (void) + virtual ~output_options_t () { g_free (output_file); g_free (output_format); @@ -596,7 +596,7 @@ output_file = nullptr; /* STDOUT */ } - FILE *get_file_handle (void); + FILE *get_file_handle (); char *output_file; char *output_format;
diff --git a/util/view-cairo.hh b/util/view-cairo.hh index 5be3523..1f51f0e 100644 --- a/util/view-cairo.hh +++ b/util/view-cairo.hh
@@ -39,7 +39,7 @@ view_options (parser), direction (HB_DIRECTION_INVALID), lines (0), scale_bits (0) {} - ~view_cairo_t (void) { + ~view_cairo_t () { cairo_debug_reset_static_data (); } @@ -48,19 +48,13 @@ lines = g_array_new (false, false, sizeof (helper_cairo_line_t)); scale_bits = - (int) font_opts->subpixel_bits; } - void new_line (void) - { - } + void new_line () {} void consume_text (hb_buffer_t *buffer, const char *text, unsigned int text_len, - hb_bool_t utf8_clusters) - { - } + hb_bool_t utf8_clusters) {} void error (const char *message) - { - g_printerr ("%s: %s\n", g_get_prgname (), message); - } + { g_printerr ("%s: %s\n", g_get_prgname (), message); } void consume_glyphs (hb_buffer_t *buffer, const char *text, unsigned int text_len,