-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-121249: adjust formatting codes for complex types in struct/ctypes modules #132827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -648,14 +648,14 @@ union result { | |||||||||
int i; | ||||||||||
long l; | ||||||||||
long long q; | ||||||||||
long double D; | ||||||||||
long double g; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vstinner, this is something I worry about here. IIUIC, this is a private interface and we can rename it's members. It seems this is not used across the codebase, but I appreciate a second look. (No tests seems to be affected, though maybe it's just lack of test coverage.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I confirm, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not sure. It seems, naming of union members aren't used - only size is important. As long as we keep one-letter codes, I think it's good to have corresponding members in this struct. Same holds for |
||||||||||
double d; | ||||||||||
float f; | ||||||||||
void *p; | ||||||||||
#if defined(Py_HAVE_C_COMPLEX) && defined(Py_FFI_SUPPORT_C_COMPLEX) | ||||||||||
double complex C; | ||||||||||
float complex E; | ||||||||||
long double complex F; | ||||||||||
double complex D; | ||||||||||
float complex F; | ||||||||||
Comment on lines
+656
to
+657
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe change order?
Suggested change
|
||||||||||
long double complex G; | ||||||||||
#endif | ||||||||||
}; | ||||||||||
|
||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you should define
c_float_complex
first, just likec_float
is defined beforec_double
above?