Explorar el Código

* Use Align function to align fields in record-buffer

git-svn-id: trunk@11164 -
joost hace 17 años
padre
commit
f92e594e56
Se han modificado 1 ficheros con 2 adiciones y 4 borrados
  1. 2 4
      packages/fcl-db/src/base/bufdataset.pas

+ 2 - 4
packages/fcl-db/src/base/bufdataset.pas

@@ -1808,8 +1808,7 @@ var x : longint;
 begin
   FNullmaskSize := 1+((FieldDefs.count-1) div 8);
 {$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
-  if (FNullmaskSize and 3 <> 0) then
-    FNullmaskSize := (FNullmaskSize and not 3)+4;
+  FNullmaskSize:=Align(FNullmaskSize,4);
 {$ENDIF}
   FRecordSize := FNullmaskSize;
   SetLength(FFieldBufPositions,FieldDefs.count);
@@ -1818,8 +1817,7 @@ begin
     FFieldBufPositions[x] := FRecordSize;
     inc(FRecordSize, GetFieldSize(FieldDefs[x]));
 {$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
-  if (FRecordSize and 3 <> 0) then
-    FRecordSize := (FRecordSize and not 3)+4;
+    FRecordSize:=Align(FRecordSize,4);
 {$ENDIF}
     end;
 end;