From 49dae86edf4d1deb7f5e39f57f05a6656137ead1 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 21 Mar 2022 12:12:07 +0100 Subject: Fix for issue #418 : some warnings about unused functions. --- src/Fl_x.cxx | 23 ----------------- src/drivers/Unix/Fl_Unix_System_Driver.H | 1 + src/drivers/Unix/Fl_Unix_System_Driver.cxx | 4 +-- src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx | 12 ++------- src/drivers/X11/Fl_X11_System_Driver.cxx | 33 ------------------------ 5 files changed, 5 insertions(+), 68 deletions(-) (limited to 'src') diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 6933ee05d..56e316630 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -677,13 +677,6 @@ const char * fl_selection_type[2]; int fl_selection_buffer_length[2]; char fl_i_own_selection[2] = {0,0}; -static void read_int(uchar *c, int& i) { - i = *c; - i |= (*(++c))<<8; - i |= (*(++c))<<16; - i |= (*(++c))<<24; -} - // Call this when a "paste" operation happens: void Fl_X11_Screen_Driver::paste(Fl_Widget &receiver, int clipboard, const char *type) { @@ -837,22 +830,6 @@ void Fl_X11_Screen_Driver::copy(const char *stuff, int len, int clipboard, const XSetSelectionOwner(fl_display, property, fl_message_window, fl_event_time); } -static void write_short(unsigned char **cp, short i) { - unsigned char *c = *cp; - *c++ = i & 0xFF; i >>= 8; - *c++ = i & 0xFF; - *cp = c; -} - -static void write_int(unsigned char **cp, int i) { - unsigned char *c = *cp; - *c++ = i & 0xFF; i >>= 8; - *c++ = i & 0xFF; i >>= 8; - *c++ = i & 0xFF; i >>= 8; - *c++ = i & 0xFF; - *cp = c; -} - // takes a raw RGB image and puts it in the copy/paste buffer void Fl_X11_Screen_Driver::copy_image(const unsigned char *data, int W, int H, int clipboard){ diff --git a/src/drivers/Unix/Fl_Unix_System_Driver.H b/src/drivers/Unix/Fl_Unix_System_Driver.H index bf8a174d8..1d01ebffe 100644 --- a/src/drivers/Unix/Fl_Unix_System_Driver.H +++ b/src/drivers/Unix/Fl_Unix_System_Driver.H @@ -50,6 +50,7 @@ public: virtual void *control_maximize_button(void *data); static unsigned char *create_bmp(const unsigned char *data, int W, int H, int *return_size); static Fl_RGB_Image *own_bmp_to_RGB(char *bmp); + static void read_int(uchar *c, int& i); }; #endif /* FL_NIX_SYSTEM_DRIVER_H */ diff --git a/src/drivers/Unix/Fl_Unix_System_Driver.cxx b/src/drivers/Unix/Fl_Unix_System_Driver.cxx index 3951e3eda..d956f04b1 100644 --- a/src/drivers/Unix/Fl_Unix_System_Driver.cxx +++ b/src/drivers/Unix/Fl_Unix_System_Driver.cxx @@ -2,7 +2,7 @@ // Definition of Unix/Linux system driver // for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2021 by Bill Spitzak and others. +// Copyright 2010-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -924,7 +924,7 @@ unsigned char *Fl_Unix_System_Driver::create_bmp(const unsigned char *data, int } -static void read_int(uchar *c, int& i) { +void Fl_Unix_System_Driver::read_int(uchar *c, int& i) { i = *c; i |= (*(++c))<<8; i |= (*(++c))<<16; diff --git a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx index b6e921fc5..6cfeb092a 100644 --- a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx +++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx @@ -481,14 +481,6 @@ static const struct wl_data_device_listener data_device_listener = { const struct wl_data_device_listener *Fl_Wayland_Screen_Driver::p_data_device_listener = &data_device_listener; -static void read_int(uchar *c, int& i) { - i = *c; - i |= (*(++c))<<8; - i |= (*(++c))<<16; - i |= (*(++c))<<24; -} - - // Reads from the clipboard an image which can be in image/bmp or image/png MIME type. // Returns 0 if OK, != 0 if error. static int get_clipboard_image() { @@ -530,8 +522,8 @@ static int get_clipboard_image() { ssize_t n = read(fds[0], buf, sizeof(buf)); // read size info of the BMP image if (n == sizeof(buf)) { int w, h; // size of the BMP image - read_int(buf + 18, w); - read_int(buf + 22, h); + Fl_Unix_System_Driver::read_int(buf + 18, w); + Fl_Unix_System_Driver::read_int(buf + 22, h); int R = ((3*w+3)/4) * 4; // the number of bytes per row of BMP image, rounded up to multiple of 4 bmp = new char[R * h + 54]; memcpy(bmp, buf, 54); diff --git a/src/drivers/X11/Fl_X11_System_Driver.cxx b/src/drivers/X11/Fl_X11_System_Driver.cxx index cbd97b509..d3a81c745 100644 --- a/src/drivers/X11/Fl_X11_System_Driver.cxx +++ b/src/drivers/X11/Fl_X11_System_Driver.cxx @@ -70,39 +70,6 @@ extern "C" { #endif -// Find a program in the path... -static char *path_find(const char *program, char *filename, int filesize) { - const char *path; // Search path - char *ptr, // Pointer into filename - *end; // End of filename buffer - - - if ((path = fl_getenv("PATH")) == NULL) path = "/bin:/usr/bin"; - - for (ptr = filename, end = filename + filesize - 1; *path; path ++) { - if (*path == ':') { - if (ptr > filename && ptr[-1] != '/' && ptr < end) *ptr++ = '/'; - - strlcpy(ptr, program, end - ptr + 1); - - if (!access(filename, X_OK)) return filename; - - ptr = filename; - } else if (ptr < end) *ptr++ = *path; - } - - if (ptr > filename) { - if (ptr[-1] != '/' && ptr < end) *ptr++ = '/'; - - strlcpy(ptr, program, end - ptr + 1); - - if (!access(filename, X_OK)) return filename; - } - - return 0; -} - - void Fl_X11_System_Driver::display_arg(const char *arg) { Fl::display(arg); } -- cgit v1.2.3