diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-01-12 17:54:05 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-01-15 11:17:47 -0800 |
commit | 2d64d83f24a3847a469ecb8d566dadb01dca83e8 (patch) | |
tree | 27612a8b038e9db4b7f7abd010059ab36e82cc18 | |
parent | f5f1239385c0ab54d1ae648c1dd73343bd8a0490 (diff) |
Fix 40 of 42 -Wformat-nonliteral warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/sis_driver.c | 32 | ||||
-rw-r--r-- | src/sis_opt.c | 22 | ||||
-rw-r--r-- | src/sis_vga.c | 2 |
3 files changed, 28 insertions, 28 deletions
diff --git a/src/sis_driver.c b/src/sis_driver.c index 2643b26..766c362 100644 --- a/src/sis_driver.c +++ b/src/sis_driver.c @@ -1602,8 +1602,8 @@ SiSRecalcDefaultVirtualSize(ScrnInfoPtr pScrn) SISPtr pSiS = SISPTR(pScrn); DisplayModePtr mode, bmode; int maxh, maxv; - static const char *str = "MergedFB: Virtual %s %d\n"; - static const char *errstr = "Virtual %s to small for given CRT2Position offset\n"; + static const char * const str = "MergedFB: Virtual %s %d\n"; + static const char * const errstr = "Virtual %s to small for given CRT2Position offset\n"; mode = bmode = pScrn->modes; maxh = maxv = 0; @@ -1652,7 +1652,7 @@ SiSMergedFBSetDpi(ScrnInfoPtr pScrn1, ScrnInfoPtr pScrn2, SiSScrn2Rel srel) xf86MonPtr DDC1 = (xf86MonPtr)(pScrn1->monitor->DDC); xf86MonPtr DDC2 = (xf86MonPtr)(pScrn2->monitor->DDC); int ddcWidthmm = 0, ddcHeightmm = 0; - const char *dsstr = "MergedFB: Display dimensions: (%d, %d) mm\n"; + const char * const dsstr = "MergedFB: Display dimensions: (%d, %d) mm\n"; /* This sets the DPI for MergedFB mode. The problem is that * this can never be exact, because the output devices may @@ -3164,22 +3164,22 @@ SISPreInit(ScrnInfoPtr pScrn, int flags) Bool crt2freqoverruled = FALSE; #endif - static const char *ddcsstr = "CRT%d DDC monitor info: *******************************************\n"; - static const char *ddcestr = "End of CRT%d DDC monitor info *************************************\n"; - static const char *subshstr = "Substituting missing CRT%d monitor HSync range by DDC data\n"; - static const char *subsvstr = "Substituting missing CRT%d monitor VRefresh range by DDC data\n"; - static const char *saneh = "Correcting %s CRT%d monitor HSync range\n"; - static const char *sanev = "Correcting %s CRT%d monitor VRefresh range\n"; + static const char * const ddcsstr = "CRT%d DDC monitor info: *******************************************\n"; + static const char * const ddcestr = "End of CRT%d DDC monitor info *************************************\n"; + static const char * const subshstr = "Substituting missing CRT%d monitor HSync range by DDC data\n"; + static const char * const subsvstr = "Substituting missing CRT%d monitor VRefresh range by DDC data\n"; + static const char * const saneh = "Correcting %s CRT%d monitor HSync range\n"; + static const char * const sanev = "Correcting %s CRT%d monitor VRefresh range\n"; #ifdef SISMERGED - static const char *mergednocrt1 = "CRT1 not detected or forced off. %s.\n"; - static const char *mergednocrt2 = "No CRT2 output selected or no video bridge detected. %s.\n"; - static const char *mergeddisstr = "MergedFB mode disabled"; - static const char *modesforstr = "Modes for CRT%d: **************************************************\n"; - static const char *crtsetupstr = "*************************** CRT%d setup ***************************\n"; - static const char *crt2monname = "CRT2"; + static const char * const mergednocrt1 = "CRT1 not detected or forced off. %s.\n"; + static const char * const mergednocrt2 = "No CRT2 output selected or no video bridge detected. %s.\n"; + static const char * const mergeddisstr = "MergedFB mode disabled"; + static const char * const modesforstr = "Modes for CRT%d: **************************************************\n"; + static const char * const crtsetupstr = "*************************** CRT%d setup ***************************\n"; + static const char * const crt2monname = "CRT2"; #endif #if defined(SISDUALHEAD) || defined(SISMERGED) - static const char *notsuitablestr = "Not using mode \"%s\" (not suitable for %s mode)\n"; + static const char * const notsuitablestr = "Not using mode \"%s\" (not suitable for %s mode)\n"; #endif if(flags & PROBE_DETECT) { diff --git a/src/sis_opt.c b/src/sis_opt.c index 3bb858e..7068a7e 100644 --- a/src/sis_opt.c +++ b/src/sis_opt.c @@ -325,8 +325,8 @@ static void SiS_PrintIlRange(ScrnInfoPtr pScrn, int token, int min, int max, UChar showhex) { SISPtr pSiS = SISPTR(pScrn); - static const char *ilparmd = "Invalid parameter for \"%s\". Valid range is %d - %d\n"; - static const char *ilparmh = "Invalid parameter for \"%s\". Valid range is 0x%x - 0x%x\n"; + static const char * const ilparmd = "Invalid parameter for \"%s\". Valid range is %d - %d\n"; + static const char * const ilparmh = "Invalid parameter for \"%s\". Valid range is 0x%x - 0x%x\n"; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, showhex ? ilparmh : ilparmd, @@ -434,13 +434,13 @@ SiSOptions(ScrnInfoPtr pScrn) MessageType from; char *strptr; int ival; - static const char *baddhm = "Option \"%s\" ignored in Dual Head mode\n"; - static const char *validparm = "Valid parameters are"; - static const char *disabledstr= "disabled"; - static const char *enabledstr = "enabled"; - static const char *gammaopt = "%s expects either a boolean, or 1 or 3 real numbers (0.1 - 10.0)\n"; - static const char *briopt = "%s expects 1 or 3 real numbers (0.1 - 10.0)\n"; - static const char *newbriopt = "%s expects 1 or 3 real numbers (-1.0 - 1.0)\n"; + static const char * const baddhm = "Option \"%s\" ignored in Dual Head mode\n"; + static const char * const validparm = "Valid parameters are"; + static const char * const disabledstr= "disabled"; + static const char * const enabledstr = "enabled"; + static const char * const gammaopt = "%s expects either a boolean, or 1 or 3 real numbers (0.1 - 10.0)\n"; + static const char * const briopt = "%s expects 1 or 3 real numbers (0.1 - 10.0)\n"; + static const char * const newbriopt = "%s expects 1 or 3 real numbers (-1.0 - 1.0)\n"; Bool val, IsDHM = FALSE; Bool IsSecondHead = FALSE; @@ -997,7 +997,7 @@ SiSOptions(ScrnInfoPtr pScrn) */ #ifdef SISDUALHEAD if((pSiS->DualHeadMode) && (pSiS->SecondHead)) { - static const char *mystring = "Option \"%s\" only accepted in CRT2 (Master) Device section\n"; + static const char * const mystring = "Option \"%s\" only accepted in CRT2 (Master) Device section\n"; int i; const short forbiddenopts[] = { OPTION_TURBOQUEUE, OPTION_RESTOREBYSET, OPTION_ENABLEHOTKEY, @@ -1592,7 +1592,7 @@ SiSOptions(ScrnInfoPtr pScrn) } if(pSiS->OptTVStand != -1) { - static const char *tvstdstr = "TV standard shall be %s\n"; + static const char * const tvstdstr = "TV standard shall be %s\n"; if(pSiS->Chipset == PCI_CHIP_SIS6326) { pSiS->NonDefaultPAL = -1; pSiS->NonDefaultNTSC = -1; diff --git a/src/sis_vga.c b/src/sis_vga.c index 59d48d5..ee8d793 100644 --- a/src/sis_vga.c +++ b/src/sis_vga.c @@ -1019,7 +1019,7 @@ void SISVGAPreInit(ScrnInfoPtr pScrn) int upperlimitlvds, lowerlimitlvds; int upperlimitch, lowerlimitch; int chronteltype, chrontelidreg, upperlimitvb; - static const char *detectvb = "Detected SiS%s video bridge (%s, ID %d; Rev 0x%x)\n"; + static const char * const detectvb = "Detected SiS%s video bridge (%s, ID %d; Rev 0x%x)\n"; #if 0 UChar sr17=0; #endif |