-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Simplified objToJSON signatures #30271
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
Conversation
@@ -509,7 +501,7 @@ static void *PyTimeToJSON(JSOBJ _obj, JSONTypeContext *tc, void *outValue, | |||
GET_TC(tc)->newObj = str; | |||
|
|||
*outLen = PyBytes_GET_SIZE(str); | |||
outValue = (void *)PyBytes_AS_STRING(str); | |||
char *outValue = PyBytes_AS_STRING(str); |
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.
this looks like it should have implications for the return type of this function. is the returned outValue ever used?
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.
In the scope of this function the current assignment to outValue
goes nowhere. Particularly for strings it has no use, as Object_getString
ignores it altogether. Definitely confusing
Goal in the next PR(s) is to split out all of these functions that return void pointers into functions that return either char *
or int to streamline things and make readable
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.
Thanks. Pending green, LGTM.
Hmm I don't think there's a way to make this intermediate step work so closing |
Nothing more eyeballs could do to help? This looked like a nice cleanup. |
I think its just an architectural limitation trying to return a 64 bit integer from a |
Pre-cursor to a change that splits datetime functions that return
char *
off from datetime functions that return int. Right now these are intermixed in functions that return void pointers, which makes type checking and grokking more difficult than they need to be