Changeset 479


Ignore:
Timestamp:
Jan 27, 2016, 10:35:36 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Used incorrect functions for swaping between big and little endian.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • CoolStreaming/UStreamHelper.pas

    r457 r479  
    114114  Result := 0;
    115115  FStream.ReadBuffer(Result, SizeOf(Cardinal));
    116   if SwapData then Result := Swap(Result);
     116  if SwapData then Result := SwapEndian(Result);
    117117end;
    118118
     
    121121  Result := 0;
    122122  FStream.ReadBuffer(Result, SizeOf(Int64));
    123   if SwapData then Result := Swap(Result);
     123  if SwapData then Result := SwapEndian(Result);
    124124end;
    125125
     
    298298  Result := 0;
    299299  FStream.ReadBuffer(Result, SizeOf(Word));
    300   if SwapData then Result := Swap(Result);
     300  if SwapData then Result := SwapEndian(Result);
    301301end;
    302302
     
    358358procedure TStreamHelper.WriteCardinal(Data: Cardinal);
    359359begin
    360   if SwapData then Data := Swap(Data);
     360  if SwapData then Data := SwapEndian(Data);
    361361  Write(Data, SizeOf(Cardinal));
    362362end;
     
    364364procedure TStreamHelper.WriteInt64(Data: Int64);
    365365begin
    366   if SwapData then Data := Swap(Data);
     366  if SwapData then Data := SwapEndian(Data);
    367367  Write(Data, SizeOf(Int64));
    368368end;
     
    415415procedure TStreamHelper.WriteWord(Data: Word);
    416416begin
    417   if SwapData then Data := Swap(Data);
     417  if SwapData then Data := SwapEndian(Data);
    418418  Write(Data, SizeOf(Word));
    419419end;
Note: See TracChangeset for help on using the changeset viewer.