mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 06:00:35 +03:00
phobos 0.149
This commit is contained in:
parent
110cfd9da7
commit
d6ac036aff
24 changed files with 163 additions and 42 deletions
|
@ -55,8 +55,8 @@ struct GCBits
|
|||
}
|
||||
body
|
||||
{
|
||||
return (cast(bit *)(data + 1))[i];
|
||||
//return data[1 + (i >> BITS_SHIFT)] & (1 << (i & BITS_MASK));
|
||||
//return (cast(bit *)(data + 1))[i];
|
||||
return data[1 + (i >> BITS_SHIFT)] & (1 << (i & BITS_MASK));
|
||||
}
|
||||
|
||||
void set(uint i)
|
||||
|
@ -66,8 +66,8 @@ struct GCBits
|
|||
}
|
||||
body
|
||||
{
|
||||
(cast(bit *)(data + 1))[i] = 1;
|
||||
//data[1 + (i >> BITS_SHIFT)] |= (1 << (i & BITS_MASK));
|
||||
//(cast(bit *)(data + 1))[i] = 1;
|
||||
data[1 + (i >> BITS_SHIFT)] |= (1 << (i & BITS_MASK));
|
||||
}
|
||||
|
||||
void clear(uint i)
|
||||
|
@ -77,8 +77,8 @@ struct GCBits
|
|||
}
|
||||
body
|
||||
{
|
||||
(cast(bit *)(data + 1))[i] = 0;
|
||||
//data[1 + (i >> BITS_SHIFT)] &= ~(1 << (i & BITS_MASK));
|
||||
//(cast(bit *)(data + 1))[i] = 0;
|
||||
data[1 + (i >> BITS_SHIFT)] &= ~(1 << (i & BITS_MASK));
|
||||
}
|
||||
|
||||
uint testClear(uint i)
|
||||
|
@ -102,13 +102,13 @@ struct GCBits
|
|||
else
|
||||
{ uint result;
|
||||
|
||||
result = (cast(bit *)(data + 1))[i];
|
||||
(cast(bit *)(data + 1))[i] = 0;
|
||||
//result = (cast(bit *)(data + 1))[i];
|
||||
//(cast(bit *)(data + 1))[i] = 0;
|
||||
|
||||
//uint *p = &data[1 + (i >> BITS_SHIFT)];
|
||||
//uint mask = (1 << (i & BITS_MASK));
|
||||
//result = *p & mask;
|
||||
//*p &= ~mask;
|
||||
uint *p = &data[1 + (i >> BITS_SHIFT)];
|
||||
uint mask = (1 << (i & BITS_MASK));
|
||||
result = *p & mask;
|
||||
*p &= ~mask;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* This module is implicitly imported.
|
||||
* Macros:
|
||||
* WIKI = Object
|
||||
* WIKI = Phobos/Object
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -103,7 +103,7 @@ SRC_STD= std/zlib.d std/zip.d std/stdint.d std/conv.d std/utf.d std/uri.d \
|
|||
std/boxer.d std/cstream.d std/demangle.d std/cover.d std/bitarray.d
|
||||
|
||||
SRC_STD_C= std/c/process.d std/c/stdlib.d std/c/time.d std/c/stdio.d \
|
||||
std/c/math.d std/c/stdarg.d std/c/stddef.d
|
||||
std/c/math.d std/c/stdarg.d std/c/stddef.d std/c/fenv.d
|
||||
|
||||
SRC_TI= \
|
||||
std/typeinfo/ti_wchar.d std/typeinfo/ti_uint.d \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Encodes/decodes MIME base64 data.
|
||||
*
|
||||
* Macros:
|
||||
* WIKI=StdBase64
|
||||
* WIKI=Phobos/StdBase64
|
||||
* References:
|
||||
* <a href="http://en.wikipedia.org/wiki/Base64">Wikipedia Base64</a>$(BR)
|
||||
* <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>$(BR)
|
||||
|
|
112
std/c/fenv.d
Normal file
112
std/c/fenv.d
Normal file
|
@ -0,0 +1,112 @@
|
|||
|
||||
/**
|
||||
* C's <fenv.h>
|
||||
* Authors: Walter Bright, Digital Mars, www.digitalmars.com
|
||||
* License: Public Domain
|
||||
* Macros:
|
||||
* WIKI=Phobos/StdCFenv
|
||||
*/
|
||||
|
||||
module std.c.fenv;
|
||||
|
||||
extern (C):
|
||||
|
||||
/// Entire floating point environment
|
||||
|
||||
struct fenv_t
|
||||
{
|
||||
version (Windows)
|
||||
{
|
||||
ushort status;
|
||||
ushort control;
|
||||
ushort round;
|
||||
ushort reserved[2];
|
||||
}
|
||||
else version (linux)
|
||||
{
|
||||
ushort __control_word;
|
||||
ushort __unused1;
|
||||
ushort __status_word;
|
||||
ushort __unused2;
|
||||
ushort __tags;
|
||||
ushort __unused3;
|
||||
uint __eip;
|
||||
ushort __cs_selector;
|
||||
ushort __opcode;
|
||||
uint __data_offset;
|
||||
ushort __data_selector;
|
||||
ushort __unused5;
|
||||
}
|
||||
else
|
||||
{
|
||||
static assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
alias int fexcept_t; /// Floating point status flags
|
||||
|
||||
/// The various floating point exceptions
|
||||
enum
|
||||
{
|
||||
FE_INVALID = 1,
|
||||
FE_DENORMAL = 2,
|
||||
FE_DIVBYZERO = 4,
|
||||
FE_OVERFLOW = 8,
|
||||
FE_UNDERFLOW = 0x10,
|
||||
FE_INEXACT = 0x20,
|
||||
FE_ALL_EXCEPT = 0x3F, /// Mask of all the exceptions
|
||||
}
|
||||
|
||||
/// Rounding modes
|
||||
enum
|
||||
{
|
||||
FE_TONEAREST = 0,
|
||||
FE_UPWARD = 0x800,
|
||||
FE_DOWNWARD = 0x400,
|
||||
FE_TOWARDZERO = 0xC00,
|
||||
}
|
||||
|
||||
version (Windows)
|
||||
{
|
||||
extern fenv_t _FE_DFL_ENV;
|
||||
|
||||
/// Default floating point environment
|
||||
fenv_t* FE_DFL_ENV = &_FE_DFL_ENV;
|
||||
}
|
||||
else version (linux
|
||||
{
|
||||
/// Default floating point environment
|
||||
fenv_t* FE_DFL_ENV = cast(fenv_t*)(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
static assert(0);
|
||||
}
|
||||
|
||||
/// Floating point precision
|
||||
enum
|
||||
{
|
||||
FE_FLTPREC = 0,
|
||||
FE_DBLPREC = 0x200,
|
||||
FE_LDBLPREC = 0x300,
|
||||
}
|
||||
|
||||
int fetestexcept(int excepts);
|
||||
int feraiseexcept(int excepts);
|
||||
int feclearexcept(int excepts);
|
||||
//int fegetexcept(fexcept_t *flagp,int excepts);
|
||||
//int fesetexcept(fexcept_t *flagp,int excepts);
|
||||
int fegetround();
|
||||
int fesetround(int round);
|
||||
int fegetprec();
|
||||
int fesetprec(int prec);
|
||||
int fegetenv(fenv_t *envp);
|
||||
int fesetenv(fenv_t *envp);
|
||||
//void feprocentry(fenv_t *envp);
|
||||
//void feprocexit(const fenv_t *envp);
|
||||
|
||||
int fegetexceptflag(fexcept_t *flagp,int excepts);
|
||||
int fesetexceptflag(fexcept_t *flagp,int excepts);
|
||||
int feholdexcept(fenv_t *envp);
|
||||
int feupdateenv(fenv_t *envp);
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/**
|
||||
* Macros:
|
||||
* WIKI = StdCompiler
|
||||
* WIKI = Phobos/StdCompiler
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* $(LI inline asm statements are not counted)
|
||||
* )
|
||||
* Macros:
|
||||
* WIKI = StdCover
|
||||
* WIKI = Phobos/StdCover
|
||||
*/
|
||||
|
||||
module std.cover;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* around a central type, d_time, from which other formats are converted to and
|
||||
* from.
|
||||
* Macros:
|
||||
* WIKI = StdDate
|
||||
* WIKI = Phobos/StdDate
|
||||
*/
|
||||
|
||||
// Copyright (c) 1999-2005 by Digital Mars
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****
|
||||
* Demangle D mangled names.
|
||||
* Macros:
|
||||
* WIKI = StdDemangle
|
||||
* WIKI = Phobos/StdDemangle
|
||||
*/
|
||||
|
||||
/* Author:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Macros:
|
||||
* WIKI = StdFile
|
||||
* WIKI = Phobos/StdFile
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* It's comparable to C99's vsprintf().
|
||||
*
|
||||
* Macros:
|
||||
* WIKI = StdFormat
|
||||
* WIKI = Phobos/StdFormat
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -38,8 +38,6 @@ private import std.utf;
|
|||
private import std.c.stdlib;
|
||||
private import std.string;
|
||||
|
||||
alias bool bit;
|
||||
|
||||
version (Windows)
|
||||
{
|
||||
version (DigitalMars)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* Macros:
|
||||
* WIKI = StdMath
|
||||
* WIKI = Phobos/StdMath
|
||||
*
|
||||
* TABLE_SV = <table border=1 cellpadding=4 cellspacing=0>
|
||||
* <caption>Special Values</caption>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* $(LINK2 http://en.wikipedia.org/wiki/Md5, Wikipedia on MD5)
|
||||
*
|
||||
* Macros:
|
||||
* WIKI = StdMd5
|
||||
* WIKI = Phobos/StdMd5
|
||||
*/
|
||||
|
||||
/++++++++++++++++++++++++++++++++
|
||||
|
@ -55,7 +55,7 @@ void MDFile(char[] filename)
|
|||
else
|
||||
{
|
||||
context.start();
|
||||
while ((len = fread(buffer, 1, buffer.size, file)) != 0)
|
||||
while ((len = fread(buffer, 1, buffer.sizeof, file)) != 0)
|
||||
context.update(buffer[0 .. len]);
|
||||
context.finish(digest);
|
||||
fclose(file);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Boilerplate:
|
||||
* $(std_boilerplate.html)
|
||||
* Macros:
|
||||
* WIKI = StdOutbuffer
|
||||
* WIKI = Phobos/StdOutbuffer
|
||||
* Copyright:
|
||||
* Copyright (c) 2001-2005 by Digital Mars
|
||||
* All Rights Reserved
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/**
|
||||
* Macros:
|
||||
* WIKI = StdPath
|
||||
* WIKI = Phobos/StdPath
|
||||
* Copyright:
|
||||
* Placed into public domain.
|
||||
* www.digitalmars.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Macros:
|
||||
* WIKI = StdRandom
|
||||
* WIKI = Phobos/StdRandom
|
||||
*/
|
||||
|
||||
// random.d
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Macros:
|
||||
* WIKI = StdStream
|
||||
* WIKI = Phobos/StdStream
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* are done, the returned string is a copy.
|
||||
*
|
||||
* Macros:
|
||||
* WIKI = StdString
|
||||
* WIKI = Phobos/StdString
|
||||
* Copyright:
|
||||
* Public Domain
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* $(LINK2 http://www.ietf.org/rfc/rfc3986.txt, RFC 3986)<br>
|
||||
* $(LINK2 http://en.wikipedia.org/wiki/Uniform_resource_identifier, Wikipedia)
|
||||
* Macros:
|
||||
* WIKI = StdUri
|
||||
* WIKI = Phobos/StdUri
|
||||
*/
|
||||
|
||||
module std.uri;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
* $(LINK http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8)<br>
|
||||
* $(LINK http://anubis.dkuug.dk/JTC1/SC2/WG2/docs/n1335)
|
||||
* Macros:
|
||||
* WIKI = StdUtf
|
||||
* WIKI = Phobos/StdUtf
|
||||
*/
|
||||
|
||||
module std.utf;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Support UTF-8 on Windows 95, 98 and ME systems.
|
||||
* Macros:
|
||||
* WIKI = StdWindowsCharset
|
||||
* WIKI = Phobos/StdWindowsCharset
|
||||
*/
|
||||
|
||||
module std.windows.charset;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* )
|
||||
*
|
||||
* Macros:
|
||||
* WIKI = StdZip
|
||||
* WIKI = Phobos/StdZip
|
||||
*/
|
||||
|
||||
module std.zip;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* $(LINK2 http://en.wikipedia.org/wiki/Zlib, Wikipedia)
|
||||
*
|
||||
* Macros:
|
||||
* WIKI = StdZlib
|
||||
* WIKI = Phobos/StdZlib
|
||||
*/
|
||||
|
||||
|
||||
|
|
23
win32.mak
23
win32.mak
|
@ -73,7 +73,7 @@ OBJS= asserterror.obj deh.obj switch.obj complex.obj gcstats.obj \
|
|||
socket.obj socketstream.obj loader.obj stdarg.obj format.obj stdio.obj \
|
||||
perf.obj openrj.obj uni.obj winsock.obj oldsyserror.obj \
|
||||
errno.obj boxer.obj cstream.obj charset.obj \
|
||||
realtest.obj gamma.obj demangle.obj cover.obj \
|
||||
realtest.obj gamma.obj demangle.obj cover.obj bitarray.obj \
|
||||
ti_Aa.obj ti_Ag.obj ti_C.obj ti_int.obj ti_char.obj \
|
||||
ti_wchar.obj ti_uint.obj ti_short.obj ti_ushort.obj \
|
||||
ti_byte.obj ti_ubyte.obj ti_long.obj ti_ulong.obj ti_ptr.obj \
|
||||
|
@ -85,7 +85,9 @@ OBJS= asserterror.obj deh.obj switch.obj complex.obj gcstats.obj \
|
|||
ti_Aint.obj ti_Auint.obj ti_Along.obj ti_Aulong.obj ti_Awchar.obj \
|
||||
ti_Afloat.obj ti_Adouble.obj ti_Areal.obj \
|
||||
ti_Acfloat.obj ti_Acdouble.obj ti_Acreal.obj \
|
||||
ti_dchar.obj ti_Adchar.obj ti_bit.obj ti_Abit.obj ti_void.obj
|
||||
ti_dchar.obj ti_Adchar.obj ti_void.obj
|
||||
|
||||
# ti_bit.obj ti_Abit.obj
|
||||
|
||||
DOCS= $(DOC)\std_path.html $(DOC)\std_math.html $(DOC)\std_outbuffer.html \
|
||||
$(DOC)\std_stream.html $(DOC)\std_string.html $(DOC)\std_base64.html \
|
||||
|
@ -97,6 +99,7 @@ DOCS= $(DOC)\std_path.html $(DOC)\std_math.html $(DOC)\std_outbuffer.html \
|
|||
$(DOC)\std_utf.html \
|
||||
$(DOC)\std_cover.html \
|
||||
$(DOC)\std_regexp.html \
|
||||
$(DOC)\std_bitarray.html \
|
||||
$(DOC)\std_stdio.html \
|
||||
$(DOC)\std_windows_charset.html
|
||||
|
||||
|
@ -111,17 +114,17 @@ SRC_STD= std\zlib.d std\zip.d std\stdint.d std\conv.d std\utf.d std\uri.d \
|
|||
std\regexp.d std\random.d std\stream.d std\process.d std\recls.d \
|
||||
std\socket.d std\socketstream.d std\loader.d std\stdarg.d std\format.d \
|
||||
std\stdio.d std\perf.d std\openrj.d std\uni.d std\boxer.d \
|
||||
std\cstream.d std\demangle.d std\cover.d
|
||||
std\cstream.d std\demangle.d std\cover.d std\bitarray.d
|
||||
|
||||
SRC_STD_C= std\c\process.d std\c\stdlib.d std\c\time.d std\c\stdio.d \
|
||||
std\c\math.d std\c\stdarg.d std\c\stddef.d
|
||||
std\c\math.d std\c\stdarg.d std\c\stddef.d std\c\fenv.d
|
||||
|
||||
SRC_TI= \
|
||||
std\typeinfo\ti_wchar.d std\typeinfo\ti_uint.d \
|
||||
std\typeinfo\ti_short.d std\typeinfo\ti_ushort.d \
|
||||
std\typeinfo\ti_byte.d std\typeinfo\ti_ubyte.d \
|
||||
std\typeinfo\ti_long.d std\typeinfo\ti_ulong.d \
|
||||
std\typeinfo\ti_ptr.d std\typeinfo\ti_bit.d \
|
||||
std\typeinfo\ti_ptr.d \
|
||||
std\typeinfo\ti_float.d std\typeinfo\ti_double.d \
|
||||
std\typeinfo\ti_real.d std\typeinfo\ti_delegate.d \
|
||||
std\typeinfo\ti_creal.d std\typeinfo\ti_ireal.d \
|
||||
|
@ -139,7 +142,9 @@ SRC_TI= \
|
|||
std\typeinfo\ti_Acfloat.d std\typeinfo\ti_Acdouble.d \
|
||||
std\typeinfo\ti_Acreal.d \
|
||||
std\typeinfo\ti_Awchar.d std\typeinfo\ti_dchar.d \
|
||||
std\typeinfo\ti_Abit.d std\typeinfo\ti_void.d
|
||||
std\typeinfo\ti_void.d
|
||||
|
||||
# std\typeinfo\ti_bit.d std\typeinfo\ti_Abit.d
|
||||
|
||||
SRC_INT= \
|
||||
internal\switch.d internal\complex.c internal\critical.c \
|
||||
|
@ -459,6 +464,9 @@ asserterror.obj : std\asserterror.d
|
|||
base64.obj : std\base64.d
|
||||
$(DMD) -c $(DFLAGS) -inline std\base64.d
|
||||
|
||||
bitarray.obj : std\bitarray.d
|
||||
$(DMD) -c $(DFLAGS) -inline std\bitarray.d
|
||||
|
||||
boxer.obj : std\boxer.d
|
||||
$(DMD) -c $(DFLAGS) std\boxer.d
|
||||
|
||||
|
@ -768,6 +776,9 @@ ti_int.obj : std\typeinfo\ti_int.d
|
|||
$(DOC)\std_base64.html : std.ddoc std\base64.d
|
||||
$(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_base64.html std.ddoc std\base64.d
|
||||
|
||||
$(DOC)\std_bitarray.html : std.ddoc std\bitarray.d
|
||||
$(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_bitarray.html std.ddoc std\bitarray.d
|
||||
|
||||
$(DOC)\std_compiler.html : std.ddoc std\compiler.d
|
||||
$(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_compiler.html std.ddoc std\compiler.d
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue