////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Microsoft Corporation.  All rights reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "CorLib.h"

CLR_INT64 s_UTCMask   = ULONGLONGCONSTANT(0x8000000000000000);
CLR_INT64 s_TickMask  = ULONGLONGCONSTANT(0x7FFFFFFFFFFFFFFF);


HRESULT Library_corlib_native_System_DateTime::_ctor___VOID__I4__I4__I4__I4__I4__I4__I4( CLR_RT_StackFrame& stack )
{
    NATIVE_PROFILE_CLR_CORE();
    TINYCLR_HEADER();

    CLR_RT_HeapBlock* pArg = &(stack.Arg1());
    SYSTEMTIME        st;

    TINYCLR_CLEAR(st);
    st.wYear         = pArg[ 0 ].NumericByRef().s4;
    st.wMonth        = pArg[ 1 ].NumericByRef().s4;
    st.wDay          = pArg[ 2 ].NumericByRef().s4;
    st.wHour         = pArg[ 3 ].NumericByRef().s4;
    st.wMinute       = pArg[ 4 ].NumericByRef().s4;
    st.wSecond       = pArg[ 5 ].NumericByRef().s4;
    st.wMilliseconds = pArg[ 6 ].NumericByRef().s4;

    /// Our current supported range is between 1601 and 3000. Years before 1582 requires different calculation (see explanation
    /// in time_decl.h), same way years after 3000 will not hold the simple arithmatic which we are using. More complex calculations
    /// outside these range are not worth the CPU cycle and codesize.
    if ((st.wYear < 1601) || (st.wYear > 3000) ||
Example #2
0
const int16_t    w_base_t::int2_max  = 0x7fff;
const int16_t    w_base_t::int2_min  = (int16_t) 0x8000u;
const uint16_t   w_base_t::uint2_max = 0xffff;
const uint16_t   w_base_t::uint2_min = 0x0;
const int32_t    w_base_t::int4_max  = 0x7fffffff;
const int32_t    w_base_t::int4_min  = 0x80000000;
const uint32_t   w_base_t::uint4_max = 0xffffffff;
const uint32_t   w_base_t::uint4_min = 0x0;

#    define LONGLONGCONSTANT(i) i##LL
#    define ULONGLONGCONSTANT(i) i##ULL

#ifdef ARCH_LP64

const uint64_t   w_base_t::uint8_max =
    ULONGLONGCONSTANT(0xffffffffffffffff);
const uint64_t   w_base_t::uint8_min =
    ULONGLONGCONSTANT(0x0);
const int64_t   w_base_t::int8_max =
    LONGLONGCONSTANT(0x7fffffffffffffff);
const int64_t   w_base_t::int8_min =
    LONGLONGCONSTANT(0x8000000000000000);
#else

const uint64_t   w_base_t::uint8_max =
    ULONGLONGCONSTANT(0xffffffff);
const uint64_t   w_base_t::uint8_min =
    ULONGLONGCONSTANT(0x0);
const int64_t   w_base_t::int8_max =
    LONGLONGCONSTANT(0x7fffffff);
const int64_t   w_base_t::int8_min =
Example #3
0
#define    IOS_FAIL(stream)    stream.setstate(ios_base::failbit)
#endif

/* XXX shouldn't replicate this from somewhere else */
typedef ios::fmtflags  ios_fmtflags;

/*
 *  expect string [+-][0[x]][0-9a-fA-F]+
 */
#    define LONGLONGCONSTANT(i) i##LL
#    define ULONGLONGCONSTANT(i) i##ULL

/* These are masks */

w_base_t::uint8_t    thresh_hex_unsigned =  
    ULONGLONGCONSTANT(0xf000000000000000);
w_base_t::uint8_t    thresh_hex_signed =  
     LONGLONGCONSTANT(0xf800000000000000);
w_base_t::uint8_t    thresh_dec_unsigned =  
    ULONGLONGCONSTANT(1844674407370955161) ;
w_base_t::uint8_t    thresh_dec_signed =  
     LONGLONGCONSTANT(922337203685477580);
w_base_t::uint8_t    thresh2_dec_unsigned =  
    ULONGLONGCONSTANT(18446744073709551610) ;
w_base_t::uint8_t    thresh2_dec_signed =  
     LONGLONGCONSTANT(9223372036854775800);
w_base_t::uint8_t    thresh_oct_unsigned =  
    ULONGLONGCONSTANT(0xe000000000000000);
w_base_t::uint8_t    thresh_oct_signed =  
     LONGLONGCONSTANT(0xf000000000000000);