summaryrefslogtreecommitdiff
path: root/lib9p
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p')
-rw-r--r--lib9p/core.c6
-rw-r--r--lib9p/srv.c5
2 files changed, 4 insertions, 7 deletions
diff --git a/lib9p/core.c b/lib9p/core.c
index 03cdea5..c777741 100644
--- a/lib9p/core.c
+++ b/lib9p/core.c
@@ -20,7 +20,7 @@
struct lib9p_s lib9p_str(char *s) {
if (!s)
- return (struct lib9p_s){0};
+ return (struct lib9p_s){};
return (struct lib9p_s){
.len = strlen(s),
.utf8 = s,
@@ -28,7 +28,7 @@ struct lib9p_s lib9p_str(char *s) {
}
struct lib9p_s lib9p_strn(char *s, size_t maxlen) {
if (maxlen == 0 || !s)
- return (struct lib9p_s){0};
+ return (struct lib9p_s){};
return (struct lib9p_s){
.len = strnlen(s, maxlen),
.utf8 = s,
@@ -272,7 +272,7 @@ uint32_t lib9p_stat_marshal(struct lib9p_ctx *ctx, uint32_t max_net_size, struct
struct lib9p_ctx _ctx = *ctx;
_ctx.max_msg_size = max_net_size;
- struct iovec iov = {0};
+ struct iovec iov = {};
struct _marshal_ret ret = {
.net_iov_cnt = 1,
.net_iov = &iov,
diff --git a/lib9p/srv.c b/lib9p/srv.c
index 12124af..1a6bbb1 100644
--- a/lib9p/srv.c
+++ b/lib9p/srv.c
@@ -632,9 +632,7 @@ void lib9p_srv_worker(struct srv_req *ctx) {
/* Handle it. ********************************************************/
tmessage_handler handler;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wswitch-enum"
- switch (typ) {
+ LM_PARTIAL_SWITCH (typ) {
case LIB9P_TYP_Tversion: handler = (tmessage_handler)handle_Tversion; break;
#if _LIB9P_ENABLE_stat
case LIB9P_TYP_Tauth: handler = (tmessage_handler)handle_Tauth; break;
@@ -661,7 +659,6 @@ void lib9p_srv_worker(struct srv_req *ctx) {
default:
assert_notreached("lib9p_Tmsg_validate() should have rejected unknown typ");
}
-#pragma GCC diagnostic pop
handler(ctx, (void *)host_req);
assert(ctx->responded);