-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactor the parsing of a key in a command #37
Conversation
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
The number of elements in the array of keys is either one or none in the command struct. Remove the array and refactor the code. Use the length of the keypos to determine if found. Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
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 is a massive cleanup! ⭐ ⭐ ⭐
@@ -36,12 +36,9 @@ | |||
#include <stdint.h> | |||
#include <sys/types.h> | |||
|
|||
#define VK_OK 0 | |||
#define VK_ERROR -1 | |||
#define VK_EAGAIN -2 |
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.
How come OK is deleted by the errors remain? Does any function return OK | ERROR?
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.
There is no use of VK_ERROR
in src/
, only VK_OK
.
The plan was to remove a lot of unused code in a separate PR. This is now done in #41.
The number of elements in the array of keys is either one or none in the command struct, so this change removes the array and refactors the code. Additional changes: - Remove `vkarray.c/.h` - Remove unused `remain_len` from `struct keypos` - Remove unused `remain_len` from `struct keypos` - Remove unused `reply` from `struct cmd` - Remove unused `quit` and `noforward` from `struct cmd` - Remove unused command `type` from `struct cmd` - Remove unused `id` from `struct cmd` - Remove unused `narg` from `struct cmd` - Remove unused `frag_seq` from `struct cmd` Signed-off-by: Björn Svensson <[email protected]>
The number of elements in the array of keys is either one or none in the command struct.
Remove the array and refactor the code after #23 was merged.
Additional changes:
vkarray.c/.h
remain_len
fromstruct keypos
remain_len
fromstruct keypos
reply
fromstruct cmd
quit
andnoforward
fromstruct cmd
type
fromstruct cmd
id
fromstruct cmd
narg
fromstruct cmd
frag_seq
fromstruct cmd