Skip to content

dlpi: Replace magic number with named constant #1535

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

Conversation

killerdevildog
Copy link

Replace hardcoded magic number '1' in dlbindreq() with a descriptive constant DLPI_MAX_CONIND. This improves code readability and follows best practices for maintainable code.

  • Added DLPI_MAX_CONIND constant with clear documentation
  • Replaced 'req.dl_max_conind = 1' with 'req.dl_max_conind = DLPI_MAX_CONIND'
  • Maintains full backwards compatibility

Resolves XXX comment about magic number in pcap-dlpi.c line 1457.

Replace hardcoded magic number '1' in dlbindreq() with a descriptive
constant DLPI_MAX_CONIND. This improves code readability and follows
best practices for maintainable code.

- Added DLPI_MAX_CONIND constant with clear documentation
- Replaced 'req.dl_max_conind = 1' with 'req.dl_max_conind = DLPI_MAX_CONIND'
- Maintains full backwards compatibility

Resolves XXX comment about magic number in pcap-dlpi.c line 1457.
@@ -122,6 +122,12 @@

#define MAXDLBUF 8192

/*
Copy link
Member

Choose a reason for hiding this comment

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

As this is only used for HP-UX, should it be defined inside an #ifdef for HP-UX?

@infrastation
Copy link
Member

@killerdevildog, second warning for posting a software-generated pull request.

@infrastation
Copy link
Member

The author has demanded explanations from me directly. Let me note the author has very recently forked more than 100 repositories and opened more than 50 pull requests, some of which are of a very similar quality, and some of which have already been rejected on very similar grounds. Excuse me, but you already know well what you are doing and your request for explanations is out of place.

@infrastation
Copy link
Member

For posterity, the meaning of "1" is documented here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants