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

Use nitems() #888

Closed
wants to merge 24 commits into from
Closed

Use nitems() #888

wants to merge 24 commits into from

Conversation

ElyesH
Copy link
Contributor

@ElyesH ElyesH commented Nov 4, 2023

No description provided.

@emaste
Copy link
Member

emaste commented Nov 5, 2023

Where is the ARRAY_SIZE definition coming from? See also nitems() in sys/param.h

@ElyesH ElyesH changed the title Use ARRAY_SIZE() WIP Nov 7, 2023
@ElyesH ElyesH requested a review from bsdjhb as a code owner November 7, 2023 17:15
@ElyesH ElyesH changed the title WIP Use nitems() Nov 7, 2023
@igalic
Copy link
Contributor

igalic commented Nov 7, 2023

@ElyesH would you mind amending your commit messages with

Pull Request: https://github.com/freebsd/freebsd-src/pull/888

?

@ElyesH
Copy link
Contributor Author

ElyesH commented Nov 8, 2023

@ElyesH would you mind amending your commit messages with

Pull Request: https://github.com/freebsd/freebsd-src/pull/888

?

Hi,
Sorry for the question, But please , what you mean by pull request ? I'm using git and git pull https://github.com/freebsd/freebsd-src/pull/888 won't work here

@igalic
Copy link
Contributor

igalic commented Nov 9, 2023

When you look at the actual commits that landed from your last Pull Request:

e5f905c

for instance, you don't see a reference to the Pull Request.
That's why I'm asking if you could include a reference to this Pull Request in all its commit messages.

Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: freebsd#888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
@@ -27,6 +27,7 @@
*
*/

#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
Copy link
Member

Choose a reason for hiding this comment

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

types.h can be removed

@@ -36,6 +36,7 @@
#include <grp.h>
#include <errno.h>
#include <ctype.h>
#include <sys/param.h>
#include <sys/types.h>
Copy link
Member

Choose a reason for hiding this comment

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

types.h can be removed

@@ -32,6 +32,7 @@

#include <sys/cdefs.h>
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/stdint.h>
#include <sys/types.h>
Copy link
Member

Choose a reason for hiding this comment

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

types.h can be removed.

@@ -33,6 +33,7 @@
* wlandebug [-i interface] flags
* (default interface is wlan.0).
*/
#include <sys/param.h>
#include <sys/types.h>
Copy link
Member

Choose a reason for hiding this comment

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

types.h can be removed

@bsdimp
Copy link
Member

bsdimp commented Apr 11, 2024

This needs a rebase, and it needs to remove the sys/types.h and sys/cdefs.h when we add sys/param.h.
It's on the edge of 'useful enough' but if you do that, and remove the 'Pull Request: ' lines from the commit messages, then I'll go ahead and commit it. as far as I can tell, there's no semantic change.

@@ -502,7 +502,7 @@ static const char *ipproto[] = {
};

#define STR_OR_ID(x, tab) \
(((x) < sizeof(tab)/sizeof(tab[0]) && tab[(x)]) ? tab[(x)] : numstr(x))
(((x) < nitems(tab) && tab[(x)]) ? tab[(x)] : numstr(x))
Copy link
Member

Choose a reason for hiding this comment

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

This looks to have an preexisting tab character before the "?" that should be a space.

@@ -1566,7 +1566,7 @@ r_name(int type)
const char *unknown = "unknown";

return (type == MOUSE_PROTO_UNKNOWN ||
type >= (int)(sizeof(rnames) / sizeof(rnames[0])) ?
type >= (int)nitems(rnames) ?
Copy link
Member

Choose a reason for hiding this comment

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

@bsdimp should this be flattened into 2 lines instead of 3? Namely:

    return (type == MOUSE_PROTO_UNKNOWN ||
        type >= (int)nitems(rnames) ? unknown : rnames[type]);

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think so...

@bsdimp
Copy link
Member

bsdimp commented Apr 23, 2024

I may try to land the ones w/o comments and that don't conflict to reduce the rebase effort / hassle.

@bsdimp
Copy link
Member

bsdimp commented Apr 29, 2024

OK. I've landed what I can. I'm closing this. Under the policy when it was submitted, it was OK, but the new policy is to only accept changes that can enumerate a specific problem, so I'm going to close it, but it's unlikely we'd accept the update. I did make the changes I wanted and that markj highlighted since this has taken so long, but generally I don't like to tweak the pull requests...

@bsdimp bsdimp closed this Apr 29, 2024
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants