From dbf6f4db24aee7315b2782a87e127367887e2036 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Thu, 16 Jan 2025 14:21:05 +1300 Subject: Changed reinterpret_cast to static_cast where applicable --- src/c_fl_text_display.cpp | 126 +++++++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 63 deletions(-) (limited to 'src/c_fl_text_display.cpp') diff --git a/src/c_fl_text_display.cpp b/src/c_fl_text_display.cpp index 7323049..654d6ce 100644 --- a/src/c_fl_text_display.cpp +++ b/src/c_fl_text_display.cpp @@ -52,7 +52,7 @@ TEXTDISPLAY new_fl_text_display(int x, int y, int w, int h, char* label) { } void free_fl_text_display(TEXTDISPLAY td) { - delete reinterpret_cast(td); + delete static_cast(td); } @@ -61,29 +61,29 @@ void free_fl_text_display(TEXTDISPLAY td) { // this actually never gets called, since an access to the text_buffer // object is stored on the Ada side of things TEXTBUFFER fl_text_display_get_buffer(TEXTDISPLAY td) { - return reinterpret_cast(td)->buffer(); + return static_cast(td)->buffer(); } void fl_text_display_set_buffer(TEXTDISPLAY td, TEXTBUFFER tb) { - reinterpret_cast(td)->buffer(reinterpret_cast(tb)); + static_cast(td)->buffer(static_cast(tb)); } void fl_text_display_highlight_data(TEXTDISPLAY td, TEXTBUFFER tb, void * st, int len) { - reinterpret_cast(td)->highlight_data - (reinterpret_cast(tb), - reinterpret_cast(st), + static_cast(td)->highlight_data + (static_cast(tb), + static_cast(st), len, 0, 0, 0); } void fl_text_display_highlight_data2(TEXTDISPLAY td, TEXTBUFFER tb, void * st, int len, char us, void * cb, void * a) { - reinterpret_cast(td)->highlight_data - (reinterpret_cast(tb), - reinterpret_cast(st), + static_cast(td)->highlight_data + (static_cast(tb), + static_cast(st), len, us, reinterpret_cast(cb), a); } @@ -91,249 +91,249 @@ void fl_text_display_highlight_data2(TEXTDISPLAY td, TEXTBUFFER tb, void * st, i double fl_text_display_col_to_x(TEXTDISPLAY td, double c) { - return reinterpret_cast(td)->col_to_x(c); + return static_cast(td)->col_to_x(c); } double fl_text_display_x_to_col(TEXTDISPLAY td, double x) { - return reinterpret_cast(td)->x_to_col(x); + return static_cast(td)->x_to_col(x); } int fl_text_display_in_selection(TEXTDISPLAY td, int x, int y) { - return reinterpret_cast(td)->in_selection(x, y); + return static_cast(td)->in_selection(x, y); } int fl_text_display_position_to_xy(TEXTDISPLAY td, int p, int * x, int * y) { - return reinterpret_cast(td)->position_to_xy(p, x, y); + return static_cast(td)->position_to_xy(p, x, y); } unsigned int fl_text_display_get_cursor_color(TEXTDISPLAY td) { - return reinterpret_cast(td)->cursor_color(); + return static_cast(td)->cursor_color(); } void fl_text_display_set_cursor_color(TEXTDISPLAY td, unsigned int c) { - reinterpret_cast(td)->cursor_color(c); + static_cast(td)->cursor_color(c); } void fl_text_display_set_cursor_style(TEXTDISPLAY td, int s) { - reinterpret_cast(td)->cursor_style(s); + static_cast(td)->cursor_style(s); } void fl_text_display_hide_cursor(TEXTDISPLAY td) { - reinterpret_cast(td)->hide_cursor(); + static_cast(td)->hide_cursor(); } void fl_text_display_show_cursor(TEXTDISPLAY td) { - reinterpret_cast(td)->show_cursor(); + static_cast(td)->show_cursor(); } unsigned int fl_text_display_get_text_color(TEXTDISPLAY td) { - return reinterpret_cast(td)->textcolor(); + return static_cast(td)->textcolor(); } void fl_text_display_set_text_color(TEXTDISPLAY td, unsigned int c) { - reinterpret_cast(td)->textcolor(static_cast(c)); + static_cast(td)->textcolor(static_cast(c)); } int fl_text_display_get_text_font(TEXTDISPLAY td) { - return reinterpret_cast(td)->textfont(); + return static_cast(td)->textfont(); } void fl_text_display_set_text_font(TEXTDISPLAY td, int f) { - reinterpret_cast(td)->textfont(static_cast(f)); + static_cast(td)->textfont(static_cast(f)); } int fl_text_display_get_text_size(TEXTDISPLAY td) { - return reinterpret_cast(td)->textsize(); + return static_cast(td)->textsize(); } void fl_text_display_set_text_size(TEXTDISPLAY td, int s) { - reinterpret_cast(td)->textsize(static_cast(s)); + static_cast(td)->textsize(static_cast(s)); } void fl_text_display_insert(TEXTDISPLAY td, char * i) { - reinterpret_cast(td)->insert(i); + static_cast(td)->insert(i); } void fl_text_display_overstrike(TEXTDISPLAY td, char * t) { - reinterpret_cast(td)->overstrike(t); + static_cast(td)->overstrike(t); } int fl_text_display_get_insert_pos(TEXTDISPLAY td) { - return reinterpret_cast(td)->insert_position(); + return static_cast(td)->insert_position(); } void fl_text_display_set_insert_pos(TEXTDISPLAY td, int p) { - reinterpret_cast(td)->insert_position(p); + static_cast(td)->insert_position(p); } void fl_text_display_show_insert_pos(TEXTDISPLAY td) { - reinterpret_cast(td)->show_insert_position(); + static_cast(td)->show_insert_position(); } int fl_text_display_word_start(TEXTDISPLAY td, int p) { - return reinterpret_cast(td)->word_start(p); + return static_cast(td)->word_start(p); } int fl_text_display_word_end(TEXTDISPLAY td, int p) { - return reinterpret_cast(td)->word_end(p); + return static_cast(td)->word_end(p); } void fl_text_display_next_word(TEXTDISPLAY td) { - reinterpret_cast(td)->next_word(); + static_cast(td)->next_word(); } void fl_text_display_previous_word(TEXTDISPLAY td) { - reinterpret_cast(td)->previous_word(); + static_cast(td)->previous_word(); } void fl_text_display_wrap_mode(TEXTDISPLAY td, int w, int m) { - reinterpret_cast(td)->wrap_mode(w, m); + static_cast(td)->wrap_mode(w, m); } int fl_text_display_line_start(TEXTDISPLAY td, int s) { - return reinterpret_cast(td)->line_start(s); + return static_cast(td)->line_start(s); } int fl_text_display_line_end(TEXTDISPLAY td, int s, int p) { - return reinterpret_cast(td)->line_end(s, p); + return static_cast(td)->line_end(s, p); } int fl_text_display_count_lines(TEXTDISPLAY td, int s, int f, int p) { - return reinterpret_cast(td)->count_lines(s, f, p); + return static_cast(td)->count_lines(s, f, p); } int fl_text_display_skip_lines(TEXTDISPLAY td, int s, int l, int p) { - return reinterpret_cast(td)->skip_lines(s, l, p); + return static_cast(td)->skip_lines(s, l, p); } int fl_text_display_rewind_lines(TEXTDISPLAY td, int s, int l) { - return reinterpret_cast(td)->rewind_lines(s, l); + return static_cast(td)->rewind_lines(s, l); } unsigned int fl_text_display_get_linenumber_align(TEXTDISPLAY td) { - return reinterpret_cast(td)->linenumber_align(); + return static_cast(td)->linenumber_align(); } void fl_text_display_set_linenumber_align(TEXTDISPLAY td, unsigned int a) { - reinterpret_cast(td)->linenumber_align(a); + static_cast(td)->linenumber_align(a); } unsigned int fl_text_display_get_linenumber_bgcolor(TEXTDISPLAY td) { - return reinterpret_cast(td)->linenumber_bgcolor(); + return static_cast(td)->linenumber_bgcolor(); } void fl_text_display_set_linenumber_bgcolor(TEXTDISPLAY td, unsigned int c) { - reinterpret_cast(td)->linenumber_bgcolor(c); + static_cast(td)->linenumber_bgcolor(c); } unsigned int fl_text_display_get_linenumber_fgcolor(TEXTDISPLAY td) { - return reinterpret_cast(td)->linenumber_fgcolor(); + return static_cast(td)->linenumber_fgcolor(); } void fl_text_display_set_linenumber_fgcolor(TEXTDISPLAY td, unsigned int c) { - reinterpret_cast(td)->linenumber_fgcolor(c); + static_cast(td)->linenumber_fgcolor(c); } int fl_text_display_get_linenumber_font(TEXTDISPLAY td) { - return reinterpret_cast(td)->linenumber_font(); + return static_cast(td)->linenumber_font(); } void fl_text_display_set_linenumber_font(TEXTDISPLAY td, int f) { - reinterpret_cast(td)->linenumber_font(f); + static_cast(td)->linenumber_font(f); } int fl_text_display_get_linenumber_size(TEXTDISPLAY td) { - return reinterpret_cast(td)->linenumber_size(); + return static_cast(td)->linenumber_size(); } void fl_text_display_set_linenumber_size(TEXTDISPLAY td, int s) { - reinterpret_cast(td)->linenumber_size(s); + static_cast(td)->linenumber_size(s); } int fl_text_display_get_linenumber_width(TEXTDISPLAY td) { - return reinterpret_cast(td)->linenumber_width(); + return static_cast(td)->linenumber_width(); } void fl_text_display_set_linenumber_width(TEXTDISPLAY td, int w) { - reinterpret_cast(td)->linenumber_width(w); + static_cast(td)->linenumber_width(w); } int fl_text_display_move_down(TEXTDISPLAY td) { - return reinterpret_cast(td)->move_down(); + return static_cast(td)->move_down(); } int fl_text_display_move_left(TEXTDISPLAY td) { - return reinterpret_cast(td)->move_left(); + return static_cast(td)->move_left(); } int fl_text_display_move_right(TEXTDISPLAY td) { - return reinterpret_cast(td)->move_right(); + return static_cast(td)->move_right(); } int fl_text_display_move_up(TEXTDISPLAY td) { - return reinterpret_cast(td)->move_up(); + return static_cast(td)->move_up(); } void fl_text_display_scroll(TEXTDISPLAY td, int l) { - reinterpret_cast(td)->scroll(l, 1); + static_cast(td)->scroll(l, 1); } unsigned int fl_text_display_get_scrollbar_align(TEXTDISPLAY td) { - return reinterpret_cast(td)->scrollbar_align(); + return static_cast(td)->scrollbar_align(); } void fl_text_display_set_scrollbar_align(TEXTDISPLAY td, unsigned int a) { - reinterpret_cast(td)->scrollbar_align(a); + static_cast(td)->scrollbar_align(a); } int fl_text_display_get_scrollbar_width(TEXTDISPLAY td) { - return reinterpret_cast(td)->scrollbar_width(); + return static_cast(td)->scrollbar_width(); } void fl_text_display_set_scrollbar_width(TEXTDISPLAY td, int w) { - reinterpret_cast(td)->scrollbar_width(w); + static_cast(td)->scrollbar_width(w); } void fl_text_display_redisplay_range(TEXTDISPLAY td, int s, int f) { - reinterpret_cast(td)->redisplay_range(s,f); + static_cast(td)->redisplay_range(s,f); } void fl_text_display_draw(TEXTDISPLAY td) { - reinterpret_cast(td)->Fl_Text_Display::draw(); + static_cast(td)->Fl_Text_Display::draw(); } int fl_text_display_handle(TEXTDISPLAY td, int e) { - return reinterpret_cast(td)->Fl_Text_Display::handle(e); + return static_cast(td)->Fl_Text_Display::handle(e); } -- cgit