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

ethernetaddr.hh: adding all missed functions. #13

Merged
merged 2 commits into from
Aug 18, 2013

Conversation

vitalivanov
Copy link
Contributor

Issue #12.

ethernetaddr.cc module is not compiled in for now. Thus there are
possibilities to have undefined references. Moving all required methods
to header file and removing source module completely.
Small styling cleanups.

@vitalivanov
Copy link
Contributor Author

tootoonchian, any news on this?

@tootoonchian
Copy link
Collaborator

I'm fine with making it header only. You could perhaps move the helper functions to an anonymous namespace.

@vitalivanov
Copy link
Contributor Author

Do you wanna move:
static int hexit_value(int c);
to global namespace? I do not see a reason for this at least for now.
Other methods like:
inline std::size_t hash_value(const ethernetaddr& ethaddr);
are also under vigil namespace right now.
If you insist I can do this..

@tootoonchian
Copy link
Collaborator

I meant to put it in an unnamed namespace. See
http:https://stackoverflow.com/questions/357404/why-are-unnamed-namespaces-used-and-what-are-their-benefits
and
let me know if it makes sense.

On Wed, Aug 14, 2013 at 8:02 PM, Vitaliy Ivanov [email protected]:

Do you wanna move:
static int hexit_value(int c);
to global namespace? I do not see a reason for this at least for now.
Other methods like:
inline std::size_t hash_value(const ethernetaddr& ethaddr);
are also under vigil namespace right now.
If you insist I can do this..


Reply to this email directly or view it on GitHubhttps://github.com//pull/13#issuecomment-22630704
.

@vitalivanov
Copy link
Contributor Author

Oh, you mean 'static' identifier...
Method hexit_value should have internal linkage as it's not supposed to be used anywhere else.
If there is such a need in future it can be changed.

unnamed namespace will make it to have external linkage. Size of lib would be bigger.

I propose to make it static inline.

static inline int hexit_value(int c);

Your thoughts?

@tootoonchian
Copy link
Collaborator

No, I don't mean a static declaration :-)

This type of static declarations is deprecated (see C++ standard, article
7.3.1.1) and unnamed namespaces should be used instead.

Amin

On Thu, Aug 15, 2013 at 10:54 PM, Vitaliy Ivanov
[email protected]:

Oh, you mean 'static' identifier...
Method hexit_value should have internal linkage as it's not supposed to be
used anywhere else.
If there is such a need in future it can be changed.

unnamed namespace will make it to have external linkage. Size of lib would
be bigger.

I propose to make it static inline.

static inline int hexit_value(int c);

Your thoughts?


Reply to this email directly or view it on GitHubhttps://github.com//pull/13#issuecomment-22708008
.

@vitalivanov
Copy link
Contributor Author

Moved hexit_value method to unnamed namespace.

Issue noxrepo#12.

ethernetaddr.cc module is not compiled in for now. Thus there are
possibilities to have undefined references. Moving all required methods
to header file and removing source module completely.
Small styling cleanups.
Issue noxrepo#12.

Addressing review comments from tootoonchian.
tootoonchian added a commit that referenced this pull request Aug 18, 2013
ethernetaddr.hh: make the library header-only and move helper functions to anonymous namespace.
@tootoonchian tootoonchian merged commit 26a111f into noxrepo:verity Aug 18, 2013
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.

None yet

2 participants