Sfoglia il codice sorgente

* Use specific type for TFPSet elements

git-svn-id: trunk@36710 -
michael 8 anni fa
parent
commit
52cd572cec

+ 2 - 1
rtl/aix/ostypes.inc

@@ -89,7 +89,8 @@ TYPE
    TFlock   = flock;
    pFlock   = ^flock;
 
-   TFDSet    = array[0..wordsinfdset-1] of culong;
+   TFDSetEl = culong; 
+   TFDSet    = array[0..wordsinfdset-1] of TFDSetEl;
    pFDSet    = ^TFDSet;
 
    timezone = record

+ 2 - 1
rtl/beos/ostypes.inc

@@ -220,7 +220,8 @@ TYPE
  TTms= tms;
  pTms= ^tms;
 
- TFDSet    = ARRAY[0..(FD_MAXFDSET div 32)-1] of Cardinal;
+ TFDSetEl  = Cardinal; 
+ TFDSet    = ARRAY[0..(FD_MAXFDSET div 32)-1] of TFDSetEl;
  pFDSet    = ^TFDSet;
 
 {***********************************************************************}

+ 2 - 1
rtl/bsd/ostypes.inc

@@ -227,7 +227,8 @@ TYPE
  TTms= tms;
  pTms= ^tms;
 
- TFDSet    = ARRAY[0..(FD_MAXFDSET div 32)-1] of Cardinal;
+ TFDSetEl  = Cardinal; 
+ TFDSet    = ARRAY[0..(FD_MAXFDSET div 32)-1] of TFDSetEl;
  pFDSet    = ^TFDSet;
 
 {***********************************************************************}

+ 2 - 1
rtl/haiku/ostypes.inc

@@ -196,7 +196,8 @@ TYPE
  TTms= tms;
  pTms= ^tms;
 
- TFDSet    = ARRAY[0..(FD_MAXFDSET div 32)-1] of Cardinal;
+ TFDSetEl  = Cardinal;
+ TFDSet    = ARRAY[0..(FD_MAXFDSET div 32)-1] of TFDSetEl;
  pFDSet    = ^TFDSet;
 
 {***********************************************************************}

+ 3 - 2
rtl/linux/ostypes.inc

@@ -200,8 +200,9 @@ type
    TTms      = tms;
    PTms      = ^tms;
 
- TFDSet    = ARRAY[0..(FD_MAXFDSET div BITSINWORD)-1] of cuLong;
- pFDSet    = ^TFDSet;
+  TFDSetEl  = cuLong;
+  TFDSet    = ARRAY[0..(FD_MAXFDSET div BITSINWORD)-1] of TFDSetEl;
+  pFDSet    = ^TFDSet;
 
   timezone = record
     tz_minuteswest,tz_dsttime:cint;

+ 2 - 1
rtl/solaris/ostypes.inc

@@ -90,7 +90,8 @@ TYPE
    TFlock   = flock;
    pFlock   = ^flock;
 
-   TFDSet    = array[0..(FD_MAXFDSET div 32)-1] of Cardinal;
+   TFDSetEl  = Cardinal;
+   TFDSet    = array[0..(FD_MAXFDSET div 32)-1] of TFDSetEl;
    pFDSet    = ^TFDSet;
 
    timezone = packed record

+ 6 - 5
rtl/unix/genfdset.inc

@@ -19,7 +19,7 @@ function fpFD_SET(fdno:cint;var nset : TFDSet): cint;
 Begin
    if (fdno<0) or (fdno > FD_MAXFDSET) Then
        exit(-1);
-   nset[fdno shr ln2bitsinword]:=nset[(fdno) shr ln2bitsinword] OR (culong(1) shl ((fdno) and ln2bitmask));
+   nset[fdno shr ln2bitsinword]:=nset[(fdno) shr ln2bitsinword] OR (TFDSetEl(1) shl ((fdno) and ln2bitmask));
    fpFD_SET:=0;
 End;
 
@@ -28,7 +28,7 @@ function fpFD_CLR(fdno:cint;var nset : TFDSet): cint;
 Begin
    if (fdno<0) or (fdno >  FD_MAXFDSET) Then
        exit(-1);
-   nset[(fdno) shr ln2bitsinword]:=nset[(fdno) shr ln2bitsinword] AND cuLong(NOT (culong(1) shl ((fdno) and ln2bitmask)));
+   nset[(fdno) shr ln2bitsinword]:=nset[(fdno) shr ln2bitsinword] AND TFDSetEl(NOT (culong(1) shl ((fdno) and ln2bitmask)));
    fpFD_CLR:=0;
 End;
 
@@ -46,7 +46,8 @@ function fpfdfillset(var nset : TFDSet):cint;
 var i :longint;
 
 Begin
-  for i:=0 to wordsinfdset-1 DO nset[i]:=Culong((NOT 0) and ln2bitmask);
+  for i:=0 to wordsinfdset-1 DO 
+    nset[i]:=TFDSetEl(NOT 0);
   fpfdfillset:=0;
 End;
 
@@ -55,9 +56,9 @@ function fpFD_ISSET(fdno:cint;const nset : TFDSet): cint;
 Begin
    if (fdno<0) or (fdno >  FD_MAXFDSET) Then
        exit(-1);
-    if ((nset[fdno shr ln2bitsinword]) and (culong(1) shl ((fdno) and ln2bitmask)))>0 Then
+   if ((nset[fdno shr ln2bitsinword]) and (TFDSetEl(1) shl ((fdno) and ln2bitmask)))>0 Then
      fpFD_ISSET:=1
-    else
+   else
      fpFD_ISSET:=0;
 End;