Enable -Wall and fix warnings

Having just realised that -Wall wasn't set (WTF???), switch it
on and mop the floor...

Signed-off-by: Marc Zyngier <maz@kernel.org>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0e853c..0029ab0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,8 @@
     ${CMAKE_CURRENT_LIST_DIR}
 )
 
+target_compile_options(${PROJECT_NAME} PRIVATE -Wall -funsigned-char)
+
 # Create map/bin/hex/uf2 files
 pico_add_extra_outputs(${PROJECT_NAME})
 
diff --git a/start.c b/start.c
index ca1fb6a..10c6692 100644
--- a/start.c
+++ b/start.c
@@ -149,7 +149,7 @@
 					     const struct hw_context *hw)
 {
 	while (uart_is_readable(hw->uart)) {
-		char c = uart_getc(hw->uart);
+		const char c = uart_getc(hw->uart);
 		upstream_ops->tx_bytes(port, &c, 1);
 	}
 }
@@ -299,7 +299,7 @@
 
 static void serial1_tx_bytes(int32_t port, const char *ptr, int len)
 {
-	uart_write_blocking(uart1, ptr, len);
+	uart_write_blocking(uart1, (const uint8_t *)ptr, len);
 }
 
 static int32_t serial1_rx_byte(int32_t port)
diff --git a/tcpm_driver.c b/tcpm_driver.c
index fd78712..5d636a8 100644
--- a/tcpm_driver.c
+++ b/tcpm_driver.c
@@ -69,9 +69,8 @@
 	const struct hw_context *fusb = get_hw_from_port(port);
 
 	if (out_size) {
-		int err;
-		err = i2c_write_blocking(fusb->i2c, fusb->addr, out, out_size,
-					 !(flags & I2C_XFER_STOP));
+		i2c_write_blocking(fusb->i2c, fusb->addr, out, out_size,
+				   !(flags & I2C_XFER_STOP));
 	}
 
 	if (in_size) {
diff --git a/vdmtool.c b/vdmtool.c
index 3f68db2..9c5bfd3 100644
--- a/vdmtool.c
+++ b/vdmtool.c
@@ -50,7 +50,7 @@
 
 #define cprintf(cxt, str, ...)	do {					\
 		cprintf_cont(cxt,					\
-			     "P%ld: " str, PORT(cxt), ##__VA_ARGS__);	\
+			     "P%d: " str, PORT(cxt), ##__VA_ARGS__);	\
 	} while(0)
 
 #define dprintf(cxt, ...)	do {					\
@@ -195,7 +195,7 @@
 
 	cprintf_cont(cxt, "%d) [%x]", len, hdr);
 	for (int16_t i = 0; i < PD_HEADER_CNT(hdr); i++)
-		cprintf_cont(cxt, " %x", msg[i]);
+		cprintf_cont(cxt, " %lx", msg[i]);
 
 	cprintf_cont(cxt, "\n");
 }
@@ -275,11 +275,11 @@
 	if (len != 0) {
 		switch (type) {
 		case PD_DATA_SOURCE_CAP:
-			cprintf(cxt, "<SOURCE_CAP: %x\n", msg[0]);
+			cprintf(cxt, "<SOURCE_CAP: %lx\n", msg[0]);
 			send_power_request(cxt, msg[0]);
 			break;
 		case PD_DATA_REQUEST:
-			cprintf(cxt, "<REQUEST: %x\n", msg[0]);
+			cprintf(cxt, "<REQUEST: %lx\n", msg[0]);
 			handle_power_request(cxt, msg[0]);
 			break;
 		case PD_DATA_VENDOR_DEF:
@@ -323,7 +323,7 @@
 
 static void evt_packet(struct vdm_context *cxt)
 {
-	int16_t hdr, len, ret;
+	int16_t hdr, ret;
 	enum fusb302_rxfifo_tokens sop;
 	uint32_t msg[16];
 
@@ -730,8 +730,6 @@
 
 void m1_pd_bmc_run(void)
 {
-	int i;
-
 	while (1) {
 		bool busy = false;