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
83620773
Unverified
Kaydet (Commit)
83620773
authored
Ara 09, 2017
tarafından
Benjamin Peterson
Kaydeden (comit)
GitHub
Ara 09, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix my byte-swapping implementation (#4772)
üst
4e3e1563
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
import.c
Python/import.c
+10
-10
No files found.
Python/import.c
Dosyayı görüntüle @
83620773
...
...
@@ -2197,21 +2197,21 @@ static PyObject *
_imp_source_hash_impl
(
PyObject
*
module
,
long
key
,
Py_buffer
*
source
)
/*[clinic end generated code: output=edb292448cf399ea input=9aaad1e590089789]*/
{
uint64_t
hash
=
_Py_KeyedHash
((
uint64_t
)
key
,
source
->
buf
,
source
->
len
);
union
{
uint64_t
x
;
char
data
[
sizeof
(
uint64_t
)];
}
hash
;
hash
.
x
=
_Py_KeyedHash
((
uint64_t
)
key
,
source
->
buf
,
source
->
len
);
#if !PY_LITTLE_ENDIAN
// Force to little-endian. There really ought to be a succinct standard way
// to do this.
union
{
uint64_t
x
;
unsigned
char
data
[
sizeof
(
uint64_t
)];
}
pun
;
pun
.
x
=
hash
;
for
(
size_t
i
=
0
;
i
<
sizeof
(
pun
.
data
);
i
++
)
{
pun
.
data
[
sizeof
(
pun
.
data
)
-
i
-
1
]
=
pun
.
data
[
i
];
for
(
size_t
i
=
0
;
i
<
sizeof
(
hash
.
data
)
/
2
;
i
++
)
{
char
tmp
=
hash
.
data
[
i
];
hash
.
data
[
i
]
=
hash
.
data
[
sizeof
(
hash
.
data
)
-
i
-
1
];
hash
.
data
[
sizeof
(
hash
.
data
)
-
i
-
1
]
=
tmp
;
}
hash
=
pun
.
x
;
#endif
return
PyBytes_FromStringAndSize
(
(
const
char
*
)
&
hash
,
sizeof
(
hash
));
return
PyBytes_FromStringAndSize
(
hash
.
data
,
sizeof
(
hash
.
data
));
}
...
...
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