Index: ram/msl.c
===================================================================
--- ram/msl.c	(revision 3fcb8106442d6c4bc27177e8ba8a021c3c7916b8)
+++ ram/msl.c	(revision 5289d7c1ba1edd9bc4d42fc831beefedccdeb7ee)
@@ -57,5 +57,6 @@
 	struct s_entry *ep;
 	int16_t i, ti, val;
-	uint16_t chan, crel, oldsr, port, trg, trig, vel;
+	uint16_t crel, oldsr;
+	int16_t chan, port, trg, trig, vel;
 	int16_t esi, newsig, oldclk, oldrec;
 	int32_t fctemp;
@@ -251,5 +252,5 @@
 										ep->e_time = t_cur;
 										ep->e_type = EV_ANVL;
-										ep->e_data1 = i;
+										ep->e_data1 = (int8_t)i;
 										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
@@ -286,5 +287,5 @@
 										ep->e_time = t_cur;
 										ep->e_type = EV_ANVL;
-										ep->e_data1 = 0x0010 | i;
+										ep->e_data1 = (int8_t)(0x0010 | i);
 										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
@@ -329,5 +330,5 @@
 										ep->e_time = t_cur;
 										ep->e_type = EV_ANVL;
-										ep->e_data1 = 0x0020 | i;
+										ep->e_data1 = (int8_t)(0x0020 | i);
 										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
@@ -393,6 +394,6 @@
 					ti  = (int16_t)( (19200000L / ti) - 1);
 #endif
-					TIME_T2H = ti >> 8;
-					TIME_T2L = ti & 0x00FF;
+					TIME_T2H = (uint8_t)(ti >> 8);
+					TIME_T2L = (uint8_t)(ti & 0x00FF);
 
 					if (tmpomlt EQ 50) {	/* 0 */
@@ -476,10 +477,10 @@
 				case 76:		/* amplitude */
 
-				aval += aval >> 2;
-
-				if (aval > 127)
-					aval = 127;
-
-				amplval = (aval << 9) ^ 0x8000;
+					aval += aval >> 2;
+
+					if (aval > 127)
+						aval = 127;
+
+					amplval = (aval << 9) ^ (int16_t)0x8000;
 					sendval(0, 0, amplval);
 					break;
@@ -502,5 +503,5 @@
 										ep->e_time = t_cur;
 										ep->e_type = EV_ANVL;
-										ep->e_data1 = 0x0040 | i;
+										ep->e_data1 = (int8_t)(0x0040 | i);
 										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
@@ -538,5 +539,5 @@
 										ep->e_time = t_cur;
 										ep->e_type = EV_ANVL;
-										ep->e_data1 = 0x0030 | i;
+										ep->e_data1 = (int8_t)(0x0030 | i);
 										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
