Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a99865b1
Kaydet (Commit)
a99865b1
authored
May 25, 2006
tarafından
Bob Ippolito
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use faster struct pack/unpack functions for the endian table that matches the host's
üst
04ab994d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
_struct.c
Modules/_struct.c
+27
-3
No files found.
Modules/_struct.c
Dosyayı görüntüle @
a99865b1
...
...
@@ -572,13 +572,13 @@ static formatdef native_table[] = {
{
'I'
,
sizeof
(
int
),
INT_ALIGN
,
nu_uint
,
np_uint
},
{
'l'
,
sizeof
(
long
),
LONG_ALIGN
,
nu_long
,
np_long
},
{
'L'
,
sizeof
(
long
),
LONG_ALIGN
,
nu_ulong
,
np_ulong
},
{
'f'
,
sizeof
(
float
),
FLOAT_ALIGN
,
nu_float
,
np_float
},
{
'd'
,
sizeof
(
double
),
DOUBLE_ALIGN
,
nu_double
,
np_double
},
{
'P'
,
sizeof
(
void
*
),
VOID_P_ALIGN
,
nu_void_p
,
np_void_p
},
#ifdef HAVE_LONG_LONG
{
'q'
,
sizeof
(
PY_LONG_LONG
),
LONG_LONG_ALIGN
,
nu_longlong
,
np_longlong
},
{
'Q'
,
sizeof
(
PY_LONG_LONG
),
LONG_LONG_ALIGN
,
nu_ulonglong
,
np_ulonglong
},
#endif
{
'f'
,
sizeof
(
float
),
FLOAT_ALIGN
,
nu_float
,
np_float
},
{
'd'
,
sizeof
(
double
),
DOUBLE_ALIGN
,
nu_double
,
np_double
},
{
'P'
,
sizeof
(
void
*
),
VOID_P_ALIGN
,
nu_void_p
,
np_void_p
},
{
0
}
};
...
...
@@ -1477,6 +1477,30 @@ init_struct(void)
if
(
PyType_Ready
(
&
PyStructType
)
<
0
)
return
;
/* Check endian and swap in faster functions */
{
int
one
=
1
;
formatdef
*
native
=
native_table
;
formatdef
*
other
,
*
ptr
;
if
((
int
)
*
(
unsigned
char
*
)
&
one
)
other
=
lilendian_table
;
else
other
=
bigendian_table
;
while
(
native
->
format
!=
'\0'
&&
other
->
format
!=
'\0'
)
{
ptr
=
other
;
while
(
ptr
->
format
!=
'\0'
)
{
if
(
ptr
->
format
==
native
->
format
)
{
ptr
->
pack
=
native
->
pack
;
ptr
->
unpack
=
native
->
unpack
;
if
(
ptr
==
other
)
other
++
;
break
;
}
ptr
++
;
}
native
++
;
}
}
/* Add some symbolic constants to the module */
if
(
StructError
==
NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment