merges from fixes branch

This commit is contained in:
pierre 2000-11-13 17:37:41 +00:00
parent 424d409e9f
commit 53b0ce0780
15 changed files with 219 additions and 211 deletions

View File

@ -1,5 +1,5 @@
# #
# Makefile generated by fpcmake v1.00 [2000/10/27] # Makefile generated by fpcmake v1.00 [2000/10/25]
# #
defaultrule: all defaultrule: all
@ -227,11 +227,11 @@ GDBINT=gdbint
endif endif
ifeq ($(GDB),1) ifeq ($(GDB),1)
GDBLIBDIR+=$(PACKAGESDIR)/$(GDBINT)/libgdb/$(OS_TARGET) override GDBLIBDIR+=$(PACKAGESDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
GDBOBJDIR+=$(PACKAGESDIR)/$(GDBINT)/libgdb/$(OS_TARGET) override GDBOBJDIR+=$(PACKAGESDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
ifeq ($(OS_TARGET),go32v2) ifeq ($(OS_TARGET),go32v2)
ifneq ($(DJDIR),) ifneq ($(DJDIR),)
GDBLIBDIR+=$(DJDIR)/lib override GDBLIBDIR+=$(DJDIR)/lib
endif endif
endif endif
ifeq ($(strip $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))),) ifeq ($(strip $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))),)
@ -1250,7 +1250,7 @@ else
$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR) $(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
ifdef USETAR ifdef USETAR
$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) $(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
cd $(PACKDIR) ; $(TARPROG) cf$(TAROPT) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR) cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
else else
$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) $(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT)
cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR) cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)

View File

@ -36,11 +36,11 @@ GDBINT=gdbint
endif endif
ifeq ($(GDB),1) ifeq ($(GDB),1)
GDBLIBDIR+=$(PACKAGESDIR)/$(GDBINT)/libgdb/$(OS_TARGET) override GDBLIBDIR+=$(PACKAGESDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
GDBOBJDIR+=$(PACKAGESDIR)/$(GDBINT)/libgdb/$(OS_TARGET) override GDBOBJDIR+=$(PACKAGESDIR)/$(GDBINT)/libgdb/$(OS_TARGET)
ifeq ($(OS_TARGET),go32v2) ifeq ($(OS_TARGET),go32v2)
ifneq ($(DJDIR),) ifneq ($(DJDIR),)
GDBLIBDIR+=$(DJDIR)/lib override GDBLIBDIR+=$(DJDIR)/lib
endif endif
endif endif
ifeq ($(strip $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))),) ifeq ($(strip $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))),)
@ -69,7 +69,7 @@ endif
[rules] [rules]
.PHONY: gdb full fullgdb clean_compiler clean .PHONY: gdb full fullgdb clean_compiler clean testgdb postgdbinfo
clean: fpc_cleanall clean: fpc_cleanall
@ -90,6 +90,8 @@ endif
postgdbinfo: postgdbinfo:
ifeq ($(GDBFOUND),0) ifeq ($(GDBFOUND),0)
$(ECHO) LibGDB was not found, IDE has no Debugger support $(ECHO) LibGDB was not found, IDE has no Debugger support
else
$(ECHO) LibGDB found in $(LIBGDB)
endif endif
gdb: gdb:
@ -124,4 +126,4 @@ install: fpc_install
# Misc # Misc
# #
clean_compiler: clean_compiler:
$(MAKE) -C ../../compiler clean $(MAKE) -C ../../compiler clean

View File

@ -30,6 +30,9 @@ uses
{$ifdef go32v2} {$ifdef go32v2}
dpmiexcp, dpmiexcp,
{$endif go32v2} {$endif go32v2}
{$ifdef fpc}
video,
{$endif fpc}
Dos,Objects, Dos,Objects,
BrowCol, BrowCol,
Drivers,Views,App,Dialogs,ColorSel,Menus,StdDlg,Validate, Drivers,Views,App,Dialogs,ColorSel,Menus,StdDlg,Validate,
@ -101,6 +104,11 @@ begin
UseMouse:=false; UseMouse:=false;
ButtonCount:=0; ButtonCount:=0;
end; end;
{$ifdef fpc}
'F' :
if Length(Param)=1 then
NoExtendedFrame:=true;
{$endif fpc}
end; end;
end end
else else
@ -268,9 +276,18 @@ BEGIN
END. END.
{ {
$Log$ $Log$
Revision 1.3 2000-10-01 22:44:18 pierre Revision 1.4 2000-11-13 17:37:41 pierre
merges from fixes branch
Revision 1.1.2.4 2000/11/09 08:53:35 pierre
+ -F option to force use of only one graphic set
Revision 1.3 2000/10/01 22:44:18 pierre
* remove lineinfo in _USES * remove lineinfo in _USES
Revision 1.1.2.3 2000/09/27 22:32:26 pierre
* suppress lineinfo explicit in _uses
Revision 1.2 2000/08/22 09:41:39 pierre Revision 1.2 2000/08/22 09:41:39 pierre
* first big merge from fixes branch * first big merge from fixes branch
@ -476,4 +493,4 @@ END.
+ Added symbol browser + Added symbol browser
* splitted fp.pas to fpide.pas * splitted fp.pas to fpide.pas
} }

View File

@ -96,7 +96,7 @@ procedure RegisterFPCalc;
implementation implementation
uses FPString,FPUtils,FPConst; uses FPString,FPUtils,FPConst,WUtils;
const const
cmCalcButton = 100; cmCalcButton = 100;
@ -463,7 +463,13 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-11-13 17:37:41 pierre
merges from fixes branch
Revision 1.1.2.1 2000/11/13 16:59:08 pierre
* some function in double removed from fputils unit
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.10 2000/05/02 08:42:26 pierre Revision 1.10 2000/05/02 08:42:26 pierre

View File

@ -95,6 +95,7 @@ type
const const
CompilerMessageWindow : PCompilerMessageWindow = nil; CompilerMessageWindow : PCompilerMessageWindow = nil;
CompilerStatusDialog : PCompilerStatusDialog = nil; CompilerStatusDialog : PCompilerStatusDialog = nil;
CompileStamp : longint = 0;
procedure DoCompile(Mode: TCompileMode); procedure DoCompile(Mode: TCompileMode);
function NeedRecompile(verbose : boolean): boolean; function NeedRecompile(verbose : boolean): boolean;
@ -615,6 +616,8 @@ begin
f:=new(PFPInputFile, Init(W^.Editor)) f:=new(PFPInputFile, Init(W^.Editor))
else else
f:={$ifndef GABOR}def_openinputfile(filename){$else}nil{$endif}; f:={$ifndef GABOR}def_openinputfile(filename){$else}nil{$endif};
if assigned(W) then
W^.Editor^.CompileStamp:=CompileStamp;
CompilerOpenInputFile:=f; CompilerOpenInputFile:=f;
end; end;
@ -805,6 +808,7 @@ begin
JmpRet:=SetJmp(StopJmp); JmpRet:=SetJmp(StopJmp);
if JmpRet=0 then if JmpRet=0 then
begin begin
inc(CompileStamp);
FpIntF.Compile(FileName,SwitchesPath); FpIntF.Compile(FileName,SwitchesPath);
SetStatus('Finished compiling...'); SetStatus('Finished compiling...');
end end
@ -964,6 +968,7 @@ var Need: boolean;
I: sw_integer; I: sw_integer;
SF: PSourceFile; SF: PSourceFile;
SourceTime,PPUTime,ObjTime: longint; SourceTime,PPUTime,ObjTime: longint;
W: PSourceWindow;
begin begin
if Assigned(SourceFiles)=false then if Assigned(SourceFiles)=false then
Need:={(EditorModified=true)}true Need:={(EditorModified=true)}true
@ -992,10 +997,12 @@ begin
writeln('O: ',SF^.GetObjFileName,' - ',ObjTime); writeln('O: ',SF^.GetObjFileName,' - ',ObjTime);
writeln('------');} writeln('------');}
{ some units don't generate object files } { some units don't generate object files }
W:=EditorWindowFile(SF^.GetSourceFileName);
if (SourceTime<>-1) then if (SourceTime<>-1) then
if (SourceTime>PPUTime) or if ((SourceTime>PPUTime) or
((SourceTime>ObjTime) and ((SourceTime>ObjTime) and
(ObjTime<>-1)) then (ObjTime<>-1))) or
(assigned(W) and (W^.Editor^.CompileStamp<0)) then
begin begin
Need:=true; Need:=true;
if verbose then if verbose then
@ -1098,7 +1105,13 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.5 2000-10-31 22:35:54 pierre Revision 1.6 2000-11-13 17:37:41 pierre
merges from fixes branch
Revision 1.1.2.9 2000/11/06 16:55:48 pierre
* fix failure to recompile when file changed
Revision 1.5 2000/10/31 22:35:54 pierre
* New big merge from fixes branch * New big merge from fixes branch
Revision 1.1.2.8 2000/10/31 07:51:58 pierre Revision 1.1.2.8 2000/10/31 07:51:58 pierre
@ -1431,4 +1444,4 @@ end.
+ options are now written/read + options are now written/read
+ find and replace routines + find and replace routines
} }

View File

@ -458,7 +458,7 @@ const
{$ifdef TP} {$ifdef TP}
function HexStr(Value: longint; Len: byte): string; function HexStr(Value: longint; Len: byte): string;
begin begin
HexStr:=IntToHexL(Value,Len); HexStr:=IntToHex(Value,Len);
end; end;
{$endif} {$endif}
@ -3374,7 +3374,13 @@ end.
{ {
$Log$ $Log$
Revision 1.4 2000-10-31 22:35:54 pierre Revision 1.5 2000-11-13 17:37:41 pierre
merges from fixes branch
Revision 1.1.2.8 2000/11/13 16:59:08 pierre
* some function in double removed from fputils unit
Revision 1.4 2000/10/31 22:35:54 pierre
* New big merge from fixes branch * New big merge from fixes branch
Revision 1.1.2.7 2000/10/31 07:47:54 pierre Revision 1.1.2.7 2000/10/31 07:47:54 pierre
@ -3699,4 +3705,4 @@ end.
Revision 1.1 1999/01/22 10:24:03 peter Revision 1.1 1999/01/22 10:24:03 peter
* first debugger things * first debugger things
} }

View File

@ -151,7 +151,7 @@ begin
C:=''; C:='';
for I:=1 to length(S) do for I:=1 to length(S) do
begin begin
C:=C+'#$'+IntToHexL(ord(S[I]),2); C:=C+'#$'+IntToHex(ord(S[I]),2);
end; end;
PaletteToStr:=C; PaletteToStr:=C;
end; end;
@ -578,7 +578,13 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.5 2000-10-31 22:35:54 pierre Revision 1.6 2000-11-13 17:37:42 pierre
merges from fixes branch
Revision 1.1.2.5 2000/11/13 16:59:09 pierre
* some function in double removed from fputils unit
Revision 1.5 2000/10/31 22:35:54 pierre
* New big merge from fixes branch * New big merge from fixes branch
Revision 1.4 2000/10/06 23:00:13 pierre Revision 1.4 2000/10/06 23:00:13 pierre
@ -764,4 +770,4 @@ end.
+ Switches updated + Switches updated
+ Run program + Run program
} }

View File

@ -35,7 +35,7 @@ uses
FPDebug, FPDebug,
{$endif NODEBUG} {$endif NODEBUG}
FPRedir,FPVars, FPRedir,FPVars,
FPUtils,FPSwitch; FPUtils,FPSwitch,WUtils;
{**************************************************************************** {****************************************************************************
Run Run
@ -212,7 +212,13 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:35 michael Revision 1.2 2000-11-13 17:37:42 pierre
merges from fixes branch
Revision 1.1.2.1 2000/11/13 16:59:09 pierre
* some function in double removed from fputils unit
Revision 1.1 2000/07/13 09:48:35 michael
+ Initial import + Initial import
Revision 1.12 2000/06/22 09:07:12 pierre Revision 1.12 2000/06/22 09:07:12 pierre
@ -269,4 +275,4 @@ end.
+ options are now written/read + options are now written/read
+ find and replace routines + find and replace routines
} }

View File

@ -153,7 +153,8 @@ var
s : string; s : string;
p,lineNb,GrepOutputLine : longint; p,lineNb,GrepOutputLine : longint;
error : word; error : word;
showmsg,error_in_reading : boolean; PosText : longint;
showmsg,error_in_reading,FirstMsg : boolean;
ToFocus : sw_integer; ToFocus : sw_integer;
searchword, searchword,
GrepExe,GrepArgs,Line,ModuleName : String; GrepExe,GrepArgs,Line,ModuleName : String;
@ -222,6 +223,13 @@ begin
if SearchWord<>'' then if SearchWord<>'' then
begin begin
GrepArgs:=IL2^.Data^; GrepArgs:=IL2^.Data^;
{ Remember last used Grep extensions }
PosText:=pos('"$TEXT" ',GrepArgs);
if PosText>0 then
HighlightExts:=Trim(Copy(GrepArgs,PosText+Length('"$TEXT" '),Length(GrepArgs)));
{ change spaces back into ';' again }
ReplaceStr(HighlightExts,' ',';');
{ Replace search string }
ReplaceStr(GrepArgs,'$TEXT',SearchWord); ReplaceStr(GrepArgs,'$TEXT',SearchWord);
{ Linux ? } { Linux ? }
AddToolCommand(GrepExe+' -n '+GrepArgs); AddToolCommand(GrepExe+' -n '+GrepArgs);
@ -250,6 +258,7 @@ begin
Assign(GrepOut,GrepOutName); Assign(GrepOut,GrepOutName);
Reset(GrepOut); Reset(GrepOut);
error_in_reading:=false; error_in_reading:=false;
FirstMsg:=True;
GrepOutputLine:=0; GrepOutputLine:=0;
While not eof(GrepOut) do While not eof(GrepOut) do
begin begin
@ -263,7 +272,14 @@ begin
p:=pos(':',Line); p:=pos(':',Line);
val(copy(Line,1,p-1),lineNb,error); val(copy(Line,1,p-1),lineNb,error);
if error=0 then if error=0 then
AddToolMessage(ModuleName,Copy(Line,p+1,255),LineNb,1) begin
AddToolMessage(ModuleName,Copy(Line,p+1,255),LineNb,1);
if FirstMsg then
begin
Inc(ToFocus);
FirstMsg:=false;
end;
end
else else
error_in_reading:=true; error_in_reading:=true;
end; end;
@ -300,7 +316,13 @@ end;
{ {
$Log$ $Log$
Revision 1.2 2000-08-22 09:41:40 pierre Revision 1.3 2000-11-13 17:37:42 pierre
merges from fixes branch
Revision 1.1.2.2 2000/11/13 16:57:04 pierre
* some grep improovements
Revision 1.2 2000/08/22 09:41:40 pierre
* first big merge from fixes branch * first big merge from fixes branch
Revision 1.1.2.1 2000/07/20 11:02:15 michael Revision 1.1.2.1 2000/07/20 11:02:15 michael
@ -423,4 +445,4 @@ end;
+ options are now written/read + options are now written/read
+ find and replace routines + find and replace routines
} }

View File

@ -961,7 +961,7 @@ function AddrStr(Addr: longint): string;
type TLongint = record LoW,HiW: word; end; type TLongint = record LoW,HiW: word; end;
begin begin
with TLongint(Addr) do with TLongint(Addr) do
AddrStr:='$'+IntToHexL(HiW,4)+IntToHexL(HiW,4); AddrStr:='$'+IntToHex(HiW,4)+IntToHex(HiW,4);
end; end;
begin begin
ClearFormatParams; ClearFormatParams;
@ -1695,7 +1695,13 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.2 2000-10-31 22:35:55 pierre Revision 1.3 2000-11-13 17:37:42 pierre
merges from fixes branch
Revision 1.1.2.2 2000/11/13 16:59:09 pierre
* some function in double removed from fputils unit
Revision 1.2 2000/10/31 22:35:55 pierre
* New big merge from fixes branch * New big merge from fixes branch
Revision 1.1.2.1 2000/09/27 21:06:11 pierre Revision 1.1.2.1 2000/09/27 21:06:11 pierre
@ -1824,4 +1830,4 @@ END.
Revision 1.0 1999/01/09 11:49:41 gabor Revision 1.0 1999/01/09 11:49:41 gabor
Original implementation Original implementation
} }

View File

@ -34,29 +34,14 @@ const
ppext = '.pp'; ppext = '.pp';
{$endif} {$endif}
function IntToStr(L: longint): string;
function IntToStrZ(L: longint; MinLen: byte): string;
function IntToStrL(L: longint; MinLen: byte): string;
function StrToInt(const S: string): longint;
function IntToHex(L: longint): string;
function IntToHexL(L: longint; MinLen: byte): string;
function HexToInt(S: string): longint;
function SmartPath(Path: string): string; function SmartPath(Path: string): string;
Function FixPath(s:string;allowdot:boolean):string; Function FixPath(s:string;allowdot:boolean):string;
function FixFileName(const s:string):string; function FixFileName(const s:string):string;
function MakeExeName(const fn:string):string; function MakeExeName(const fn:string):string;
function LExpand(const S: string; MinLen: byte): string;
function RExpand(const S: string; MinLen: byte): string;
function Center(const S: string; Len: byte): string; function Center(const S: string; Len: byte): string;
function FitStr(const S: string; Len: byte): string; function FitStr(const S: string; Len: byte): string;
function LTrim(const S: string): string;
function RTrim(const S: string): string;
function Trim(const S: string): string;
function KillTilde(S: string): string; function KillTilde(S: string): string;
function UpcaseStr(const S: string): string;
function LowercaseStr(const S: string): string; function LowercaseStr(const S: string): string;
function Max(A,B: longint): longint;
function Min(A,B: longint): longint;
function DirOf(const S: string): string; function DirOf(const S: string): string;
function ExtOf(const S: string): string; function ExtOf(const S: string): string;
function NameOf(const S: string): string; function NameOf(const S: string): string;
@ -76,9 +61,7 @@ function GetStr(const P: PString): string;
procedure ReplaceStr(var S: string; const What,NewS: string); procedure ReplaceStr(var S: string; const What,NewS: string);
procedure ReplaceStrI(var S: string; What: string; const NewS: string); procedure ReplaceStrI(var S: string; What: string; const NewS: string);
const LastStrToIntResult : integer = 0; const ListSeparator : char = ';';
LastHexToIntResult : integer = 0;
ListSeparator : char = ';';
implementation implementation
@ -93,16 +76,6 @@ begin
IntToStr:=S; IntToStr:=S;
end; end;
function StrToInt(const S: string): longint;
var L: longint;
C: integer;
begin
Val(S,L,C);
if C<>0 then L:=-1;
LastStrToIntResult:=C;
StrToInt:=L;
end;
function IntToStrZ(L: longint; MinLen: byte): string; function IntToStrZ(L: longint; MinLen: byte): string;
var S: string; var S: string;
begin begin
@ -188,24 +161,6 @@ begin
end; end;
function LExpand(const S: string; MinLen: byte): string;
begin
if length(S)<MinLen then
LExpand:=CharStr(' ',MinLen-length(S))+S
else
LExpand:=S;
end;
function RExpand(const S: string; MinLen: byte): string;
begin
if length(S)<MinLen then
RExpand:=S+CharStr(' ',MinLen-length(S))
else
RExpand:=S;
end;
function Center(const S: string; Len: byte): string; function Center(const S: string; Len: byte): string;
begin begin
Center:=LExpand(S+CharStr(' ',Max(0,(Len-length(S)) div 2)),Len); Center:=LExpand(S+CharStr(' ',Max(0,(Len-length(S)) div 2)),Len);
@ -228,18 +183,6 @@ begin
KillTilde:=S; KillTilde:=S;
end; end;
function UpcaseStr(const S: string): string;
var
I: Longint;
begin
for I:=1 to length(S) do
if S[I] in ['a'..'z'] then
UpCaseStr[I]:=chr(ord(S[I])-32)
else
UpCaseStr[I]:=S[I];
UpcaseStr[0]:=S[0];
end;
function LowerCaseStr(const S: string): string; function LowerCaseStr(const S: string): string;
var var
I: Longint; I: Longint;
@ -252,16 +195,6 @@ begin
LowercaseStr[0]:=S[0]; LowercaseStr[0]:=S[0];
end; end;
function Max(A,B: longint): longint;
begin
if A>B then Max:=A else Max:=B;
end;
function Min(A,B: longint): longint;
begin
if A<B then Min:=A else Min:=B;
end;
function DirOf(const S: string): string; function DirOf(const S: string): string;
var D: DirStr; E: ExtStr; N: NameStr; var D: DirStr; E: ExtStr; N: NameStr;
begin begin
@ -309,79 +242,6 @@ begin
else Power:=exp(B*ln(A)); else Power:=exp(B*ln(A));
end; end;
function IntToHex(L: longint): string;
const HexNums : string[16] = '0123456789ABCDEF';
var S: string;
R: real;
function DivF(Mit,Mivel: real): longint;
begin
DivF:=trunc(Mit/Mivel);
end;
function ModF(Mit,Mivel: real): longint;
begin
ModF:=trunc(Mit-DivF(Mit,Mivel)*Mivel);
end;
begin
S:='';
R:=L; if R<0 then begin R:=R+2147483647+2147483647+2; end;
repeat
S:=HexNums[ModF(R,16)+1]+S;
R:=DivF(R,16);
until R=0;
IntToHex:=S;
end;
function HexToInt(S: string): longint;
var L,I: longint;
C: char;
const HexNums: string[16] = '0123456789ABCDEF';
begin
S:=Trim(S); L:=0; I:=1; LastHexToIntResult:=0;
while (I<=length(S)) and (LastHexToIntResult=0) do
begin
C:=Upcase(S[I]);
if C in['0'..'9','A'..'F'] then
begin
L:=L*16+(Pos(C,HexNums)-1);
end else LastHexToIntResult:=I;
Inc(I);
end;
HexToInt:=L;
end;
function IntToHexL(L: longint; MinLen: byte): string;
var S: string;
begin
S:=IntToHex(L);
while length(S)<MinLen do S:='0'+S;
IntToHexL:=S;
end;
function LTrim(const S: string): string;
var
i : longint;
begin
i:=1;
while (i<length(s)) and (s[i]=' ') do
inc(i);
LTrim:=Copy(s,i,High(S));
end;
function RTrim(const S: string): string;
var
i : longint;
begin
i:=length(s);
while (i>0) and (s[i]=' ') do
dec(i);
RTrim:=Copy(s,1,i);
end;
function Trim(const S: string): string;
begin
Trim:=RTrim(LTrim(S));
end;
function MatchesMask(What, Mask: string): boolean; function MatchesMask(What, Mask: string): boolean;
function upper(const s : string) : string; function upper(const s : string) : string;
@ -459,7 +319,8 @@ begin
if What<>'' then if What<>'' then
repeat repeat
P:=Pos(ListSeparator, MaskList); P:=Pos(ListSeparator, MaskList);
if P=0 then P:=length(MaskList)+1; if P=0 then
P:=length(MaskList)+1;
Match:=MatchesMask(What,copy(MaskList,1,P-1)); Match:=MatchesMask(What,copy(MaskList,1,P-1));
Delete(MaskList,1,P); Delete(MaskList,1,P);
until Match or (MaskList=''); until Match or (MaskList='');
@ -632,7 +493,13 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.3 2000-11-03 16:05:38 pierre Revision 1.4 2000-11-13 17:37:42 pierre
merges from fixes branch
Revision 1.1.2.4 2000/11/13 16:59:09 pierre
* some function in double removed from fputils unit
Revision 1.3 2000/11/03 16:05:38 pierre
* (merged) * (merged)
Revision 1.1.2.3 2000/11/03 15:45:57 pierre Revision 1.1.2.3 2000/11/03 15:45:57 pierre
@ -750,4 +617,4 @@ END.
+ options are now written/read + options are now written/read
+ find and replace routines + find and replace routines
} }

View File

@ -127,6 +127,7 @@ type
TSourceEditor = object(TFileEditor) TSourceEditor = object(TFileEditor)
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
PScrollBar; AIndicator: PIndicator;const AFileName: string); PScrollBar; AIndicator: PIndicator;const AFileName: string);
CompileStamp : longint;
{$ifndef EDITORS} {$ifndef EDITORS}
public public
CodeCompleteTip: PFPToolTip; CodeCompleteTip: PFPToolTip;
@ -893,6 +894,7 @@ begin
EC:=SearchCoreForFileName(AFileName); EC:=SearchCoreForFileName(AFileName);
inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,EC,AFileName); inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,EC,AFileName);
SetStoreUndo(true); SetStoreUndo(true);
CompileStamp:=0;
end; end;
function TSourceEditor.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; function TSourceEditor.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
@ -1024,7 +1026,13 @@ procedure TSourceEditor.ModifiedChanged;
begin begin
inherited ModifiedChanged; inherited ModifiedChanged;
if (@Self<>Clipboard) and GetModified then if (@Self<>Clipboard) and GetModified then
EditorModified:=true; begin
{ global flags }
EditorModified:=true;
{ reset compile flags as the file is
not the same as at the compilation anymore }
CompileStamp:=-1;
end;
end; end;
procedure TSourceEditor.InsertOptions; procedure TSourceEditor.InsertOptions;
@ -3564,7 +3572,13 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.3 2000-10-31 22:35:55 pierre Revision 1.4 2000-11-13 17:37:42 pierre
merges from fixes branch
Revision 1.1.2.13 2000/11/06 16:55:48 pierre
* fix failure to recompile when file changed
Revision 1.3 2000/10/31 22:35:55 pierre
* New big merge from fixes branch * New big merge from fixes branch
Revision 1.1.2.12 2000/10/31 07:54:24 pierre Revision 1.1.2.12 2000/10/31 07:54:24 pierre
@ -3965,4 +3979,4 @@ END.
+ options are now written/read + options are now written/read
+ find and replace routines + find and replace routines
} }

View File

