ASTSetMode: Handle -Wmaybe-uninitialized warnings

In function ‘vSetStdReg’,
    inlined from ‘ASTSetMode’ at ast_mode.c:522:9:
ast_mode.c:724:10: warning: ‘vgamodeinfo.pStdTableEntry’ may be used
 uninitialized [-Wmaybe-uninitialized]
  724 |     jReg = pStdModePtr->MISC;
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
ast_mode.c: In function ‘ASTSetMode’:
ast_mode.c:496:21: note: ‘vgamodeinfo.pStdTableEntry’ was declared here
  496 |     VBIOS_MODE_INFO vgamodeinfo;
      |                     ^~~~~~~~~~~
In function ‘vSetCRTCReg’,
    inlined from ‘ASTSetMode’ at ast_mode.c:523:9:
ast_mode.c:780:70: warning: ‘vgamodeinfo.pEnhTableEntry’ may be used
 uninitialized [-Wmaybe-uninitialized]
  780 |     if ((pAST->jChipType == AST2500) && (pVGAModeInfo->pEnhTableEntry->Flags & AST2500PreCatchCRT))
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
ast_mode.c: In function ‘ASTSetMode’:
ast_mode.c:496:21: note: ‘vgamodeinfo.pEnhTableEntry’ was declared here
  496 |     VBIOS_MODE_INFO vgamodeinfo;
      |                     ^~~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-ast/-/merge_requests/15>
This commit is contained in:
Alan Coopersmith
2025-07-27 14:17:03 -07:00
committed by Enrico Weigelt, metux IT consult
parent daab9776fd
commit 1be66031a8

View File

@@ -493,7 +493,7 @@ Bool
ASTSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
ASTRecPtr pAST;
VBIOS_MODE_INFO vgamodeinfo;
VBIOS_MODE_INFO vgamodeinfo = { 0 };
pAST = ASTPTR(pScrn);