Преглед изворни кода

Merged revisions 11277,11283,11296,11298 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r11277 | giulio | 2008-06-25 09:07:54 +0200 (mer, 25 giu 2008) | 4 lines

Patch from Petr Kristan for AnsiStrComp/AnsiStrIComp to fix comparison
when both strings are empty and differ after the null character + test.
........
r11283 | giulio | 2008-06-26 15:43:21 +0200 (gio, 26 giu 2008) | 3 lines

go32v2 graph: fix for seg_bytemove so that it works with oldfpccall and register calling
conventions.
........
r11296 | marco | 2008-06-28 20:16:44 +0200 (sab, 28 giu 2008) | 2 lines

* add psize_t
........
r11298 | giulio | 2008-06-30 13:40:41 +0200 (lun, 30 giu 2008) | 2 lines

Fixed typo (GBD=>GDB)
........

git-svn-id: branches/rc_2_2_2@11300 -

giulio пре 17 година
родитељ
комит
f17fbfee72

+ 1 - 0
.gitattributes

@@ -7568,6 +7568,7 @@ tests/test/units/system/tval4.pp -text
 tests/test/units/system/tval5.pp svneol=native#text/plain
 tests/test/units/system/tvalc.pp -text
 tests/test/units/sysutils/tastrcmp.pp svneol=native#text/plain
+tests/test/units/sysutils/tastrcmp1.pp svneol=native#text/plain
 tests/test/units/sysutils/texec1.pp svneol=native#text/plain
 tests/test/units/sysutils/texec2.pp svneol=native#text/plain
 tests/test/units/sysutils/textractquote.pp svneol=native#text/plain

+ 1 - 1
ide/fp.pas

@@ -349,7 +349,7 @@ BEGIN
   writeln(bullet+' Free Pascal IDE Version '+VersionStr+' ['+{$i %date%}+']');
   writeln(bullet+' Compiler Version '+Full_Version_String);
 {$ifndef NODEBUG}
-  writeln(bullet+' GBD Version '+GDBVersion);
+  writeln(bullet+' GDB Version '+GDBVersion);
  {$ifdef Windows}
    writeln(bullet+' Cygwin "',GetCygwinFullName,'" version ',GetCygwinVersionString);
    CheckCygwinVersion;

+ 6 - 8
packages/graph/src/go32v2/graph.pp

@@ -152,19 +152,17 @@ const
       push es
       push ds
       cld
-      mov ecx,count
-      mov esi,source
-      mov edi,dest
-      mov ax,dseg
-      mov es,ax
-      mov ax,sseg
-      mov ds,ax
+      mov es, dseg
+      mov esi, source
+      mov edi, dest
+      mov ecx, count
+      mov ds,sseg
       rep movsb
       pop ds
       pop es
       pop esi
       pop edi
-    end ['ECX','EAX'];
+    end ['ECX'];
 {$endif tp}
 
  Procedure CallInt10(val_ax : word); assembler;

+ 4 - 4
rtl/objpas/sysutils/sysstr.inc

@@ -307,11 +307,11 @@ begin
       Result:=1;
       exit;
     end;
-  Repeat
+  While (Result=0) and (S1^<>#0) and (S2^<>#0) do begin
     Result:=Ord(S1^)-Ord(S2^); //!! Must be replaced by ansi characters !!
     Inc(S1);
     Inc(S2);
-  Until (Result<>0) or (S1^=#0) or (S2^=#0);
+  end;  
   if (Result=0) and (S1^<>S2^) then // loop ended because exactly one has #0
     if S1^=#0 then // shorter string is smaller
       result:=-1
@@ -335,11 +335,11 @@ begin
     Result:=1;
     exit;
     end;
-  Repeat
+  While (Result=0) and (S1^<>#0) and (S2^<>#0) do begin
     Result:=Ord(LowerCaseTable[Ord(S1[0])])-Ord(LowerCaseTable[Ord(S2[0])]); //!! Must be replaced by ansi characters !!
     Inc(S1);
     Inc(S2);
-  Until (Result<>0) or ((S1[0]=#0) or (S2[0]=#0));
+  end;
   if (Result=0) and (s1[0]<>s2[0]) then //length(s1)<>length(s2)
     if s1[0]=#0 then
       Result:=-1 //s1 shorter than s2

+ 1 - 0
rtl/unix/aliasptp.inc

@@ -43,6 +43,7 @@ type
     size_t   = UnixType.size_t;
     TSize    = UnixType.TSize;
     pSize    = UnixType.pSize;
+    pSize_t  = UnixType.pSize_t;
     ssize_t  = UnixType.ssize_t;
     TsSize   = UnixType.TsSize;
     psSize   = UnixType.psSize;

+ 30 - 0
tests/test/units/sysutils/tastrcmp1.pp

@@ -0,0 +1,30 @@
+program comp;
+uses
+   SysUtils;
+
+var
+  error : boolean;
+
+procedure check(ok : boolean; func : string; value : longint);
+begin
+  if not ok then
+  begin
+    error:=true;
+    writeln(func,' failed, result = ',value);
+  end;
+end;
+
+var
+  a, b: array[0..1] of char;
+  tmp : longint;
+begin
+  error:=false;
+  a[0] := #0; a[1] := #1;      //Empty string
+  b[0] := #0; b[1] := #0;      //Empty string with different char after end
+  tmp:=AnsiStrComp(a, b);      //should be zero because a=b
+  check(tmp=0,'AnsiStrComp',tmp);
+  tmp:=AnsiStrIComp(a, b);     //should be zero because a=b
+  check(tmp=0,'AnsiStrIComp',tmp);
+  if error then
+    halt(1);
+end.