Skip to content

Comments

Rename top-level IO extension headers.#71

Merged
stefanseefeld merged 3 commits intoboostorg:developfrom
stefanseefeld:io
Apr 4, 2018
Merged

Rename top-level IO extension headers.#71
stefanseefeld merged 3 commits intoboostorg:developfrom
stefanseefeld:io

Conversation

@stefanseefeld
Copy link
Member

Refactor IO extension files.

@stefanseefeld stefanseefeld added this to the The Grand Merge milestone Apr 4, 2018
@stefanseefeld
Copy link
Member Author

Please note that the only intended changes in this PR are:

  • file names
  • associated include statements
  • header guards to match the new file names


#ifndef BOOST_GIL_EXTENSION_IO_BMP_ALL_HPP
#define BOOST_GIL_EXTENSION_IO_BMP_ALL_HPP
#ifndef boost_gil_extension_io_bmp_hpp_
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary to change the style of include guards to lowercase? (The trailing underscore is not necessary either)

The Boost convention is that all symbols related to preprocessor are underscore-delimited UPPERCASE words. That has a purpose and it's a transitive knowledge across Boost codebase.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't aware of that convention, and I have seen plenty of exceptions to that rule. Is it written somewhere, or just folklore ? (The important part is that the full filename be represented to avoid clashes. Doing my review I have seen one or two cases where a wrong guard macro was used, apparently copy&pasted from a different header. Such issues generate funny symptoms...)
So, as I had to adjust all header guards, I just used the convention I was most familiar with. Do you really think I need to change it again ?

Copy link
Member

@mloskot mloskot Apr 4, 2018

Choose a reason for hiding this comment

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

Is it written somewhere, or just folklore ?

Yes, it is here https://www.boost.org/development/header.html : Boost convention of all uppercase letters, with the header name prefixed by the namespace name, and suffixed with HPP, separated by underscores.

I have seen plenty of exceptions to that rule

grepping through the whole of Boost headers for ifndef\s+[a-z]+_.+ shows just one in phoenix/core/detail/index_sequence.hpp and, interestingly, handful of exceptions in Boost.Python headers, but I suspect it was a recent change :-)

Apart from the widely accepted convention, this boost_gil_extension_io_bmp_hpp_ is simply confusing with typedef-s or class names,

I can re-store upper-case, no problem, just let me know and as soon as you merge, I'll do it.

I understand the role of personal preference, but please let's

} // namespace boost

#endif // BOOST_GIL_EXTENSION_IO_BMP_IO_IS_ALLOWED_HPP
#endif
Copy link
Member

Choose a reason for hiding this comment

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

A side comment: do we care about EOL at the EOF ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think so. Why do you ask ? (I'm typically editing using emacs, and that editor automatically inserts missing EOL at the end.)

Copy link
Member

@mloskot mloskot Apr 4, 2018

Choose a reason for hiding this comment

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

OK. I just noticed this and (some) other headers are missing the EOL at the end.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, emacs tells me otherwise. I just pushed a commit with the header guard fix. Didn't see any missing EOL endings.

Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry, I must be too eager trusting how GitHub renders file.

////////////////////////////////////////////////////////////////////////////////////////
/// \file
/// \brief
/// \author Olivier Tournaire \n
Copy link
Member

Choose a reason for hiding this comment

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

Side comment: Doesn't this author clash with the copyright header?

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't looked at any file content.

Copy link
Member

@mloskot mloskot left a comment

Choose a reason for hiding this comment

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

@stefanseefeld thanks for your effort!

@stefanseefeld stefanseefeld merged commit f5d736c into boostorg:develop Apr 4, 2018
stefanseefeld added a commit that referenced this pull request Jun 27, 2018
Refactor IO extension headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants