Skip to content

BCmath extension code reformatting #11896

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 17 commits into from
Aug 13, 2023
Merged

Conversation

jorgsowa
Copy link
Contributor

@jorgsowa jorgsowa commented Aug 6, 2023

This PR re-formats the bcmath extension to have consistent formatting. Mostly it adds the spaces in calculations to have them more readable.

Also:

  • removes unused headers
  • removes few variables which are used only once in the code

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Travis CI failure is legit.

@jorgsowa jorgsowa marked this pull request as draft August 7, 2023 22:30

prodlen = n1len+n2len+1;
int prodlen = n1len + n2len + 1;
Copy link
Member

Choose a reason for hiding this comment

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

Note to myself: why is n2len an int and probably should be size_t. Ditto for prodlen

@Girgias
Copy link
Member

Girgias commented Aug 12, 2023

Okay so it was the type change of bc_precision which was causing an issue. If the rest of the CI is happy I'm going to merge as is, and we can follow-up the other nits/issues

@Girgias
Copy link
Member

Girgias commented Aug 12, 2023

Note: S390X is a big-endian architecture compared to X86 being little-endian, as such the cast to (int) from a size_t (which was happening in ZEND_INI_MH(OnUpdateScale)) causes the wrong bytes to be moved into memory.

@jorgsowa jorgsowa marked this pull request as ready for review August 12, 2023 22:11
@Girgias Girgias merged commit e56ed6e into php:master Aug 13, 2023
jorgsowa added a commit to jorgsowa/php-src that referenced this pull request Aug 16, 2023
Re-formats the BCmath extension to have consistent formatting.

Mostly, it adds the spaces in calculations to have them more readable.

Also:

   -  removes unused headers
   -  removes few variables which are used only once in the code

Co-authored-by: George Peter Banyard <girgias@php.net>
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.

None yet

2 participants