Browse Source

Eliminate -Wunknown-pragmas and -Wsign-compare warnings on GCC

pull/30/head
darealshinji 5 years ago committed by Albrecht Schlosser
parent
commit
71dc3269cd
  1. 2
      src/Fl_Native_File_Chooser_GTK.cxx
  2. 4
      src/Fl_x.cxx

2
src/Fl_Native_File_Chooser_GTK.cxx

@ -519,7 +519,7 @@ static char *text_file_preview(const char *fname) { @@ -519,7 +519,7 @@ static char *text_file_preview(const char *fname) {
int len = fread(text, 1, 4010, in);
fclose(in);
text[len] = 0;
if (strlen(text) < len) text[0] = 0; // presence of null byte in file --> not text
if ((int)strlen(text) < len) text[0] = 0; // presence of null byte in file --> not text
char *p = text;
int count = 0;
const char *end = text + strlen(text);

4
src/Fl_x.cxx

@ -1268,8 +1268,10 @@ static long getIncrData(uchar* &data, const XSelectionEvent& selevent, long lowe @@ -1268,8 +1268,10 @@ static long getIncrData(uchar* &data, const XSelectionEvent& selevent, long lowe
Note: '#pragma GCC diagnostic push' needs at least GCC 4.6.
*/
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))
#pragma GCC diagnostic push
@ -1284,7 +1286,9 @@ static KeySym fl_KeycodeToKeysym(Display *d, KeyCode k, unsigned i) { @@ -1284,7 +1286,9 @@ static KeySym fl_KeycodeToKeysym(Display *d, KeyCode k, unsigned i) {
#pragma GCC diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#if USE_XRANDR
static void react_to_screen_reconfiguration() {

Loading…
Cancel
Save