Fix MSVC compiler warnings

This commit is contained in:
Albrecht Schlosser
2021-12-05 21:00:15 +01:00
parent 7d26ee6ac2
commit cf58f7ae2b
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -47,6 +47,7 @@
#include "flstring.h" #include "flstring.h"
#include <FL/fl_ask.H> #include <FL/fl_ask.H>
#include "Fl_Message.h" // intentionally "hidden" in src/... #include "Fl_Message.h" // intentionally "hidden" in src/...
#include "FL/fl_string.h" // fl_strdup()
#include <FL/Fl_Window.H> #include <FL/Fl_Window.H>
#include <FL/Fl_Box.H> #include <FL/Fl_Box.H>
@@ -510,7 +511,7 @@ void Fl_Message::message_title(const char *title) {
message_title_ = 0; message_title_ = 0;
} }
if (title) if (title)
message_title_ = strdup(title); message_title_ = fl_strdup(title);
} }
/** Sets the default title of the dialog window used in many common dialogs. /** Sets the default title of the dialog window used in many common dialogs.
@@ -534,7 +535,7 @@ void Fl_Message::message_title_default(const char *title) {
message_title_default_ = 0; message_title_default_ = 0;
} }
if (title) if (title)
message_title_default_ = strdup(title); message_title_default_ = fl_strdup(title);
} }
void Fl_Message::icon_label(const char *str) { void Fl_Message::icon_label(const char *str) {
+1 -1
View File
@@ -99,7 +99,7 @@ void Fl_String::alloc_buf(int size) {
} }
void Fl_String::value(const char *str) { void Fl_String::value(const char *str) {
value(str, str ? strlen(str) : 0); value(str, str ? (int)strlen(str) : 0);
} }
int Fl_String::slen() const { int Fl_String::slen() const {