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_preferences.cpp | 76 ++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'src/c_fl_preferences.cpp') diff --git a/src/c_fl_preferences.cpp b/src/c_fl_preferences.cpp index 6f2e1ad..d2b0d2c 100644 --- a/src/c_fl_preferences.cpp +++ b/src/c_fl_preferences.cpp @@ -47,20 +47,20 @@ PREFS new_fl_pref_database_scope(int s, char * v, char * a) { } void upref_fl_pref_database(PREFS e) { - reinterpret_cast(e)->reference_count += 1; + static_cast(e)->reference_count += 1; } void free_fl_pref_database(PREFS e) { - if (reinterpret_cast(e)->reference_count <= 0) { - delete reinterpret_cast(e); + if (static_cast(e)->reference_count <= 0) { + delete static_cast(e); } else { - reinterpret_cast(e)->reference_count -= 1; + static_cast(e)->reference_count -= 1; } } PREFS new_fl_pref_group_copy(PREFS e) { - Fl_Preferences *g = new Fl_Preferences(reinterpret_cast(e)); + Fl_Preferences *g = new Fl_Preferences(static_cast(e)); return g; } @@ -70,129 +70,129 @@ PREFS new_fl_pref_group_memory(char * n) { } PREFS new_fl_pref_group_name(PREFS e, char * n) { - Fl_Preferences *g = new Fl_Preferences(reinterpret_cast(e), n); + Fl_Preferences *g = new Fl_Preferences(static_cast(e), n); return g; } PREFS new_fl_pref_group_index(PREFS e, int i) { - Fl_Preferences *g = new Fl_Preferences(reinterpret_cast(e), i); + Fl_Preferences *g = new Fl_Preferences(static_cast(e), i); return g; } void free_fl_pref_group(PREFS e) { - delete reinterpret_cast(e); + delete static_cast(e); } void fl_preferences_flush(PREFS e) { - reinterpret_cast(e)->flush(); + static_cast(e)->flush(); } int fl_preferences_getuserdatapath(PREFS e, char * p, int len) { - return (int)reinterpret_cast(e)->getUserdataPath(p, len); + return (int)static_cast(e)->getUserdataPath(p, len); } int fl_preferences_deleteentry(PREFS e, const char * k) { - return (int)reinterpret_cast(e)->deleteEntry(k); + return (int)static_cast(e)->deleteEntry(k); } int fl_preferences_deleteallentries(PREFS e) { - return (int)reinterpret_cast(e)->deleteAllEntries(); + return (int)static_cast(e)->deleteAllEntries(); } int fl_preferences_deletegroup(PREFS e, const char * g) { - return (int)reinterpret_cast(e)->deleteGroup(g); + return (int)static_cast(e)->deleteGroup(g); } int fl_preferences_deleteallgroups(PREFS e) { - return (int)reinterpret_cast(e)->deleteAllGroups(); + return (int)static_cast(e)->deleteAllGroups(); } int fl_preferences_clear(PREFS e) { - return (int)reinterpret_cast(e)->clear(); + return (int)static_cast(e)->clear(); } int fl_preferences_entries(PREFS e) { - return reinterpret_cast(e)->entries(); + return static_cast(e)->entries(); } const char * fl_preferences_entry(PREFS e, int i) { - return reinterpret_cast(e)->entry(i); + return static_cast(e)->entry(i); } int fl_preferences_entryexists(PREFS e, const char * k) { - return (int)reinterpret_cast(e)->entryExists(k); + return (int)static_cast(e)->entryExists(k); } int fl_preferences_size(PREFS e, const char * k) { - return reinterpret_cast(e)->size(k); + return static_cast(e)->size(k); } int fl_preferences_groups(PREFS e) { - return reinterpret_cast(e)->groups(); + return static_cast(e)->groups(); } const char * fl_preferences_group(PREFS e, int i) { - return reinterpret_cast(e)->group(i); + return static_cast(e)->group(i); } int fl_preferences_groupexists(PREFS e, const char * g) { - return (int)reinterpret_cast(e)->groupExists(g); + return (int)static_cast(e)->groupExists(g); } const char * fl_preferences_name(PREFS e) { - return reinterpret_cast(e)->name(); + return static_cast(e)->name(); } const char * fl_preferences_path(PREFS e) { - return reinterpret_cast(e)->path(); + return static_cast(e)->path(); } int fl_preferences_get_int(PREFS e, const char * k, int& v, int d) { - return (int)reinterpret_cast(e)->get(k,v,d); + return (int)static_cast(e)->get(k,v,d); } int fl_preferences_get_float(PREFS e, const char * k, float& v, float d) { - return (int)reinterpret_cast(e)->get(k,v,d); + return (int)static_cast(e)->get(k,v,d); } int fl_preferences_get_double(PREFS e, const char * k, double& v, double d) { - return (int)reinterpret_cast(e)->get(k,v,d); + return (int)static_cast(e)->get(k,v,d); } // must deallocate result afterwards int fl_preferences_get_str(PREFS e, const char * k, char *& v, const char * d) { - return (int)reinterpret_cast(e)->get(k,v,d); + return (int)static_cast(e)->get(k,v,d); } int fl_preferences_get_str_limit (PREFS e, const char * k, char * v, const char * d, int m) { - return (int)reinterpret_cast(e)->get(k, v, d, m); + return (int)static_cast(e)->get(k, v, d, m); } // must deallocate result afterwards int fl_preferences_get_void (PREFS e, const char * k, void *& v, const void * d, int ds) { - return (int)reinterpret_cast(e)->get(k, v, d, ds); + return (int)static_cast(e)->get(k, v, d, ds); } int fl_preferences_get_void_limit (PREFS e, const char * k, void * v, const void * d, int ds, int ms) { - return (int)reinterpret_cast(e)->get(k, v, d, ds, ms); + return (int)static_cast(e)->get(k, v, d, ds, ms); } void free_fl_preferences_void_data(void * v) { @@ -203,31 +203,31 @@ void free_fl_preferences_void_data(void * v) { int fl_preferences_set_int(PREFS e, const char * k, int v) { - return (int)reinterpret_cast(e)->set(k,v); + return (int)static_cast(e)->set(k,v); } int fl_preferences_set_float(PREFS e, const char * k, float v) { - return (int)reinterpret_cast(e)->set(k,v); + return (int)static_cast(e)->set(k,v); } int fl_preferences_set_float_prec(PREFS e, const char * k, float v, int p) { - return (int)reinterpret_cast(e)->set(k,v,p); + return (int)static_cast(e)->set(k,v,p); } int fl_preferences_set_double(PREFS e, const char * k, double v) { - return (int)reinterpret_cast(e)->set(k,v); + return (int)static_cast(e)->set(k,v); } int fl_preferences_set_double_prec(PREFS e, const char * k, double v, int p) { - return (int)reinterpret_cast(e)->set(k,v,p); + return (int)static_cast(e)->set(k,v,p); } int fl_preferences_set_str(PREFS e, const char * k, const char * v) { - return (int)reinterpret_cast(e)->set(k,v); + return (int)static_cast(e)->set(k,v); } int fl_preferences_set_void(PREFS e, const char * k, const void * d, int ds) { - return (int)reinterpret_cast(e)->set(k, d, ds); + return (int)static_cast(e)->set(k, d, ds); } -- cgit