Fix compiler warning

Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.4.0

Warning appeared after upgrade to Xcode 12.5 in several files,
example:

In file included from Fl_Scroll.cxx:19:
../FL/Fl_Scroll.H:102:17: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
  typedef struct {
                ^
                 ScrollInfo
../FL/Fl_Scroll.H:104:5: note: type is not C-compatible due to this member declaration
    typedef struct { int x,y,w,h; } Fl_Region_XYWH;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FL/Fl_Scroll.H:128:5: note: type is given name 'ScrollInfo' for linkage purposes by this typedef declaration
  } ScrollInfo;
    ^
This commit is contained in:
Albrecht Schlosser
2021-05-03 21:31:58 +02:00
parent 15aff3718e
commit 8268972061
+16 -17
View File
@@ -1,19 +1,17 @@
// //
// "$Id$"
//
// Scroll header file for the Fast Light Tool Kit (FLTK). // Scroll header file for the Fast Light Tool Kit (FLTK).
// //
// Copyright 1998-2015 by Bill Spitzak and others. // Copyright 1998-2021 by Bill Spitzak and others.
// //
// This library is free software. Distribution and use rights are outlined in // 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 // the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at: // file is missing or damaged, see the license at:
// //
// http://www.fltk.org/COPYING.php // https://www.fltk.org/COPYING.php
// //
// Please report all bugs and problems on the following page: // Please see the following page on how to report bugs and issues:
// //
// http://www.fltk.org/str.php // https://www.fltk.org/bugs.php
// //
/* \file /* \file
@@ -99,15 +97,10 @@ protected: // NEW (STR#1895)
#else #else
private: // OLD private: // OLD
#endif #endif
/**
Structure to manage scrollbar and widget interior sizes.
This is filled out by recalc_scrollbars() for use in calculations
that need to know the visible scroll area size, etc.
\note Availability in FLTK_ABI_VERSION 10303 or higher.
*/
typedef struct {
/// A local struct to manage a region defined by xywh /// A local struct to manage a region defined by xywh
typedef struct { int x,y,w,h; } Fl_Region_XYWH; typedef struct { int x,y,w,h; } Fl_Region_XYWH;
/// A local struct to manage a region defined by left/right/top/bottom /// A local struct to manage a region defined by left/right/top/bottom
typedef struct { typedef struct {
int l; ///< (l)eft "x" position, aka x1 int l; ///< (l)eft "x" position, aka x1
@@ -115,6 +108,7 @@ private: // OLD
int t; ///< (t)op "y" position, aka y1 int t; ///< (t)op "y" position, aka y1
int b; ///< (b)ottom "y" position, aka y2 int b; ///< (b)ottom "y" position, aka y2
} Fl_Region_LRTB; } Fl_Region_LRTB;
/// A local struct to manage a scrollbar's xywh region and tab values /// A local struct to manage a scrollbar's xywh region and tab values
typedef struct { typedef struct {
int x,y,w,h; int x,y,w,h;
@@ -123,6 +117,14 @@ private: // OLD
int first; ///< scrollbar tab's "number of first line" int first; ///< scrollbar tab's "number of first line"
int total; ///< scrollbar tab's "total number of lines" int total; ///< scrollbar tab's "total number of lines"
} Fl_Scrollbar_Data; } Fl_Scrollbar_Data;
/**
Structure to manage scrollbar and widget interior sizes.
This is filled out by recalc_scrollbars() for use in calculations
that need to know the visible scroll area size, etc.
\note Availability in FLTK_ABI_VERSION 10303 or higher.
*/
typedef struct {
int scrollsize; ///< the effective scrollbar thickness (local or global) int scrollsize; ///< the effective scrollbar thickness (local or global)
Fl_Region_XYWH innerbox; ///< widget's inner box, excluding scrollbars Fl_Region_XYWH innerbox; ///< widget's inner box, excluding scrollbars
Fl_Region_XYWH innerchild; ///< widget's inner box, including scrollbars Fl_Region_XYWH innerchild; ///< widget's inner box, including scrollbars
@@ -132,6 +134,7 @@ private: // OLD
Fl_Scrollbar_Data hscroll; ///< horizontal scrollbar region + values Fl_Scrollbar_Data hscroll; ///< horizontal scrollbar region + values
Fl_Scrollbar_Data vscroll; ///< vertical scrollbar region + values Fl_Scrollbar_Data vscroll; ///< vertical scrollbar region + values
} ScrollInfo; } ScrollInfo;
void recalc_scrollbars(ScrollInfo &si); void recalc_scrollbars(ScrollInfo &si);
protected: protected:
@@ -203,7 +206,3 @@ public:
}; };
#endif #endif
//
// End of "$Id$".
//