diff options
| author | erco77 <erco@seriss.com> | 2020-08-01 14:35:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-01 14:35:44 -0700 |
| commit | 7abc09ad89b4c3d0c17ee8dc9d02ccd261cd13f2 (patch) | |
| tree | 72e461bac5930f8a319d48a6ea99ba793dd35a8b /test | |
| parent | 7514a73ba759f7fc9965eeef3b92ece899bd7a69 (diff) | |
| parent | e9688822ec68f066f425953278a853e049b93dfb (diff) | |
Merge pull request #116 from erco77/fl_strdup
fl_strdup() implemented + deployed
Diffstat (limited to 'test')
| -rw-r--r-- | test/menubar.cxx | 3 | ||||
| -rw-r--r-- | test/unittests.cxx | 3 | ||||
| -rw-r--r-- | test/utf8.cxx | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/test/menubar.cxx b/test/menubar.cxx index 856aa72a1..43e4961ce 100644 --- a/test/menubar.cxx +++ b/test/menubar.cxx @@ -30,6 +30,7 @@ #include <FL/fl_draw.H> #include <FL/Fl_Simple_Terminal.H> #include <FL/fl_ask.H> +#include <FL/fl_string.h> #define TERMINAL_HEIGHT 120 @@ -225,7 +226,7 @@ int main(int argc, char **argv) { for (int i=0; i<99; i++) { char buf[100]; sprintf(buf,"item %d",i); - hugemenu[i].text = strdup(buf); + hugemenu[i].text = fl_strdup(buf); } Fl_Double_Window window(WIDTH,400+TERMINAL_HEIGHT); G_tty = new Fl_Simple_Terminal(0,400,WIDTH,TERMINAL_HEIGHT); diff --git a/test/unittests.cxx b/test/unittests.cxx index 12b65fe2a..ca04aac62 100644 --- a/test/unittests.cxx +++ b/test/unittests.cxx @@ -28,6 +28,7 @@ #include <FL/Fl_Group.H> #include <FL/Fl_Box.H> #include <FL/fl_draw.H> // fl_text_extents() +#include <FL/fl_string.h> // fl_strdup() // WINDOW/WIDGET SIZES #define MAINWIN_W 700 // main window w() @@ -53,7 +54,7 @@ public: UnitTest(const char *label, Fl_Widget* (*create)()) : fWidget(0L) { - fLabel = strdup(label); + fLabel = fl_strdup(label); fCreate = create; add(this); } diff --git a/test/utf8.cxx b/test/utf8.cxx index ed1dd1063..9151264f8 100644 --- a/test/utf8.cxx +++ b/test/utf8.cxx @@ -28,6 +28,7 @@ #include <FL/Fl_Output.H> #include <FL/fl_draw.H> #include <FL/fl_utf8.h> +#include <FL/fl_string.h> #include <stdio.h> #include <stdlib.h> @@ -620,10 +621,10 @@ int main(int argc, char** argv) sprintf(bu, "0x%06lX", y * 16); Fl_Input *b = new Fl_Input(200,(y-off)*25,80,25); b->textfont(FL_COURIER); - b->value(strdup(bu)); + b->value(fl_strdup(bu)); b = new Fl_Input(280,(y-off)*25,380,25); b->textfont(extra_font); - b->value(strdup(buf)); + b->value(fl_strdup(buf)); } scroll.end(); main_win->resizable(scroll); |
