Browse Source

* fixed generic shortstr_compare

florian 22 years ago
parent
commit
35bb4d682f
3 changed files with 21 additions and 12 deletions
  1. 7 4
      rtl/i386/i386.inc
  2. 6 3
      rtl/inc/compproc.inc
  3. 8 5
      rtl/inc/generic.inc

+ 7 - 4
rtl/i386/i386.inc

@@ -880,14 +880,14 @@ end;
 
 
 {$define FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
-function fpc_shortstr_compare(const dstr,sstr:shortstring): longint; [public,alias:'FPC_SHORTSTR_COMPARE']; {$ifdef hascompilerproc} compilerproc; {$endif}
+function fpc_shortstr_compare(const left,right:shortstring): longint; [public,alias:'FPC_SHORTSTR_COMPARE']; {$ifdef hascompilerproc} compilerproc; {$endif}
 begin
   asm
         cld
         xorl    %ebx,%ebx
         xorl    %eax,%eax
-        movl    sstr,%esi
-        movl    dstr,%edi
+        movl    right,%esi
+        movl    left,%edi
         movb    (%esi),%al
         movb    (%edi),%bl
         movl    %eax,%edx
@@ -1171,7 +1171,10 @@ end;
 
 {
   $Log$
-  Revision 1.41  2003-03-26 00:19:10  peter
+  Revision 1.42  2003-05-16 22:40:11  florian
+    * fixed generic shortstr_compare
+
+  Revision 1.41  2003/03/26 00:19:10  peter
     * ifdef HAS_GENERICCONSTRUCTOR
 
   Revision 1.40  2003/03/17 14:30:11  peter

+ 6 - 3
rtl/inc/compproc.inc

@@ -43,7 +43,7 @@ Procedure fpc_freemem(p:pointer);compilerproc;
 procedure fpc_Shortstr_SetLength(var s:shortstring;len:StrLenInt); compilerproc;
 function fpc_shortstr_to_shortstr(len:longint; const sstr: shortstring): shortstring; compilerproc;
 function fpc_shortstr_concat(const s1,s2:shortstring): shortstring; compilerproc;
-function fpc_shortstr_compare(const dstr,sstr:shortstring) : longint; compilerproc;
+function fpc_shortstr_compare(const left,right:shortstring) : longint; compilerproc;
 
 function fpc_pchar_to_shortstr(p:pchar):shortstring; compilerproc;
 function fpc_pchar_length(p:pchar):longint; compilerproc;
@@ -290,7 +290,10 @@ function fpc_qword_to_double(q: qword): double; compilerproc;
 
 {
   $Log$
-  Revision 1.41  2003-05-13 19:18:08  peter
+  Revision 1.42  2003-05-16 22:40:11  florian
+    * fixed generic shortstr_compare
+
+  Revision 1.41  2003/05/13 19:18:08  peter
     * fpc_help_fail compilerproc
     * fpc_new_class, fpc_dispose_class not needed by latest compiler
 
@@ -386,4 +389,4 @@ function fpc_qword_to_double(q: qword): double; compilerproc;
   Revision 1.13  2002/01/21 20:16:08  peter
     * updated for dynarr:=nil
 
-}
+}

+ 8 - 5
rtl/inc/generic.inc

@@ -580,20 +580,20 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
 
-function fpc_shortstr_compare(const dstr,sstr:shortstring) : longint;[public,alias:'FPC_SHORTSTR_COMPARE']; {$ifdef hascompilerproc} compilerproc; {$endif}
+function fpc_shortstr_compare(const left,right:shortstring) : longint;[public,alias:'FPC_SHORTSTR_COMPARE']; {$ifdef hascompilerproc} compilerproc; {$endif}
 var
    s1,s2,max,i : byte;
    d : longint;
 begin
-  s1:=length(dstr);
-  s2:=length(sstr);
+  s1:=length(left);
+  s2:=length(right);
   if s1<s2 then
     max:=s1
   else
     max:=s2;
   for i:=1 to max do
     begin
-     d:=byte(sstr[i])-byte(dstr[i]);
+     d:=byte(left[i])-byte(right[i]);
      if d>0 then
        exit(1)
      else if d<0 then
@@ -965,7 +965,10 @@ end;
 
 {
   $Log$
-  Revision 1.56  2003-05-13 20:52:50  peter
+  Revision 1.57  2003-05-16 22:40:11  florian
+    * fixed generic shortstr_compare
+
+  Revision 1.56  2003/05/13 20:52:50  peter
     * extra check for self and empty objects
 
   Revision 1.55  2003/05/13 19:18:08  peter