Beruflich Dokumente
Kultur Dokumente
2009 , ,
Loki
, , ,
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, Loki . Loki Visual Studio 2005 Visual Studio 2008. 2009 32. Visual Studio
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 -
, SafeFormat.h
LOKI_PRINTF_STATE_FORWARD. . :
:
#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
instantiation 'void displayTypicalUse<CRandomEvict> (Cache &,unsigned int,unsigned int,unsigned int)' being compiled 2> 2> 2> 2> ] with [ Cache=CRandomEvict
( :
objectKind) size_t
unsigned. .
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) {
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
#endif ... #else # # define LOKI_SAFEFORMAT_SIGNED_LONG signed long define LOKI_SAFEFORMAT_SIGNED_LONG_MIN_VALUE LONG_MIN
... #endif
if (n != LONG_MIN) {
if (n != LOKI_SAFEFORMAT_SIGNED_LONG_MIN_VALUE) {
Loki . ,
, .
2
, 32. , 4 64, . ,
Viva64 ,
?
.
, . : ,
, 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
{ 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
e , -
delta , ,
int.
delta
int
) int. .
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, :
class TemplateClass { public: void test1() { m_a.m_value = m_b.m_value; // } private: T1 m_a; T2 m_b; }; ?
, , . ,
, TemplateClass.
" :
. 64 .
Loki , Loki.
64, .
, ,
64-
, Loki:
y
Loki
" .
", 64, , , . , :
Loki
y y
Loki: ,
1. 2.