Removed compilation warnings from modern systems

This commit is contained in:
Bill Spitzak
2014-11-24 16:29:11 -08:00
parent d7543b20a1
commit 7c3b8d7ed0
5 changed files with 12 additions and 9 deletions

13
Frame.C
View File

@ -1,5 +1,6 @@
// Frame.C // Frame.C
#define FL_INTERNALS 1
#include "config.h" #include "config.h"
#include "Frame.H" #include "Frame.H"
#include "Desktop.H" #include "Desktop.H"
@ -915,7 +916,7 @@ void Frame::raise() {
// preserving stacking order: // preserving stacking order:
for (p = &first; *p;) { for (p = &first; *p;) {
Frame* f = *p; Frame* f = *p;
if (f == this || f->is_transient_for(this) && f->state() != UNMAPPED) { if (f == this || (f->is_transient_for(this) && f->state() != UNMAPPED)) {
*p = f->next; // remove it from list *p = f->next; // remove it from list
if (previous) { if (previous) {
XWindowChanges w; XWindowChanges w;
@ -970,7 +971,7 @@ void Frame::lower() {
void Frame::iconize() { void Frame::iconize() {
for (Frame* c = first; c; c = c->next) { for (Frame* c = first; c; c = c->next) {
if (c == this || c->is_transient_for(this) && c->state() != UNMAPPED) if (c == this || (c->is_transient_for(this) && c->state() != UNMAPPED))
c->state(ICONIC); c->state(ICONIC);
} }
} }
@ -1163,7 +1164,7 @@ void Frame::show_hide_buttons() {
#endif #endif
} }
if (min_h == max_h || flag(KEEP_ASPECT|NO_RESIZE) || if (min_h == max_h || flag(KEEP_ASPECT|NO_RESIZE) ||
!max_h_button.value() && by+label_w+2*BUTTON_H > h()-BUTTON_BOTTOM) { (!max_h_button.value() && by+label_w+2*BUTTON_H > h()-BUTTON_BOTTOM)) {
max_h_button.hide(); max_h_button.hide();
} else { } else {
max_h_button.position(BUTTON_LEFT,by); max_h_button.position(BUTTON_LEFT,by);
@ -1171,7 +1172,7 @@ void Frame::show_hide_buttons() {
by += BUTTON_H; by += BUTTON_H;
} }
if (min_w == max_w || flag(KEEP_ASPECT|NO_RESIZE) || if (min_w == max_w || flag(KEEP_ASPECT|NO_RESIZE) ||
!max_w_button.value() && by+label_w+2*BUTTON_H > h()-BUTTON_BOTTOM) { (!max_w_button.value() && by+label_w+2*BUTTON_H > h()-BUTTON_BOTTOM)) {
max_w_button.hide(); max_w_button.hide();
} else { } else {
max_w_button.position(BUTTON_LEFT,by); max_w_button.position(BUTTON_LEFT,by);
@ -1646,8 +1647,8 @@ int Frame::handle(int e) {
nh = iy+ih-(Fl::event_y_root()-dy); nh = iy+ih-(Fl::event_y_root()-dy);
else {ny = y(); nh = h();} else {ny = y(); nh = h();}
if (flag(KEEP_ASPECT)) { if (flag(KEEP_ASPECT)) {
if (nw-dwidth > nh-dwidth if ((nw-dwidth > nh-dwidth
&& (what&(FL_ALIGN_LEFT|FL_ALIGN_RIGHT)) && (what&(FL_ALIGN_LEFT|FL_ALIGN_RIGHT)))
|| !(what&(FL_ALIGN_TOP|FL_ALIGN_BOTTOM))) || !(what&(FL_ALIGN_TOP|FL_ALIGN_BOTTOM)))
nh = nw-dwidth+dheight; nh = nw-dwidth+dheight;
else else

View File

@ -182,8 +182,8 @@ int test_shortcut(int shortcut) {
int Handle_Hotkey() { int Handle_Hotkey() {
for (int i = 0; keybindings[i].key; i++) { for (int i = 0; keybindings[i].key; i++) {
if (Fl::test_shortcut(keybindings[i].key) || if (Fl::test_shortcut(keybindings[i].key) ||
(keybindings[i].key & 0xFFFF) == FL_Delete ((keybindings[i].key & 0xFFFF) == FL_Delete
&& Fl::event_key() == FL_BackSpace// fltk bug? && Fl::event_key() == FL_BackSpace)// fltk bug?
) { ) {
keybindings[i].func(); keybindings[i].func();
return 1; return 1;

2
Menu.C
View File

@ -568,7 +568,7 @@ ShowTabMenu(int tab)
if (d == Desktop::current()) first_on_desk = menu+n; if (d == Desktop::current()) first_on_desk = menu+n;
for (c = Frame::first; c; c = c->next) { for (c = Frame::first; c; c = c->next) {
if (c->state() == UNMAPPED || c->transient_for()) continue; if (c->state() == UNMAPPED || c->transient_for()) continue;
if (c->desktop() == d || !c->desktop() && d == Desktop::current()) { if (c->desktop() == d || (!c->desktop() && d == Desktop::current())) {
init(menu[n],(char*)c); init(menu[n],(char*)c);
#if FL_MAJOR_VERSION < 2 #if FL_MAJOR_VERSION < 2
init(menu[n],(char*)c); init(menu[n],(char*)c);

View File

@ -26,6 +26,7 @@
/* ********************************************************************** */ /* ********************************************************************** */
#define FL_INTERNALS 1
#include <FL/x.H> #include <FL/x.H>
#if FL_MAJOR_VERSION < 2 #if FL_MAJOR_VERSION < 2
# define XWindow Window # define XWindow Window

1
main.C
View File

@ -2,6 +2,7 @@
// you can test the window controls. // you can test the window controls.
//#define TEST 1 //#define TEST 1
#define FL_INTERNALS 1
#include "Frame.H" #include "Frame.H"
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <stdio.h> #include <stdio.h>