From 6acda521ccaa448eeb26f81a2432da586bed9b30 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 7 Mar 2025 01:15:57 +0100 Subject: Removes the remaining references to Fl_String. Still to do: rename fl_filename... to fl_filename..._str and introduce into core library. --- fluid/Fd_Snap_Action.h | 2 +- fluid/autodoc.h | 4 ++-- fluid/code.cxx | 2 +- fluid/code.h | 2 +- fluid/fluid.h | 3 ++- fluid/fluid_filename.cxx | 7 +++---- fluid/fluid_filename.h | 2 +- fluid/mergeback.h | 3 +-- fluid/shell_command.cxx | 2 +- fluid/shell_command.h | 2 +- 10 files changed, 14 insertions(+), 15 deletions(-) (limited to 'fluid') diff --git a/fluid/Fd_Snap_Action.h b/fluid/Fd_Snap_Action.h index bfb32624c..a7485c770 100644 --- a/fluid/Fd_Snap_Action.h +++ b/fluid/Fd_Snap_Action.h @@ -20,7 +20,7 @@ #include "fluid.h" #include "Fl_Window_Type.h" -#include "../src/Fl_String.H" +#include struct Fl_Menu_Item; diff --git a/fluid/autodoc.h b/fluid/autodoc.h index 1d6ec621b..51f9739ea 100644 --- a/fluid/autodoc.h +++ b/fluid/autodoc.h @@ -22,12 +22,12 @@ #ifndef fl_screenshot_H #define fl_screenshot_H -#include "../src/Fl_String.H" - #include #include #include +#include + /** Class to initialize a Rect by providing the margin around a rect. */ class Fl_Margin : public Fl_Rect { public: diff --git a/fluid/code.cxx b/fluid/code.cxx index 0e715441a..3c789abd3 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -798,7 +798,7 @@ int Fd_Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { // Remember the last code file location for MergeBack if (s && g_project.write_mergeback_data && !to_codeview) { std::string proj_filename = g_project.projectfile_path() + g_project.projectfile_name(); - int i, n = proj_filename.size(); + int i, n = (int)proj_filename.size(); for (i=0; i -#include "../src/Fl_String.H" #include #include +#include class Fl_Type; struct Fd_Identifier_Tree; diff --git a/fluid/fluid.h b/fluid/fluid.h index e8730efb2..140231936 100644 --- a/fluid/fluid.h +++ b/fluid/fluid.h @@ -20,7 +20,8 @@ #include "fluid_filename.h" #include #include -#include "../src/Fl_String.H" + +#include #define BROWSERWIDTH 300 #define BROWSERHEIGHT 500 diff --git a/fluid/fluid_filename.cxx b/fluid/fluid_filename.cxx index 45cb7469c..9bb3b1f73 100644 --- a/fluid/fluid_filename.cxx +++ b/fluid/fluid_filename.cxx @@ -30,12 +30,11 @@ */ #include +#include #include #include #include - -#include "../src/Fl_String.H" // NOTE: FLTK 1.4.x only ! #include "../src/flstring.h" @@ -187,7 +186,7 @@ std::string fl_filename_shortened(const std::string &filename, int max_chars) { static int home_chars = -1; if (home_chars==-1) { home = fl_filename_expand(tilde); - home_chars = fl_utf_nb_char((const uchar*)home.c_str(), home.size()); + home_chars = fl_utf_nb_char((const uchar*)home.c_str(), (int)home.size()); } std::string homed_filename; #if defined(_WIN32) || defined(__APPLE__) @@ -203,7 +202,7 @@ std::string fl_filename_shortened(const std::string &filename, int max_chars) { // C style pointer will stay valid until filename is modified. const unsigned char *u8str = reinterpret_cast(homed_filename.c_str()); // Count the number of UTF-8 characters in the name. - int num_chars = fl_utf_nb_char(u8str, homed_filename.size()); + int num_chars = fl_utf_nb_char(u8str, (int)homed_filename.size()); if (num_chars+ell_bytes-1 > max_chars) { // Create a new string by replacing characters in the middle. int remove_chars = num_chars - max_chars + ell_bytes; diff --git a/fluid/fluid_filename.h b/fluid/fluid_filename.h index 7bcea51fb..5fa23c82e 100644 --- a/fluid/fluid_filename.h +++ b/fluid/fluid_filename.h @@ -39,7 +39,7 @@ # if defined(__cplusplus) -#include "../src/Fl_String.H" +#include std::string fl_filename_shortened(const std::string &filename, int maxchars); std::string fl_filename_name(const std::string &filename); diff --git a/fluid/mergeback.h b/fluid/mergeback.h index 658e94928..f828e9669 100644 --- a/fluid/mergeback.h +++ b/fluid/mergeback.h @@ -22,9 +22,8 @@ #include -#include "../src/Fl_String.H" - #include +#include const int FD_TAG_GENERIC = 0; const int FD_TAG_CODE = 1; diff --git a/fluid/shell_command.cxx b/fluid/shell_command.cxx index a6c49c823..e961fc24c 100644 --- a/fluid/shell_command.cxx +++ b/fluid/shell_command.cxx @@ -364,7 +364,7 @@ void shell_pipe_cb(FL_SOCKET, void*) { static void expand_macro(std::string &cmd, const std::string ¯o, const std::string &content) { for (int i=0;;) { - i = cmd.find(macro, i); + i = (int)cmd.find(macro, i); if (i==(int)std::string::npos) break; cmd.replace(i, macro.size(), content); } diff --git a/fluid/shell_command.h b/fluid/shell_command.h index f167d3c33..e5f8e3e87 100644 --- a/fluid/shell_command.h +++ b/fluid/shell_command.h @@ -19,11 +19,11 @@ #include "fluid.h" -#include "../src/Fl_String.H" #include #include #include +#include #if defined(_WIN32) && !defined(__CYGWIN__) # include # include -- cgit v1.2.3