Browse Source

* patch by Rike: Use reverse_longword instead of manually reversing longword, resolves #39720

florian 3 years ago
parent
commit
a285500d36
2 changed files with 2 additions and 14 deletions
  1. 1 7
      compiler/ncgcon.pas
  2. 1 7
      compiler/ncon.pas

+ 1 - 7
compiler/ncgcon.pas

@@ -461,13 +461,7 @@ implementation
               end
             else
               begin
-                location.value:=aint(swapendian(Pcardinal(value_set)^));
-                location.value:=aint(
-                                   reverse_byte (location.value         and $ff)         or
-                                  (reverse_byte((location.value shr  8) and $ff) shl  8) or
-                                  (reverse_byte((location.value shr 16) and $ff) shl 16) or
-                                  (reverse_byte((location.value shr 24) and $ff) shl 24)
-                                );
+                location.value:=aint(reverse_longword(Pcardinal(value_set)^));
               end;
             if (target_info.endian=endian_big) then
               location.value:=location.value shr (32-resultdef.size*8);

+ 1 - 7
compiler/ncon.pas

@@ -1420,13 +1420,7 @@ implementation
               end
             else
               begin
-                setval:=aint(swapendian(Pcardinal(value_set)^));
-                setval:=aint(
-                                   reverse_byte (setval         and $ff)         or
-                                  (reverse_byte((setval shr  8) and $ff) shl  8) or
-                                  (reverse_byte((setval shr 16) and $ff) shl 16) or
-                                  (reverse_byte((setval shr 24) and $ff) shl 24)
-                                );
+                setval:=aint(reverse_longword(Pcardinal(value_set)^));
               end;
             if (target_info.endian=endian_big) then
               setval:=setval shr (32-resultdef.size*8);