@ -919,16 +919,6 @@ begin
ExistsFile:=Exists; ExistsFile:=Exists;
end; end;
function Max(A,B: longint): longint;
begin
if A>B then Max:=A else Max:=B;
end;
function Min(A,B: longint): longint;
begin
if A<B then Min:=A else Min:=B;
end;
function StrToInt(const S: string): longint; function StrToInt(const S: string): longint;
var L: longint; var L: longint;
C: integer; C: integer;
@ -4929,6 +4919,7 @@ begin
S:=''; S:='';
{ If AutoIndent try to align first line to { If AutoIndent try to align first line to
last line before selection } last line before selection }
{ DISABLED created problems PM
if IsFlagSet(efAutoIndent) and (SelStart.Y>0) then if IsFlagSet(efAutoIndent) and (SelStart.Y>0) then
begin begin
i:=SelStart.Y-1; i:=SelStart.Y-1;
@ -4955,7 +4946,7 @@ begin
Ind:=CharStr(' ',indlen); Ind:=CharStr(' ',indlen);
end; end;
end end
else else }
Ind:=' '; Ind:=' ';
for i:=selstart.y to ey do for i:=selstart.y to ey do
begin begin
@ -4989,6 +4980,7 @@ begin
dec(ey); dec(ey);
{ If AutoIndent try to align first line to { If AutoIndent try to align first line to
last line before selection } last line before selection }
{ Disabled created problems
if IsFlagSet(efAutoIndent) and (SelStart.Y>0) then if IsFlagSet(efAutoIndent) and (SelStart.Y>0) then
begin begin
S:=GetDisplayText(SelStart.Y); S:=GetDisplayText(SelStart.Y);
@ -5018,7 +5010,7 @@ begin
indlen:=1; indlen:=1;
end; end;
end end
else else }
Indlen:=1; Indlen:=1;
for i:=selstart.y to ey do for i:=selstart.y to ey do
begin begin
@ -6126,7 +6118,7 @@ end;
function TCustomCodeEditorCore.LoadFromStream(Editor: PCustomCodeEditor; Stream: PStream): boolean; function TCustomCodeEditorCore.LoadFromStream(Editor: PCustomCodeEditor; Stream: PStream): boolean;
var S: string; var S: string;
AllLinesComplete,LineComplete,OK: boolean; AllLinesComplete,LineComplete,hasCR,OK: boolean;
begin begin
DeleteAllLines; DeleteAllLines;
ChangedLine:=-1; ChangedLine:=-1;
@ -6135,15 +6127,20 @@ begin
if eofstream(Stream) then if eofstream(Stream) then
AddLine('') AddLine('')
else else
while OK and (eofstream(Stream)=false) and (GetLineCount<MaxLineCount) do
begin begin
ReadlnFromStream(Stream,S,LineComplete); while OK and (eofstream(Stream)=false) and (GetLineCount<MaxLineCount) do
AllLinesComplete:=AllLinesComplete and LineComplete; begin
OK:=OK and (Stream^.Status=stOK); ReadlnFromStream(Stream,S,LineComplete,hasCR);
if OK then AddLine(S); AllLinesComplete:=AllLinesComplete and LineComplete;
if not LineComplete and (ChangedLine=-1) then OK:=OK and (Stream^.Status=stOK);
ChangedLine:=GetLineCount; if OK then AddLine(S);
end; if not LineComplete and (ChangedLine=-1) then
ChangedLine:=GetLineCount;
end;
{ Do not remove the final newline if it exists PM }
if hasCR then
AddLine('');
end;
LimitsChanged; LimitsChanged;
if not AllLinesComplete then if not AllLinesComplete then
SetModified(true); SetModified(true);
@ -6574,7 +6571,16 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.4 2000-11-03 16:05:38 pierre Revision 1.5 2000-11-13 17:37:42 pierre
merges from fixes branch
Revision 1.1.2.15 2000/11/13 16:55:09 pierre
* multi space indent disabled
Revision 1.1.2.14 2000/11/06 17:19:58 pierre
* avoid eating of last carriage return
Revision 1.4 2000/11/03 16:05:38 pierre
* (merged) * (merged)
Revision 1.1.2.13 2000/11/03 15:49:26 pierre Revision 1.1.2.13 2000/11/03 15:49:26 pierre
@ -7040,4 +7046,4 @@ END.
+ options are now written/read + options are now written/read
+ find and replace routines + find and replace routines
} }

View File

@ -1308,7 +1308,10 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.3 2000-11-11 23:05:31 hajny Revision 1.4 2000-11-13 17:37:43 pierre
merges from fixes branch
Revision 1.3 2000/11/11 23:05:31 hajny
* OS/2 implementation of GetDosTicks added * OS/2 implementation of GetDosTicks added
Revision 1.2 2000/10/31 22:35:56 pierre Revision 1.2 2000/10/31 22:35:56 pierre
@ -1443,4 +1446,4 @@ END.
+ options are now written/read + options are now written/read
+ find and replace routines + find and replace routines
} }

View File

@ -107,7 +107,7 @@ type
procedure readln(var t:text;var s:string); procedure readln(var t:text;var s:string);
{$endif} {$endif}
procedure ReadlnFromStream(Stream: PStream; var s:string;var linecomplete : boolean); procedure ReadlnFromStream(Stream: PStream; var s:string;var linecomplete,hasCR : boolean);
function eofstream(s: pstream): boolean; function eofstream(s: pstream): boolean;
function Min(A,B: longint): longint; function Min(A,B: longint): longint;
@ -126,6 +126,7 @@ function IntToStr(L: longint): string;
function IntToStrL(L: longint; MinLen: sw_integer): string; function IntToStrL(L: longint; MinLen: sw_integer): string;
function IntToStrZ(L: longint; MinLen: sw_integer): string; function IntToStrZ(L: longint; MinLen: sw_integer): string;
function StrToInt(const S: string): longint; function StrToInt(const S: string): longint;
function HexToInt(S: string): longint;
function IntToHex(L: longint; MinLen: integer): string; function IntToHex(L: longint; MinLen: integer): string;
function GetStr(P: PString): string; function GetStr(P: PString): string;
function GetPChar(P: PChar): string; function GetPChar(P: PChar): string;
@ -172,6 +173,7 @@ procedure StrToMem(S: string; var B);
procedure GiveUpTimeSlice; procedure GiveUpTimeSlice;
const LastStrToIntResult : integer = 0; const LastStrToIntResult : integer = 0;
LastHexToIntResult : integer = 0;
DirSep : char = {$ifdef Linux}'/'{$else}'\'{$endif}; DirSep : char = {$ifdef Linux}'/'{$else}'\'{$endif};
procedure RegisterWUtils; procedure RegisterWUtils;
@ -230,7 +232,7 @@ begin
eofstream:=(s^.getpos>=s^.getsize); eofstream:=(s^.getpos>=s^.getsize);
end; end;
procedure ReadlnFromStream(Stream: PStream; var S:string;var linecomplete : boolean); procedure ReadlnFromStream(Stream: PStream; var S:string;var linecomplete,hasCR : boolean);
var var
c : char; c : char;
i,pos : longint; i,pos : longint;
@ -269,6 +271,8 @@ procedure ReadlnFromStream(Stream: PStream; var S:string;var linecomplete : bool
end; end;
if (c=#10) or eofstream(stream) then if (c=#10) or eofstream(stream) then
linecomplete:=true; linecomplete:=true;
if (c=#10) then
hasCR:=true;
s[0]:=chr(i); s[0]:=chr(i);
end; end;
@ -411,6 +415,25 @@ begin
StrToInt:=L; StrToInt:=L;
end; end;
function HexToInt(S: string): longint;
var L,I: longint;
C: char;
const HexNums: string[16] = '0123456789ABCDEF';
begin
S:=Trim(S); L:=0; I:=1; LastHexToIntResult:=0;
while (I<=length(S)) and (LastHexToIntResult=0) do
begin
C:=Upcase(S[I]);
if C in['0'..'9','A'..'F'] then
begin
L:=L*16+(Pos(C,HexNums)-1);
end else LastHexToIntResult:=I;
Inc(I);
end;
HexToInt:=L;
end;
function IntToHex(L: longint; MinLen: integer): string; function IntToHex(L: longint; MinLen: integer): string;
const HexNums : string[16] = '0123456789ABCDEF'; const HexNums : string[16] = '0123456789ABCDEF';
var S: string; var S: string;
@ -434,7 +457,6 @@ begin
IntToHex:=S; IntToHex:=S;
end; end;
function GetStr(P: PString): string; function GetStr(P: PString): string;
begin begin
if P=nil then GetStr:='' else GetStr:=P^; if P=nil then GetStr:='' else GetStr:=P^;
@ -1161,7 +1183,19 @@ BEGIN
END. END.
{ {
$Log$ $Log$
Revision 1.6 2000-11-04 20:04:33 hajny Revision 1.7 2000-11-13 17:37:44 pierre
merges from fixes branch
Revision 1.1.2.9 2000/11/13 16:59:10 pierre
* some function in double removed from fputils unit
Revision 1.1.2.8 2000/11/12 19:50:36 hajny
* OS/2 changes from the main branch merged
Revision 1.1.2.7 2000/11/06 17:19:58 pierre
* avoid eating of last carriage return
Revision 1.6 2000/11/04 20:04:33 hajny
* wrong DosError was used under OS/2 * wrong DosError was used under OS/2
Revision 1.5 2000/10/31 22:35:56 pierre Revision 1.5 2000/10/31 22:35:56 pierre
@ -1300,4 +1334,4 @@ END.
Revision 1.1 1999/03/01 15:51:43 peter Revision 1.1 1999/03/01 15:51:43 peter
+ Log + Log
} }