summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2012-05-20 21:16:21 +0200
committerTormod Volden <debian.tormod@gmail.com>2012-05-20 21:50:14 +0200
commit100ebd8040605dc9c87ee613c66c082273741270 (patch)
treec99b2038d7a05dbf9d3e3a5ade97fd38245fda45
parent1c71cf1ac48410a29b61c50330ee28306f0e7698 (diff)
fixup: simplify code in SavageSetTextMode()
Unless the code is incomplete (need ACTIVE_DEVICES mask here also?) the following if (A != B) A=B; can be replaced by A=B. + if (iDevInfo != psav->iDevInfo) { + psav->iDevInfo = iDevInfo; + } Otherwise just fix up comments and line widths.
-rw-r--r--src/savage_vbe.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/savage_vbe.c b/src/savage_vbe.c
index 5cca4cd..89afd1a 100644
--- a/src/savage_vbe.c
+++ b/src/savage_vbe.c
@@ -39,21 +39,15 @@ SavageClearVM86Regs( xf86Int10InfoPtr pInt )
void
SavageSetTextMode( SavagePtr psav )
{
- int iDevInfo;
-
- /* The BIOS settings currently in effect (which are retrieved by SavageGetDevice) are the reference for comparison */
- iDevInfo = SavageGetDevice(psav);
-
- /* Save the BIOS settings (which are in effect) as current if they are different from the last state saved as "current" */
- if (iDevInfo != psav->iDevInfo) {
- psav->iDevInfo = iDevInfo;
- }
+ /* Retrieve current output status via BIOS calls */
+ psav->iDevInfo = SavageGetDevice(psav);
- /* TODO: should the original settings also be corrected for the DuoView flag? */
+ /* TODO: should the settings also be corrected for the DuoView flag? */
- /* Restore display device to original (primary) state if changed since last mode switch AWAY from text. */
- /* avoid unnecessary changes - mask for ACTIVE_DEVICES only */
- if( (iDevInfo & ACTIVE_DEVICES) != (psav->iDevInfoPrim & ACTIVE_DEVICES) ) {
+ /* Restore display device to original (primary) state if active output
+ device status has changed since last mode switch AWAY from text. */
+ if( (psav->iDevInfo & ACTIVE_DEVICES) !=
+ (psav->iDevInfoPrim & ACTIVE_DEVICES) ) {
SavageClearVM86Regs( psav->pVbe->pInt10 );
psav->pVbe->pInt10->ax = 0x4f14;
psav->pVbe->pInt10->bx = 0x0003;