Skip to content
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

ngx_md5.c from nginx #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ngx_md5.c from nginx #15

wants to merge 1 commit into from

Conversation

pavel-ignatovich
Copy link

Copy link

@monocodus monocodus bot left a comment

Choose a reason for hiding this comment

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

This is autogenerated code-style review, new suggestions: 5


#define SET(n) \
(block[n] = \
(uint32_t) p[n * 4] | \
Copy link

Choose a reason for hiding this comment

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

Suggested change
(uint32_t) p[n * 4] | \
(uint32_t) p[(n) * 4] | \

This comment was generated with the following checker: ClangTidy

#define SET(n) \
(block[n] = \
(uint32_t) p[n * 4] | \
((uint32_t) p[n * 4 + 1] << 8) | \
Copy link

Choose a reason for hiding this comment

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

Suggested change
((uint32_t) p[n * 4 + 1] << 8) | \
((uint32_t) p[(n) * 4 + 1] << 8) | \

This comment was generated with the following checker: ClangTidy

(block[n] = \
(uint32_t) p[n * 4] | \
((uint32_t) p[n * 4 + 1] << 8) | \
((uint32_t) p[n * 4 + 2] << 16) | \
Copy link

Choose a reason for hiding this comment

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

Suggested change
((uint32_t) p[n * 4 + 2] << 16) | \
((uint32_t) p[(n) * 4 + 2] << 16) | \

This comment was generated with the following checker: ClangTidy

(uint32_t) p[n * 4] | \
((uint32_t) p[n * 4 + 1] << 8) | \
((uint32_t) p[n * 4 + 2] << 16) | \
((uint32_t) p[n * 4 + 3] << 24))
Copy link

Choose a reason for hiding this comment

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

Suggested change
((uint32_t) p[n * 4 + 3] << 24))
((uint32_t) p[(n) * 4 + 3] << 24))

This comment was generated with the following checker: ClangTidy

*/

static const u_char *
ngx_md5_body(ngx_md5_t *ctx, const u_char *data, size_t size)
Copy link

Choose a reason for hiding this comment

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

The function is too long

ngx_md5_body( ngx_md5_t * ctx , const u_char * data , size_t size) now spans 92 lines.
Corresponding modifications started here.
Keep your functions' length within 50 lines to improve readability.

This comment was generated with the following checker: long_method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C/C++ Files in C or C++ Demonstration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant