|
@@ -601,14 +601,12 @@ begin
|
|
result:=0;
|
|
result:=0;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
-{$ifdef FPC_UNALIGNED_FIXED}
|
|
|
|
if bufsize-bufidx>=sizeof(word) then
|
|
if bufsize-bufidx>=sizeof(word) then
|
|
begin
|
|
begin
|
|
result:=Unaligned(pword(@buf[bufidx])^);
|
|
result:=Unaligned(pword(@buf[bufidx])^);
|
|
inc(bufidx,sizeof(word));
|
|
inc(bufidx,sizeof(word));
|
|
end
|
|
end
|
|
else
|
|
else
|
|
-{$endif FPC_UNALIGNED_FIXED}
|
|
|
|
readdata(result,sizeof(word));
|
|
readdata(result,sizeof(word));
|
|
if change_endian then
|
|
if change_endian then
|
|
result:=swapendian(result);
|
|
result:=swapendian(result);
|
|
@@ -624,14 +622,12 @@ begin
|
|
result:=0;
|
|
result:=0;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
-{$ifdef FPC_UNALIGNED_FIXED}
|
|
|
|
if bufsize-bufidx>=sizeof(longint) then
|
|
if bufsize-bufidx>=sizeof(longint) then
|
|
begin
|
|
begin
|
|
result:=Unaligned(plongint(@buf[bufidx])^);
|
|
result:=Unaligned(plongint(@buf[bufidx])^);
|
|
inc(bufidx,sizeof(longint));
|
|
inc(bufidx,sizeof(longint));
|
|
end
|
|
end
|
|
else
|
|
else
|
|
-{$endif FPC_UNALIGNED_FIXED}
|
|
|
|
readdata(result,sizeof(longint));
|
|
readdata(result,sizeof(longint));
|
|
if change_endian then
|
|
if change_endian then
|
|
result:=swapendian(result);
|
|
result:=swapendian(result);
|
|
@@ -647,14 +643,12 @@ begin
|
|
result:=0;
|
|
result:=0;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
-{$ifdef FPC_UNALIGNED_FIXED}
|
|
|
|
if bufsize-bufidx>=sizeof(dword) then
|
|
if bufsize-bufidx>=sizeof(dword) then
|
|
begin
|
|
begin
|
|
result:=Unaligned(plongint(@buf[bufidx])^);
|
|
result:=Unaligned(plongint(@buf[bufidx])^);
|
|
inc(bufidx,sizeof(longint));
|
|
inc(bufidx,sizeof(longint));
|
|
end
|
|
end
|
|
else
|
|
else
|
|
-{$endif FPC_UNALIGNED_FIXED}
|
|
|
|
readdata(result,sizeof(dword));
|
|
readdata(result,sizeof(dword));
|
|
if change_endian then
|
|
if change_endian then
|
|
result:=swapendian(result);
|
|
result:=swapendian(result);
|
|
@@ -670,14 +664,12 @@ begin
|
|
result:=0;
|
|
result:=0;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
-{$ifdef FPC_UNALIGNED_FIXED}
|
|
|
|
if bufsize-bufidx>=sizeof(int64) then
|
|
if bufsize-bufidx>=sizeof(int64) then
|
|
begin
|
|
begin
|
|
result:=Unaligned(pint64(@buf[bufidx])^);
|
|
result:=Unaligned(pint64(@buf[bufidx])^);
|
|
inc(bufidx,sizeof(int64));
|
|
inc(bufidx,sizeof(int64));
|
|
end
|
|
end
|
|
else
|
|
else
|
|
-{$endif FPC_UNALIGNED_FIXED}
|
|
|
|
readdata(result,sizeof(int64));
|
|
readdata(result,sizeof(int64));
|
|
if change_endian then
|
|
if change_endian then
|
|
result:=swapendian(result);
|
|
result:=swapendian(result);
|
|
@@ -693,14 +685,12 @@ begin
|
|
result:=0;
|
|
result:=0;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
-{$ifdef FPC_UNALIGNED_FIXED}
|
|
|
|
if bufsize-bufidx>=sizeof(qword) then
|
|
if bufsize-bufidx>=sizeof(qword) then
|
|
begin
|
|
begin
|
|
result:=Unaligned(pqword(@buf[bufidx])^);
|
|
result:=Unaligned(pqword(@buf[bufidx])^);
|
|
inc(bufidx,sizeof(qword));
|
|
inc(bufidx,sizeof(qword));
|
|
end
|
|
end
|
|
else
|
|
else
|
|
-{$endif FPC_UNALIGNED_FIXED}
|
|
|
|
readdata(result,sizeof(qword));
|
|
readdata(result,sizeof(qword));
|
|
if change_endian then
|
|
if change_endian then
|
|
result:=swapendian(result);
|
|
result:=swapendian(result);
|