Skip to content

ext/soap: Continued internal refactoring #14602

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

Merged
merged 7 commits into from
Jun 27, 2024
Merged

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Jun 19, 2024

Follow-up to #14579 and commits that have been merged.

@Girgias Girgias marked this pull request as ready for review June 19, 2024 14:59
@Girgias Girgias requested review from arnaud-lb and devnexen June 19, 2024 14:59
@@ -2114,7 +2118,7 @@ static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr s
WSDL_CACHE_PUT_N("wsdl", 4, out);
WSDL_CACHE_PUT_1(WSDL_CACHE_VERSION,out);
WSDL_CACHE_PUT_1(0,out);
WSDL_CACHE_PUT_N(&t, sizeof(t), out);
WSDL_CACHE_PUT_N((char*)&t, sizeof(t), out);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was the cast needed ?

Copy link
Member

@arnaud-lb arnaud-lb Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change: Casting in the WSDL_CACHE_PUT_N macro can hide mistakes. Casting here is more explicit.

@arnaud-lb
Copy link
Member

LGTM apart from the TODO commit

Girgias added 7 commits June 27, 2024 05:41
Move it to the one call site that requires it
Add const qualifiers to the variables at the call size
Rename variables when they were shadowing a variable from the outer scope
As serializing something should not affect the value of it
The i seems to be a mistake as everything else uses j
@Girgias Girgias force-pushed the soap-refactoring2 branch from 464cae2 to a4edb5a Compare June 27, 2024 04:43
@nielsdos
Copy link
Member

Note that adding const to things like encodePtr doesn't make the pointer const.
I.e. const _encode* and const encodePtr mean two different things even though encodePtr is a typedef for 1 pointer to _encode.

@Girgias Girgias merged commit 5b1b3ae into php:master Jun 27, 2024
11 checks passed
@Girgias
Copy link
Member Author

Girgias commented Jun 27, 2024

Note that adding const to things like encodePtr doesn't make the pointer const. I.e. const _encode* and const encodePtr mean two different things even though encodePtr is a typedef for 1 pointer to _encode.

Right I was wondering about this, I'll probably do a follow-up when I have time.

@Girgias Girgias deleted the soap-refactoring2 branch June 27, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants