Skip to content

ngx_md5.c from nginx#15

Open
pavel-ignatovich wants to merge 1 commit intomasterfrom
c_nginx_ngx_md5.c
Open

ngx_md5.c from nginx#15
pavel-ignatovich wants to merge 1 commit intomasterfrom
c_nginx_ngx_md5.c

Conversation

@pavel-ignatovich
Copy link
Copy Markdown

Copy link
Copy Markdown

@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

Comment thread ngx-md5.c

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

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

Comment thread ngx-md5.c
#define SET(n) \
(block[n] = \
(uint32_t) p[n * 4] | \
((uint32_t) p[n * 4 + 1] << 8) | \
Copy link
Copy Markdown

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

Comment thread ngx-md5.c
(block[n] = \
(uint32_t) p[n * 4] | \
((uint32_t) p[n * 4 + 1] << 8) | \
((uint32_t) p[n * 4 + 2] << 16) | \
Copy link
Copy Markdown

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

Comment thread ngx-md5.c
(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
Copy Markdown

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

Comment thread ngx-md5.c
*/

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

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