GDISP: Move extern GDISPVMT declarations outside of function body
This prevents generation of "nested-externs" compiler warnings.
This commit is contained in:
parent
37450998e1
commit
cf01cb2e7c
@ -555,6 +555,14 @@ static void line_clip(GDisplay *g) {
|
|||||||
/* Driver exported functions. */
|
/* Driver exported functions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
// Gather GDISP VMT(S)
|
||||||
|
// These are only needed in _gdispInit(). However, we want to prevent generating nested-externs compiler warnings.
|
||||||
|
#if defined(GDISP_DRIVER_LIST)
|
||||||
|
extern GDISPVMTLIST GDISP_DRIVER_LIST;
|
||||||
|
#else
|
||||||
|
extern const GDISPVMT GDISPVMT_OnlyOne[1];
|
||||||
|
#endif
|
||||||
|
|
||||||
void _gdispInit(void)
|
void _gdispInit(void)
|
||||||
{
|
{
|
||||||
// GDISP_DRIVER_LIST is defined - create each driver instance
|
// GDISP_DRIVER_LIST is defined - create each driver instance
|
||||||
@ -563,7 +571,6 @@ void _gdispInit(void)
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
typedef const GDISPVMT const GDISPVMTLIST[1];
|
typedef const GDISPVMT const GDISPVMTLIST[1];
|
||||||
|
|
||||||
extern GDISPVMTLIST GDISP_DRIVER_LIST;
|
|
||||||
static const GDISPVMT * const dclist[] = {GDISP_DRIVER_LIST};
|
static const GDISPVMT * const dclist[] = {GDISP_DRIVER_LIST};
|
||||||
|
|
||||||
for(i = 0; i < sizeof(dclist)/sizeof(dclist[0]); i++) {
|
for(i = 0; i < sizeof(dclist)/sizeof(dclist[0]); i++) {
|
||||||
@ -574,7 +581,6 @@ void _gdispInit(void)
|
|||||||
#elif GDISP_TOTAL_DISPLAYS > 1
|
#elif GDISP_TOTAL_DISPLAYS > 1
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
extern const GDISPVMT GDISPVMT_OnlyOne[1];
|
|
||||||
|
|
||||||
if (!(GDISPVMT_OnlyOne->d.flags & GDISP_VFLG_DYNAMICONLY)) {
|
if (!(GDISPVMT_OnlyOne->d.flags & GDISP_VFLG_DYNAMICONLY)) {
|
||||||
for(i = 0; i < GDISP_TOTAL_DISPLAYS; i++)
|
for(i = 0; i < GDISP_TOTAL_DISPLAYS; i++)
|
||||||
@ -583,8 +589,6 @@ void _gdispInit(void)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
extern const GDISPVMT GDISPVMT_OnlyOne[1];
|
|
||||||
|
|
||||||
if (!(GDISPVMT_OnlyOne->d.flags & GDISP_VFLG_DYNAMICONLY))
|
if (!(GDISPVMT_OnlyOne->d.flags & GDISP_VFLG_DYNAMICONLY))
|
||||||
gdriverRegister(&GDISPVMT_OnlyOne->d, 0);
|
gdriverRegister(&GDISPVMT_OnlyOne->d, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user