mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-01 09:59:23 +02:00
* instead of using separate booleans use a set to keep track of pending changes for popped settings
git-svn-id: trunk@39214 -
This commit is contained in:
parent
b3e4ace4e3
commit
da672d1344
@ -213,6 +213,12 @@ interface
|
||||
property items[I:longint]:TLinkRec read getlinkrec; default;
|
||||
end;
|
||||
|
||||
tpendingstateflag = (
|
||||
psf_alignment_changed,
|
||||
psf_verbosity_full_switched,
|
||||
psf_local_switches_changed
|
||||
);
|
||||
tpendingstateflags = set of tpendingstateflag;
|
||||
|
||||
tpendingstate = record
|
||||
nextverbositystr : shortstring;
|
||||
@ -221,9 +227,7 @@ interface
|
||||
nextcallingstr : shortstring;
|
||||
nextmessagerecord : pmessagestaterecord;
|
||||
nextalignment : talignmentinfo;
|
||||
alignmentchanged,
|
||||
verbosityfullswitched,
|
||||
localswitcheschanged : boolean;
|
||||
flags : tpendingstateflags;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -310,7 +310,7 @@ procedure recordpendingmessagestate(msg: longint; state: tmsgstate);
|
||||
|
||||
procedure recordpendinglocalswitch(sw: tlocalswitch; state: char);
|
||||
begin
|
||||
if not pendingstate.localswitcheschanged then
|
||||
if not (psf_local_switches_changed in pendingstate.flags) then
|
||||
pendingstate.nextlocalswitches:=current_settings.localswitches;
|
||||
if state='-' then
|
||||
exclude(pendingstate.nextlocalswitches,sw)
|
||||
@ -323,21 +323,21 @@ procedure recordpendinglocalswitch(sw: tlocalswitch; state: char);
|
||||
else
|
||||
exclude(pendingstate.nextlocalswitches,sw);
|
||||
end;
|
||||
pendingstate.localswitcheschanged:=true;
|
||||
include(pendingstate.flags,psf_local_switches_changed);
|
||||
end;
|
||||
|
||||
|
||||
procedure recordpendingalignmentfullswitch(const alignment : talignmentinfo);
|
||||
begin
|
||||
pendingstate.nextalignment:=alignment;
|
||||
pendingstate.alignmentchanged:=true;
|
||||
include(pendingstate.flags,psf_alignment_changed);
|
||||
end;
|
||||
|
||||
|
||||
procedure recordpendinglocalfullswitch(const switches: tlocalswitches);
|
||||
begin
|
||||
pendingstate.nextlocalswitches:=switches;
|
||||
pendingstate.localswitcheschanged:=true;
|
||||
include(pendingstate.flags,psf_local_switches_changed);
|
||||
end;
|
||||
|
||||
|
||||
@ -345,7 +345,7 @@ procedure recordpendingverbosityfullswitch(verbosity: longint);
|
||||
begin
|
||||
pendingstate.nextverbositystr:='';
|
||||
pendingstate.nextverbosityfullswitch:=verbosity;
|
||||
pendingstate.verbosityfullswitched:=true;
|
||||
include(pendingstate.flags,psf_verbosity_full_switched);
|
||||
end;
|
||||
|
||||
procedure recordpendingcallingswitch(const str: shortstring);
|
||||
@ -360,21 +360,21 @@ procedure flushpendingswitchesstate;
|
||||
fstate, pstate : pmessagestaterecord;
|
||||
begin
|
||||
{ process pending localswitches (range checking, etc) }
|
||||
if pendingstate.localswitcheschanged then
|
||||
if psf_local_switches_changed in pendingstate.flags then
|
||||
begin
|
||||
current_settings.localswitches:=pendingstate.nextlocalswitches;
|
||||
pendingstate.localswitcheschanged:=false;
|
||||
exclude(pendingstate.flags,psf_local_switches_changed);
|
||||
end;
|
||||
{ process pending verbosity changes (warnings on, etc) }
|
||||
if pendingstate.verbosityfullswitched then
|
||||
if psf_verbosity_full_switched in pendingstate.flags then
|
||||
begin
|
||||
status.verbosity:=pendingstate.nextverbosityfullswitch;
|
||||
pendingstate.verbosityfullswitched:=false;
|
||||
exclude(pendingstate.flags,psf_verbosity_full_switched);
|
||||
end;
|
||||
if pendingstate.alignmentchanged then
|
||||
if psf_alignment_changed in pendingstate.flags then
|
||||
begin
|
||||
current_settings.alignment:=pendingstate.nextalignment;
|
||||
pendingstate.alignmentchanged:=false;
|
||||
exclude(pendingstate.flags,psf_alignment_changed);
|
||||
end;
|
||||
{ process pending verbosity changes (warnings on, etc) }
|
||||
if pendingstate.nextverbositystr<>'' then
|
||||
|
Loading…
Reference in New Issue
Block a user