Sie sind auf Seite 1von 10

64: : 25.09.

2009 , ,

Loki
, , ,

Loki Viva64 . , . , " ".

64 -

Loki ++: ". , , C++ ". " , (Rich Sposato), 64Viva64. , Viva64. , ++. . , Loki 0.1.7), . , Loki SVNLoki 2009 Loki Viva64 " . ", Viva64 , , :"

"

, C++. ,

64. Loki,

" Loki,

, Loki

64Viva64

Loki

Microsoft Visual Studio 2005

Microsoft Visual Studio, Loki . Loki Visual Studio 2005 Visual Studio 2008. 2009 32. Visual Studio

x64. 64Loki . Loki :


========== Build: 19 succeeded, 1 failed, 0 up -to-date, 0 skipped ==========

64, ,

20

SafeFormat:
16>------ Build started: Project: SafeFormat, Configuration: Debug x64 -----16>Compiling... 16>main.cpp 16>.\main.cpp(255) : error C3066: there are multiple ways that an object of this type can be called with these arguments 16> ..\..\include\loki/SafeFormat.h(109): could be 'Loki::PrintfState<Device,Char> &Loki::PrintfState<Device,Char>::operator ()(bool)' ... 16> while trying to match the argument list '(UInt)'

, ,
void test_dword() { typedef signed int Int; typedef unsigned int UInt; typedef signed long Long; typedef unsigned long ULong; Int i(0); UInt ui(0); Long l(0); ULong ul(0); Printf("%d")(i);

. :

Printf("%d")(ui); // Printf("%d")(l); Printf("%d")(ul); }

Printf -

, SafeFormat.h

LOKI_PRINTF_STATE_FORWARD. . :

#if (defined(_WIN32) || defined(_WIN64)) LOKI_PRINTF_STATE_FORWARD(unsigned long) #else

:
#if (defined(_WIN32) || defined(_WIN64)) #if (defined(_WIN64)) LOKI_PRINTF_STATE_FORWARD(unsigned int) #endif LOKI_PRINTF_STATE_FORWARD(unsigned long) #else

20 . (warnings) 64: ,

2>.\CachedFactoryTest.cpp(204) : warning C4267: 'argument' : conversion from 'size_t' to 'const int', possible loss of data 2> template .\CachedFactoryTest.cpp(238) : see reference to function

instantiation 'milliSec typicalUse<Cache> (Cache &,unsigned int,unsigned int,unsigned int)' being compiled 2> 2> 2> 2> ] with [ Cache=CRandomEvict

2> template

.\CachedFactoryTest.cpp(252) : see reference to function

instantiation 'void displayTypicalUse<CRandomEvict> (Cache &,unsigned int,unsigned int,unsigned int)' being compiled 2> 2> 2> 2> ] with [ Cache=CRandomEvict

size_t typicalUse() CachedFactoryTest.cpp:

// Registering objects for(size_t i=0;i<objectKind;i++) CC.Register(i, createProductNull);

( :

objectKind) size_t

unsigned. .

// Registering objects for(unsigned i=0;i< objectKind;i++) CC.Register(i, createProductNull);

64? Viva64.

, (warnings)

64 -

64Viva64.

Loki
Loki 64Viva64 32-

Viva64
, 6489 , . , , , . 64 64.

Viva64 . . 89

Loki ,

89 Loki

1
, :

LONG_MIN
LONG_MIN

char* RenderWithoutSign(LOKI_SAFEFORMAT_SIGNED_LONG n, char* bufLast, unsigned int base, bool upperc ase)

SafeFormat.h.
if (n != LONG_MIN) {

LOKI_SAFEFORMAT_SIGNED_LONG 64. Unix( long. 64Windows( Loki LOKI_SAFEFORMAT_SIGNED_LONG


#if defined(_WIN32) || defined(_WIN64)

, LLP64) : LP64) long

6432.

#define LOKI_SAFEFORMAT_SIGNED_LONG intptr_t #define LOKI_SAFEFORMAT_UNSIGNED_LONG uintptr_t #else #define LOKI_SAFEFORMAT_SIGNED_LONG signed long #define LOKI_SAFEFORMAT_UNSIGNED_LONG unsigned long #endif

long 6464-

Windows32( . ,

32.

, , intptr_t).

LONG_MIN

#if defined(_WIN32) || defined(_WIN64) # define LOKI_SAFEFORMAT_SIGNED_LONG intptr_t

#if defined(_WIN64) # # define LOKI_SAFEFORMAT_SIGNED_LONG_MIN_VALUE LLONG_MIN define LOKI_SAFEFORMAT_SIGNED_LONG_MAX_VALUE LLONG_MAX

#else # # define LOKI_SAFEFORMAT_SIGNED_LONG_MIN_VALUE LONG_MIN define LOKI_SAFEFORMAT_SIGNED_LONG_MAX_VALUE LONG_MAX

#endif ... #else # # define LOKI_SAFEFORMAT_SIGNED_LONG signed long define LOKI_SAFEFORMAT_SIGNED_LONG_MIN_VALUE LONG_MIN

define LOKI_SAFEFORMAT_SIGNED_LONG_MAX_VALUE LONG_MAX

... #endif

if (n != LONG_MIN) {

if (n != LOKI_SAFEFORMAT_SIGNED_LONG_MIN_VALUE) {

Loki . ,

, .

2
, 32. , 4 64, . ,

Viva64 ,

?
.

, . : ,

::Loki::ScopeGuard guard4 = ::Loki::MakeGuard( &HasFour, 1, 2, 3, 4 ); ::Loki::ScopeGuard guard5 = ::Loki::MakeGuard( &HasFive, 1, 2, 3, 4, 5 );

, SafeFormat\main.cpp
case 'X': // TestCase(formatSpec, RandomInt( -10000, 10000));

. :

// don't test negative values on 64bit systems, because // snprintf does not support 64 Bit values TestCase(formatSpec, RandomInt( -10000 * (sizeof(size_t)>4 ? 0 : 1) , 10000)); break; case 'e':

. .

int
flex\simplestringstorage.h

void resize(size_type newSize, E fill)

{ const int delta = int(newSize - size()); if (delta == 0) return; if (delta > 0) { if (newSize > capacity()) { reserve(newSize); } E* e = &*end(); flex_string_details::pod_fill(e, e + delta, fill); } pData_->pEnd_ = pData_ ->buffer_ + newSize; }

Viva64

flex_string_details::pod_fill(e, e + delta, fill);

, , (INT_MAX int ptrdiff_t: ). pod_fill , .

e , -

delta , ,

int.

delta

const ptrdiff_t delta = ptrdiff_t(newSize - size());

int
) int. .

( INT_MAX ptrdiff_t size_t. SmallObj\SmallObjBench.cpp LOKI_SMALLOBJ_BENCH_ARRAY, ,

5
CachedFactory\CachedFactoryTest.cpp
template< class Cache > milliSec typicalUse(Cache &CC, unsigned objectKind, unsigned maxObjectCount, unsigned maxIteration)

objectKind -

size_t. .

Loki ,

64?
Loki, Loki , 6464Loki . . ( ?

, ), ! . ,

, ,

. , Loki. :
template <class T> struct TClass { int m_a; T m_b; int m_c; };

Viva64

T 24 ,

int, 16 : .

size_t,

template <class T> struct TClass { T m_b; int m_a; int m_c; };

. . , Loki, :

template<typename T1, typename T2>

class TemplateClass { public: void test1() { m_a.m_value = m_b.m_value; // } private: T1 m_a; T2 m_b; }; ?

, , . ,

, TemplateClass.

Loki, . Loki , . , , . , , . . , Loki 64 , , , ( 64, . ) , 64 -

" 64Loki 64. Viva64, 32. , ,

" :

. 64 .

Loki , Loki.

64, .

, ,

64-

, Loki:
y

Loki

" .

", 64, , , . , :

Loki

y y

Loki: ,

1. 2.

Loki. http://www.viva64.com/go.php?url=515. Viva64. http://www.viva64.com/viva64-tool.

Das könnte Ihnen auch gefallen