diff options
author | Ebrahim Byagowi <ebrahim@gnu.org> | 2018-12-17 21:31:01 +0330 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2018-12-17 13:01:01 -0500 |
commit | e41200859997ccf8fd7d36fff654f3ceea3a4160 (patch) | |
tree | eb6cfc8124c5c3a7e03491ab13dc8639cef01bde /util | |
parent | 7ace10078c23d00da4af0480f91b877faeed3d38 (diff) |
Remove redundant void from C++ sources (#1486)
Diffstat (limited to 'util')
-rw-r--r-- | util/ansi-print.cc | 6 | ||||
-rw-r--r-- | util/hb-fc.cc | 2 | ||||
-rw-r--r-- | util/hb-shape.cc | 5 | ||||
-rw-r--r-- | util/helper-cairo.cc | 2 | ||||
-rw-r--r-- | util/helper-cairo.hh | 2 | ||||
-rw-r--r-- | util/main-font-text.hh | 2 | ||||
-rw-r--r-- | util/options.cc | 8 | ||||
-rw-r--r-- | util/options.hh | 22 | ||||
-rw-r--r-- | util/view-cairo.hh | 14 |
9 files changed, 27 insertions, 36 deletions
diff --git a/util/ansi-print.cc b/util/ansi-print.cc index 5e2845cf..49a0477f 100644 --- a/util/ansi-print.cc +++ b/util/ansi-print.cc @@ -74,7 +74,7 @@ struct color_t 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 @@ struct image_t 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 @@ struct biimage_t 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 cb899914..2fe01469 100644 --- a/util/hb-fc.cc +++ b/util/hb-fc.cc @@ -72,7 +72,7 @@ hb_fc_get_glyph (hb_font_t *font /*HB_UNUSED*/, } 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 1a671230..3ae3fa1b 100644 --- a/util/hb-shape.cc +++ b/util/hb-shape.cc @@ -83,10 +83,7 @@ struct output_buffer_t 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 7a698f30..b4f94a98 100644 --- a/util/helper-cairo.cc +++ b/util/helper-cairo.cc @@ -66,7 +66,7 @@ static FT_Library ft_library; #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 1613ce42..5bfbf7b3 100644 --- a/util/helper-cairo.hh +++ b/util/helper-cairo.hh @@ -60,7 +60,7 @@ struct helper_cairo_line_t { 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 01bd2d4d..36b654bc 100644 --- a/util/main-font-text.hh +++ b/util/main-font-text.hh @@ -50,7 +50,7 @@ locale_to_utf8 (char *s) 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 4e6e29b7..04ddcf6e 100644 --- a/util/options.cc +++ b/util/options.cc @@ -62,7 +62,7 @@ fail (hb_bool_t suggest_help, const char *format, ...) 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 @@ show_version (const char *name G_GNUC_UNUSED, void -option_parser_t::add_main_options (void) +option_parser_t::add_main_options () { GOptionEntry entries[] = { @@ -638,7 +638,7 @@ output_options_t::add_options (option_parser_t *parser) hb_font_t * -font_options_t::get_font (void) const +font_options_t::get_font () const { if (font) return font; @@ -795,7 +795,7 @@ text_options_t::get_line (unsigned int *len) 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 a4210c27..d7045191 100644 --- a/util/options.hh +++ b/util/options.hh @@ -54,7 +54,7 @@ void fail (hb_bool_t suggest_help, const char *format, ...) G_GNUC_NORETURN G_GN 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 @@ struct option_parser_t 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 @@ struct option_parser_t 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 @@ struct view_options_t : option_group_t add_options (parser); } - virtual ~view_options_t (void) + virtual ~view_options_t () { g_free (fore); g_free (back); @@ -161,7 +161,7 @@ struct shape_options_t : option_group_t add_options (parser); } - virtual ~shape_options_t (void) + virtual ~shape_options_t () { g_free (direction); g_free (language); @@ -467,7 +467,7 @@ struct font_options_t : option_group_t add_options (parser); } - virtual ~font_options_t (void) + virtual ~font_options_t () { g_free (font_file); free (variations); @@ -477,7 +477,7 @@ struct font_options_t : option_group_t 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 @@ struct text_options_t : option_group_t add_options (parser); } - virtual ~text_options_t (void) + virtual ~text_options_t () { g_free (text_before); g_free (text_after); @@ -568,7 +568,7 @@ struct output_options_t : option_group_t add_options (parser); } - virtual ~output_options_t (void) + virtual ~output_options_t () { g_free (output_file); g_free (output_format); @@ -596,7 +596,7 @@ struct output_options_t : option_group_t 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 5be3523a..1f51f0e9 100644 --- a/util/view-cairo.hh +++ b/util/view-cairo.hh @@ -39,7 +39,7 @@ struct view_cairo_t 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 @@ struct view_cairo_t 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, |