Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pointers to const instead of const pointers to const
Declaring a `const char *const ptr` means you are declaring a pointer to "readonly" memory, whose own address value is also immutable. The last part is not relevant to library users, so remove it. We want to communicate to the library user the important fact that the inputs are never changed by a function, because the compiler could use that information to do some optimization. But the library user doesn't care whether we ever reassign the pointer internally to a different location, because that's just an implementation detail.
- Loading branch information
Showing
5 changed files
with
90 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters