Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5ea0f801
Commit
5ea0f801
authored
Jul 19, 2013
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the GCC-4.8 compiler happy by moving declarations to the top of the function.
parent
520ad579
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
Modules/_ctypes/libffi_osx/ffi.c
Modules/_ctypes/libffi_osx/ffi.c
+6
-5
Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
+7
-4
No files found.
Modules/_ctypes/libffi_osx/ffi.c
View file @
5ea0f801
...
...
@@ -38,12 +38,13 @@ initialize_aggregate(
/*@out@*/
ffi_type
*
arg
)
{
/*@-usedef@*/
ffi_type
**
ptr
;
if
(
arg
==
NULL
||
arg
->
elements
==
NULL
||
arg
->
size
!=
0
||
arg
->
alignment
!=
0
)
return
FFI_BAD_TYPEDEF
;
ffi_type
**
ptr
=
&
(
arg
->
elements
[
0
]);
ptr
=
&
(
arg
->
elements
[
0
]);
while
((
*
ptr
)
!=
NULL
)
{
...
...
@@ -135,16 +136,16 @@ ffi_prep_cif(
/*@dependent@*/
/*@out@*/
/*@partial@*/
ffi_type
*
rtype
,
/*@dependent@*/
ffi_type
**
atypes
)
{
unsigned
int
bytes
=
0
;
unsigned
int
i
;
ffi_type
**
ptr
;
if
(
cif
==
NULL
)
return
FFI_BAD_TYPEDEF
;
if
(
abi
<=
FFI_FIRST_ABI
||
abi
>
FFI_DEFAULT_ABI
)
return
FFI_BAD_ABI
;
unsigned
int
bytes
=
0
;
unsigned
int
i
;
ffi_type
**
ptr
;
cif
->
abi
=
abi
;
cif
->
arg_types
=
atypes
;
cif
->
nargs
=
nargs
;
...
...
Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
View file @
5ea0f801
...
...
@@ -225,14 +225,16 @@ classify_argument(
/* Merge the fields of structure. */
for
(
ptr
=
type
->
elements
;
*
ptr
!=
NULL
;
ptr
++
)
{
int
num
,
pos
;
byte_offset
=
ALIGN
(
byte_offset
,
(
*
ptr
)
->
alignment
);
int
num
=
classify_argument
(
*
ptr
,
subclasses
,
byte_offset
%
8
);
num
=
classify_argument
(
*
ptr
,
subclasses
,
byte_offset
%
8
);
if
(
num
==
0
)
return
0
;
int
pos
=
byte_offset
/
8
;
pos
=
byte_offset
/
8
;
for
(
i
=
0
;
i
<
num
;
i
++
)
{
...
...
@@ -589,11 +591,12 @@ ffi_prep_closure(
void
(
*
fun
)(
ffi_cif
*
,
void
*
,
void
**
,
void
*
),
void
*
user_data
)
{
volatile
unsigned
short
*
tramp
;
if
(
cif
->
abi
!=
FFI_UNIX64
)
return
FFI_BAD_ABI
;
volatile
unsigned
short
*
tramp
=
(
volatile
unsigned
short
*
)
&
closure
->
tramp
[
0
];
tramp
=
(
volatile
unsigned
short
*
)
&
closure
->
tramp
[
0
];
tramp
[
0
]
=
0xbb49
;
/* mov <code>, %r11 */
*
(
void
*
volatile
*
)
&
tramp
[
1
]
=
ffi_closure_unix64
;
...
...
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