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

Move non-templated function definitions out of header files in mrtrix.h and stats.h #2809

Merged
merged 5 commits into from
Feb 20, 2024

Conversation

daljit46
Copy link
Member

This PR moves non-templated function definitions to source files from core/mrtrix.h and core/stats.h. It also removes directly unused header includes in those files.

Since these are core header files included in many files, this should improve (at least a little bit) compile times.

@daljit46 daljit46 self-assigned this Feb 19, 2024
@daljit46 daljit46 marked this pull request as draft February 19, 2024 13:34
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 50. Check the log or trigger a new build to see more.

Comment on lines +148 to +149
else
return text;

Choose a reason for hiding this comment

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

warning: do not use 'else' after 'return' [readability-else-after-return]

Suggested change
else
return text;
return text;

@daljit46 daljit46 changed the title Move non-templated function defintions out of header files in mrtrix.h and stats.h Move non-templated function definitions out of header files in mrtrix.h and stats.h Feb 19, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

return 1;
if (arg[0] == '\0' || arg[1] == '\0' || arg[2] == '\0')
return 0;
const unsigned char *uarg = reinterpret_cast<const unsigned char *>(arg);

Choose a reason for hiding this comment

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

warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]

  const unsigned char *uarg = reinterpret_cast<const unsigned char *>(arg);
                              ^

if (arg[0] == '\0' || arg[1] == '\0' || arg[2] == '\0')
return 0;
const unsigned char *uarg = reinterpret_cast<const unsigned char *>(arg);
if (uarg[0] == 0xE2 && uarg[1] == 0x80 && (uarg[2] >= 0x90 && uarg[2] <= 0x95))

Choose a reason for hiding this comment

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

warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]

  if (uarg[0] == 0xE2 && uarg[1] == 0x80 && (uarg[2] >= 0x90 && uarg[2] <= 0x95))
      ^

if (arg[0] == '\0' || arg[1] == '\0' || arg[2] == '\0')
return 0;
const unsigned char *uarg = reinterpret_cast<const unsigned char *>(arg);
if (uarg[0] == 0xE2 && uarg[1] == 0x80 && (uarg[2] >= 0x90 && uarg[2] <= 0x95))

Choose a reason for hiding this comment

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

warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]

  if (uarg[0] == 0xE2 && uarg[1] == 0x80 && (uarg[2] >= 0x90 && uarg[2] <= 0x95))
                         ^

if (arg[0] == '\0' || arg[1] == '\0' || arg[2] == '\0')
return 0;
const unsigned char *uarg = reinterpret_cast<const unsigned char *>(arg);
if (uarg[0] == 0xE2 && uarg[1] == 0x80 && (uarg[2] >= 0x90 && uarg[2] <= 0x95))

Choose a reason for hiding this comment

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

warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]

  if (uarg[0] == 0xE2 && uarg[1] == 0x80 && (uarg[2] >= 0x90 && uarg[2] <= 0x95))
                                             ^

if (arg[0] == '\0' || arg[1] == '\0' || arg[2] == '\0')
return 0;
const unsigned char *uarg = reinterpret_cast<const unsigned char *>(arg);
if (uarg[0] == 0xE2 && uarg[1] == 0x80 && (uarg[2] >= 0x90 && uarg[2] <= 0x95))

Choose a reason for hiding this comment

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

warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]

  if (uarg[0] == 0xE2 && uarg[1] == 0x80 && (uarg[2] >= 0x90 && uarg[2] <= 0x95))
                                                                ^

@daljit46 daljit46 force-pushed the slim_mrtrix_stats_headers branch from 6dad491 to 0faeec3 Compare February 19, 2024 16:33
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Also removes directly used header files
Also removes directly unused header includes
It doesn't really makes sense to return a size_t here.
@daljit46 daljit46 force-pushed the slim_mrtrix_stats_headers branch from 0faeec3 to ff98d70 Compare February 20, 2024 10:27
@daljit46 daljit46 marked this pull request as ready for review February 20, 2024 10:55
@daljit46 daljit46 merged commit 9c8cbf9 into dev Feb 20, 2024
6 checks passed
@daljit46 daljit46 deleted the slim_mrtrix_stats_headers branch February 20, 2024 12:26
@Lestropie Lestropie mentioned this pull request Feb 21, 2024
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.

1 participant