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
Use nitems() #888
Conversation
Where is the |
@ElyesH would you mind amending your commit messages with
? |
Hi, |
When you look at the actual commits that landed from your last Pull Request: for instance, you don't see a reference to the Pull Request. |
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
This needs a rebase, and it needs to remove the sys/types.h and sys/cdefs.h when we add sys/param.h. |
@@ -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)) |
There was a problem hiding this comment.
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) ? |
There was a problem hiding this comment.
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]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so...
I may try to land the ones w/o comments and that don't conflict to reduce the rebase effort / hassle. |
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... |
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Pull Request: #888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
No description provided.