mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 15:39:24 +01:00 
			
		
		
		
	* first (modified, added a comment) patch by Rika to improve generic Index*, part of #39996
This commit is contained in:
		
							parent
							
								
									5e0eb521c4
								
							
						
					
					
						commit
						c1ec558d0a
					
				@ -358,7 +358,8 @@ begin
 | 
			
		||||
      begin
 | 
			
		||||
        if unaligned(psrc^)=b then
 | 
			
		||||
          begin
 | 
			
		||||
            result:=psrc-pword(@buf);
 | 
			
		||||
            { the result is always >=0 so avoid handling of negative values }
 | 
			
		||||
            result:=PtrUint(pointer(psrc)-pointer(@buf)) div sizeof(word);
 | 
			
		||||
            exit;
 | 
			
		||||
          end;
 | 
			
		||||
        inc(psrc);
 | 
			
		||||
@ -369,7 +370,8 @@ begin
 | 
			
		||||
      begin
 | 
			
		||||
        if psrc^=b then
 | 
			
		||||
          begin
 | 
			
		||||
            result:=psrc-pword(@buf);
 | 
			
		||||
            { the result is always >=0 so avoid handling of negative values }
 | 
			
		||||
            result:=PtrUint(pointer(psrc)-pointer(@buf)) div sizeof(word);
 | 
			
		||||
            exit;
 | 
			
		||||
          end;
 | 
			
		||||
        inc(psrc);
 | 
			
		||||
@ -399,7 +401,8 @@ begin
 | 
			
		||||
      begin
 | 
			
		||||
        if unaligned(psrc^)=b then
 | 
			
		||||
          begin
 | 
			
		||||
            result:=psrc-pdword(@buf);
 | 
			
		||||
            { the result is always >=0 so avoid handling of negative values }
 | 
			
		||||
            result:=PtrUint(pointer(psrc)-pointer(@buf)) div sizeof(DWord);
 | 
			
		||||
            exit;
 | 
			
		||||
          end;
 | 
			
		||||
        inc(psrc);
 | 
			
		||||
@ -410,7 +413,8 @@ begin
 | 
			
		||||
      begin
 | 
			
		||||
        if psrc^=b then
 | 
			
		||||
          begin
 | 
			
		||||
            result:=psrc-pdword(@buf);
 | 
			
		||||
            { the result is always >=0 so avoid handling of negative values }
 | 
			
		||||
            result:=PtrUint(pointer(psrc)-pointer(@buf)) div sizeof(DWord);
 | 
			
		||||
            exit;
 | 
			
		||||
          end;
 | 
			
		||||
        inc(psrc);
 | 
			
		||||
@ -440,7 +444,8 @@ begin
 | 
			
		||||
      begin
 | 
			
		||||
        if unaligned(psrc^)=b then
 | 
			
		||||
          begin
 | 
			
		||||
            result:=psrc-pqword(@buf);
 | 
			
		||||
            { the result is always >=0 so avoid handling of negative values }
 | 
			
		||||
            result:=PtrUint(pointer(psrc)-pointer(@buf)) div sizeof(QWord);
 | 
			
		||||
            exit;
 | 
			
		||||
          end;
 | 
			
		||||
        inc(psrc);
 | 
			
		||||
@ -451,7 +456,8 @@ begin
 | 
			
		||||
      begin
 | 
			
		||||
        if psrc^=b then
 | 
			
		||||
          begin
 | 
			
		||||
            result:=psrc-pqword(@buf);
 | 
			
		||||
            { the result is always >=0 so avoid handling of negative values }
 | 
			
		||||
            result:=PtrUint(pointer(psrc)-pointer(@buf)) div sizeof(QWord);
 | 
			
		||||
            exit;
 | 
			
		||||
          end;
 | 
			
		||||
        inc(psrc);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user