summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-22 08:16:56 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-03-22 08:16:56 +0100
commit6cc394a39eb4537927bc7d4d7d5959f5d23a9761 (patch)
treeba1cf80a24350e57fd77d554349d070fc2739f01
parentffbc66321c9e69f57c8095f2d4b6e6f9b1b8241e (diff)
parentf1b00c6637ad5752fa70eb1a8c1ac8ba274210f7 (diff)
Merge remote-tracking branch 'refs/remotes/origin/master'
-rw-r--r--src/Fl_Screen_Driver.H6
-rw-r--r--src/Fl_System_Driver.H18
-rw-r--r--src/Fl_System_Driver.cxx4
-rw-r--r--src/Fl_Window.cxx8
-rw-r--r--src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H2
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H2
-rw-r--r--src/drivers/PostScript/Fl_PostScript_Graphics_Driver.H2
-rw-r--r--src/scandir_win32.c4
-rw-r--r--test/coordinates.cxx3
9 files changed, 26 insertions, 23 deletions
diff --git a/src/Fl_Screen_Driver.H b/src/Fl_Screen_Driver.H
index 60ad11dcd..5c08e2af1 100644
--- a/src/Fl_Screen_Driver.H
+++ b/src/Fl_Screen_Driver.H
@@ -200,11 +200,11 @@ public:
// supports Fl_Window::default_icons()
virtual void default_icons(const Fl_RGB_Image *icons[], int count);
// implement to support copy-to-clipboard
- virtual void copy(const char */*stuff*/, int /*len*/, int /*clipboard*/, const char */*type*/) {}
+ virtual void copy(const char * /*stuff*/, int /*len*/, int /*clipboard*/, const char * /*type*/) {}
// implement to support paste-from-clipboard
- virtual void paste(Fl_Widget &, int /*clipboard*/, const char */*type*/) {}
+ virtual void paste(Fl_Widget &, int /*clipboard*/, const char * /*type*/) {}
// implement to support paste-from-clipboard
- virtual int clipboard_contains(const char */*type*/) {return 0;}
+ virtual int clipboard_contains(const char * /*type*/) {return 0;}
// implement to support paste-from-clipboard
virtual void clipboard_notify_change() {}
};
diff --git a/src/Fl_System_Driver.H b/src/Fl_System_Driver.H
index 779167b69..3075565c9 100644
--- a/src/Fl_System_Driver.H
+++ b/src/Fl_System_Driver.H
@@ -78,7 +78,7 @@ public:
// implement if the system adds unwanted program argument(s)
virtual int single_arg(const char *) { return 0; }
// implement if the system adds unwanted program argument pair(s)
- virtual int arg_and_value(const char */*name*/, const char */*value*/) { return 0; }
+ virtual int arg_and_value(const char * /*name*/, const char * /*value*/) { return 0; }
// implement to process the -display argument
virtual void display_arg(const char *) { }
// default implementation should be enough
@@ -109,7 +109,7 @@ public:
}
virtual FILE *fopen(const char* f, const char *mode);
virtual int system(const char*) {return -1;}
- virtual int execvp(const char */*file*/, char *const */*argv*/) {return -1;}
+ virtual int execvp(const char * /*file*/, char *const * /*argv*/) {return -1;}
virtual int chmod(const char* /*f*/, int /*mode*/) {return -1;}
virtual int access(const char* /*f*/, int /*mode*/) { return -1;}
virtual int stat(const char* /*f*/, struct stat *) { return -1;}
@@ -118,7 +118,7 @@ public:
virtual int unlink(const char*) {return -1;}
virtual int mkdir(const char* /*f*/, int /*mode*/) {return -1;}
virtual int rmdir(const char*) {return -1;}
- virtual int rename(const char* /*f*/, const char */*n*/) {return -1;}
+ virtual int rename(const char* /*f*/, const char * /*n*/) {return -1;}
// the default implementation of these utf8... functions should be enough
virtual unsigned utf8towc(const char* src, unsigned srclen, wchar_t* dst, unsigned dstlen);
@@ -135,7 +135,7 @@ public:
virtual int get_key(int) {return 0;}
// implement scandir-like function
virtual int filename_list(const char * /*d*/, dirent ***,
- int (*/*sort*/)(struct dirent **, struct dirent **),
+ int (* /*sort*/)(struct dirent **, struct dirent **),
char *errmsg=NULL, int errmsg_sz=0) {
(void)errmsg; (void)errmsg_sz;
return -1;
@@ -161,7 +161,7 @@ public:
// whether a platform uses additional code in Fl_Menu::handle_part1(int e)
virtual int need_menu_handle_part1_extra() {return 0;}
// implement to support fl_open_uri()
- virtual int open_uri(const char */*uri*/, char */*msg*/, int /*msglen*/) {return 0;}
+ virtual int open_uri(const char * /*uri*/, char * /*msg*/, int /*msglen*/) {return 0;}
// the default implementation of use_tooltip_timeout_condition() may be enough
virtual int use_tooltip_timeout_condition() {return 0;}
// the default implementation of use_recent_tooltip_fix() may be enough
@@ -171,7 +171,7 @@ public:
// the default implementation of need_test_shortcut_extra() may be enough
virtual int need_test_shortcut_extra() {return 0;}
// implement to support Fl_File_Browser::load()
- virtual int file_browser_load_filesystem(Fl_File_Browser *, char */*filename*/, int /*lname*/, Fl_File_Icon *) {return 0;}
+ virtual int file_browser_load_filesystem(Fl_File_Browser *, char * /*filename*/, int /*lname*/, Fl_File_Icon *) {return 0;}
// the default implementation of file_browser_load_directory() should be enough
virtual int file_browser_load_directory(const char *directory, char *filename, size_t name_size,
dirent ***pfiles, Fl_File_Sort_F *sort,
@@ -180,14 +180,14 @@ public:
virtual void newUUID(char *uuidBuffer) { uuidBuffer[0] = 0; }
// implement to support Fl_Preferences
virtual char *preference_rootnode(Fl_Preferences *, Fl_Preferences::Root,
- const char */*vendor*/,
- const char */*application*/) {return NULL;}
+ const char * /*vendor*/,
+ const char * /*application*/) {return NULL;}
// the default implementation of preferences_need_protection_check() may be enough
virtual int preferences_need_protection_check() {return 0;}
// implement to support Fl_Plugin_Manager::load()
virtual void *load(const char *) {return NULL;}
// the default implementation is most probably enough
- virtual void png_extra_rgba_processing(unsigned char */*array*/, int /*w*/, int /*h*/) {}
+ virtual void png_extra_rgba_processing(unsigned char * /*array*/, int /*w*/, int /*h*/) {}
// the default implementation is most probably enough
virtual const char *next_dir_sep(const char *start) { return strchr(start, '/');}
// implement to support threading
diff --git a/src/Fl_System_Driver.cxx b/src/Fl_System_Driver.cxx
index f207ed8b8..143585b72 100644
--- a/src/Fl_System_Driver.cxx
+++ b/src/Fl_System_Driver.cxx
@@ -406,11 +406,11 @@ int Fl_System_Driver::clocale_printf(FILE *output, const char *format, va_list a
}
int Fl_System_Driver::clocale_snprintf(char *output, size_t output_size, const char *format, va_list args) {
- return vsnprintf(output, output_size, format, args);
+ return 0; // overridden in platform drivers
}
int Fl_System_Driver::clocale_sscanf(const char *input, const char *format, va_list args) {
- return vsscanf(input, format, args);
+ return 0; // overridden in platform drivers
}
int Fl_System_Driver::filename_expand(char *to,int tolen, const char *from) {
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx
index e6f14141b..9fef2a936 100644
--- a/src/Fl_Window.cxx
+++ b/src/Fl_Window.cxx
@@ -68,9 +68,9 @@ void Fl_Window::_Fl_Window() {
}
Fl_Window::Fl_Window(int X,int Y,int W, int H, const char *l) :
- Fl_Group(X, Y, W, H, l),
- pWindowDriver(Fl_Window_Driver::newWindowDriver(this))
+ Fl_Group(X, Y, W, H, l)
{
+ pWindowDriver = Fl_Window_Driver::newWindowDriver(this);
_Fl_Window();
set_flag(FORCE_POSITION);
if (!parent()) clear_visible();
@@ -79,9 +79,9 @@ Fl_Window::Fl_Window(int X,int Y,int W, int H, const char *l) :
Fl_Window::Fl_Window(int W, int H, const char *l) :
// fix common user error of a missing end() with current(0):
-Fl_Group((Fl_Group::current(0),0), 0, W, H, l),
-pWindowDriver(Fl_Window_Driver::newWindowDriver(this))
+Fl_Group((Fl_Group::current(0),0), 0, W, H, l)
{
+ pWindowDriver = Fl_Window_Driver::newWindowDriver(this);
_Fl_Window();
clear_visible();
}
diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H
index f9b67d4b0..60c916fed 100644
--- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H
+++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H
@@ -141,7 +141,7 @@ public:
void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3);
void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1);
// ---
- Fl_Bitmask create_bitmask(int /*w*/, int /*h*/, const uchar */*array*/) { return 0L; }
+ Fl_Bitmask create_bitmask(int /*w*/, int /*h*/, const uchar * /*array*/) { return 0L; }
void ps_origin(int x, int y);
void ps_translate(int, int);
diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
index 274d911dc..cb14b4dff 100644
--- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
+++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver.H
@@ -98,7 +98,7 @@ public:
int height();
int descent();
// ---
- Fl_Bitmask create_bitmask(int /*w*/, int /*h*/, const uchar */*array*/) { return 0L; }
+ Fl_Bitmask create_bitmask(int /*w*/, int /*h*/, const uchar * /*array*/) { return 0L; }
void delete_bitmask(Fl_Bitmask) { }
};
diff --git a/src/drivers/PostScript/Fl_PostScript_Graphics_Driver.H b/src/drivers/PostScript/Fl_PostScript_Graphics_Driver.H
index 9ff238738..5d14e571b 100644
--- a/src/drivers/PostScript/Fl_PostScript_Graphics_Driver.H
+++ b/src/drivers/PostScript/Fl_PostScript_Graphics_Driver.H
@@ -249,7 +249,7 @@ public:
void draw_rgb(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
~Fl_PostScript_Graphics_Driver();
// ---
- Fl_Bitmask create_bitmask(int /*w*/, int /*h*/, const uchar */*array*/) { return 0L; }
+ Fl_Bitmask create_bitmask(int /*w*/, int /*h*/, const uchar * /*array*/) { return 0L; }
virtual int has_feature(driver_feature feature_mask) { return feature_mask & PRINTER; }
void ps_origin(int x, int y);
diff --git a/src/scandir_win32.c b/src/scandir_win32.c
index 2573fa395..874005bf2 100644
--- a/src/scandir_win32.c
+++ b/src/scandir_win32.c
@@ -47,10 +47,12 @@ static void get_ms_errmsg(char *errmsg, int errmsg_sz) {
if ( msize == 0 ) {
fl_snprintf(errmsg, errmsg_sz, "Error #%lu", (unsigned long)lastErr);
} else {
+ char *src;
+ char *dst;
/* convert message to UTF-8 */
fl_utf8fromwc(errmsg, errmsg_sz, mbuf, msize);
/* Remove '\r's -- they screw up fl_alert()) */
- char *src = errmsg, *dst = errmsg;
+ src = dst = errmsg;
for ( ; 1; src++ ) {
if ( *src == '\0' ) { *dst = '\0'; break; }
if ( *src != '\r' ) { *dst++ = *src; }
diff --git a/test/coordinates.cxx b/test/coordinates.cxx
index bb3651daf..f3f92c018 100644
--- a/test/coordinates.cxx
+++ b/test/coordinates.cxx
@@ -17,6 +17,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>
+#include "../src/flstring.h" // fl_snprintf()
#include <stdio.h>
class Box : public Fl_Box {
@@ -104,7 +105,7 @@ protected:
result = 1;
if (0 < Fl::event_x() && Fl::event_x() < w() &&
0 < Fl::event_y() && Fl::event_y() < h()) {
- snprintf(buffer, 128-1, fmt, Fl::event_x(), Fl::event_y());
+ fl_snprintf(buffer, 128-1, fmt, Fl::event_x(), Fl::event_y());
message_box->copy_label(buffer);
} else message_box->copy_label("");
break;