annotate dmd/Port.d @ 191:52188e7e3fb5

Fixed deprecated features, now compiles with DMD2.058 Also changed Array allocation policy: Now doesn't reallocate but malloc's, followed by a memcpy (no free). (this fixes a crash while compiling druntime. Same bug in dmd)
author korDen@korDen-pc
date Sun, 25 Mar 2012 03:11:12 +0400
parents e28b18c23469
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.Port;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 0
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import core.stdc.math;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 struct Port
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 static int isSignallingNan(double r)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 /* A signalling NaN is a NaN with 0 as the most significant bit of
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 * its significand, which is bit 51 of 0..63 for 64 bit doubles.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 return isnan(r) && !(((cast(ubyte*)&r)[6]) & 8);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 static int isSignallingNan(ref real r)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 /* A signalling NaN is a NaN with 0 as the most significant bit of
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 * its significand, which is bit 62 of 0..79 for 80 bit reals.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 return isnan(r) && !(((cast(ubyte*)&r)[7]) & 0x40);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23 }