aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <swo-dev@marcschink.de>2015-07-16 22:40:07 +0200
committerMarc Schink <swo-dev@marcschink.de>2015-07-17 21:22:13 +0200
commit4594d5f988e92e3f26e3381ee65c9d748b544a83 (patch)
tree163ac21e44cc4c79e6dd5f709684a4e55ce741b4
parent72ca2fee945c820b4a5a95efe3b700dea696be54 (diff)
Add default case to switch statements.
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 35f21d2..2e0ddd0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -259,6 +259,10 @@ static void handle_ext_packet(const union libswo_packet *packet)
case LIBSWO_EXT_SRC_HW:
src = "HW";
break;
+ default:
+ g_warning("Extension packet with invalid source: %u.",
+ packet->ext.source);
+ return;
}
printf("Extension (source = %s, value = %x)\n", src,
@@ -306,6 +310,10 @@ static void handle_lts_packet(const union libswo_packet *packet)
case LIBSWO_LTS_REL_BOTH:
tc = "data and timestamp delayed";
break;
+ default:
+ g_warning("Local timestamp packet with invalid relation: %u.",
+ packet->lts.relation);
+ return;
}
printf("Local timestamp (relation = %s, value = %x)\n", tc,
@@ -364,6 +372,7 @@ static int packet_cb(struct libswo_context *ctx,
handle_unknown_packet(packet);
break;
default:
+ g_warning("Invalid packet type: %u.", packet->type);
break;
}