summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2020-07-21 23:57:45 -0700
committerGreg Ercolano <erco@seriss.com>2020-08-01 14:19:40 -0700
commitb4095880125b2f0d1d56c80a2bbf3fb0f6f98cb9 (patch)
tree1b3cce7dd90de245b96efe0446b0e946ecd971b8
parent2141c63628a831d3f53dad7035c94028f8d0d629 (diff)
Remove unneeded strdup from example, fold tabs
-rw-r--r--examples/table-as-container.cxx4
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.H2
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx2
-rw-r--r--src/drivers/X11/Fl_X11_System_Driver.cxx2
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx2
-rw-r--r--src/fl_string.cxx2
-rw-r--r--src/xutf8/utf8Wrap.c2
7 files changed, 8 insertions, 8 deletions
diff --git a/examples/table-as-container.cxx b/examples/table-as-container.cxx
index 838c55512..d5887439d 100644
--- a/examples/table-as-container.cxx
+++ b/examples/table-as-container.cxx
@@ -31,7 +31,6 @@
#include <FL/Fl_Input.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Table.H>
-#include <FL/fl_string.h> // fl_strdup()
void button_cb(Fl_Widget *w, void*);
@@ -76,7 +75,8 @@ public:
} else {
// Create the light buttons
sprintf(s, "%d/%d ", r, c);
- Fl_Light_Button *butt = new Fl_Light_Button(X,Y,W,H,fl_strdup(s));
+ Fl_Light_Button *butt = new Fl_Light_Button(X,Y,W,H);
+ butt->copy_label(s);
butt->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
butt->callback(button_cb, (void*)0);
butt->value( ((r+c*2) & 4 ) ? 1 : 0);
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
index 049e6c114..0dd12ca17 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
@@ -24,7 +24,7 @@
#include "../../Fl_System_Driver.H"
#include <stdarg.h>
-#include <string.h> // strdup
+#include <string.h> // strdup
/*
Move everything here that manages the system interface.
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
index d37ec62ff..025d4ee37 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
@@ -18,7 +18,7 @@
#include "Fl_WinAPI_System_Driver.H"
#include <FL/Fl.H>
#include <FL/fl_utf8.h>
-#include <FL/fl_string.h> // fl_strdup()
+#include <FL/fl_string.h> // fl_strdup()
#include <FL/filename.H>
#include <FL/Fl_File_Browser.H>
#include <FL/Fl_File_Icon.H>
diff --git a/src/drivers/X11/Fl_X11_System_Driver.cxx b/src/drivers/X11/Fl_X11_System_Driver.cxx
index 8a308bdb8..6dcaee06d 100644
--- a/src/drivers/X11/Fl_X11_System_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_System_Driver.cxx
@@ -17,7 +17,7 @@
#include "Fl_X11_System_Driver.H"
#include <FL/Fl_File_Browser.H>
-#include <FL/fl_string.h> // fl_strdup
+#include <FL/fl_string.h> // fl_strdup
#include "../../flstring.h"
#include <X11/Xlib.h>
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
index 6b42b880a..5c88ec100 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
@@ -20,7 +20,7 @@
#include "Fl_Xlib_Graphics_Driver.H"
#include <FL/Fl.H>
#include <FL/fl_draw.H>
-#include <FL/fl_string.h> // fl_strdup()
+#include <FL/fl_string.h> // fl_strdup()
#include <FL/platform.H>
#include "Fl_Font.H"
diff --git a/src/fl_string.cxx b/src/fl_string.cxx
index cd0d08496..c53c0e21f 100644
--- a/src/fl_string.cxx
+++ b/src/fl_string.cxx
@@ -15,7 +15,7 @@
*/
#include <FL/fl_string.h>
-#include <string.h> // strdup/_strdup
+#include <string.h> // strdup/_strdup
#include "Fl_System_Driver.H"
/**
diff --git a/src/xutf8/utf8Wrap.c b/src/xutf8/utf8Wrap.c
index a9f9bf947..4a2bbc990 100644
--- a/src/xutf8/utf8Wrap.c
+++ b/src/xutf8/utf8Wrap.c
@@ -21,7 +21,7 @@
#include "../Xutf8.h"
#include <X11/Xlib.h>
-#include <FL/fl_string.h> // fl_strdup()
+#include <FL/fl_string.h> // fl_strdup()
#include <ctype.h>
#include <stdlib.h>
#include <string.h>