shithub: orca

Download patch

ref: 697c5987dc157c4d6e6b18c2606e17334a22905b
parent: 44f547d355521ab4921c12b89e9e1061b6a4c8d9
author: cancel <cancel@cancel.fm>
date: Tue Jan 22 03:23:39 EST 2019

Remove 'usz_clamp()', no longer needed

--- a/sim.c
+++ b/sim.c
@@ -90,6 +90,7 @@
   return false;
 }
 
+// Returns UINT8_MAX if not a valid note.
 static U8 midi_note_number_of(Glyph g) {
   switch (g) {
   case 'C':
@@ -155,15 +156,6 @@
   mbuffer[offs] |= Mark_flag_sleep;
 }
 
-ORCA_FORCE_STATIC_INLINE
-Usz usz_clamp(Usz val, Usz min, Usz max) {
-  if (val < min)
-    return min;
-  if (val > max)
-    return max;
-  return val;
-}
-
 #define OPER_FUNCTION_ATTRIBS ORCA_FORCE_NO_INLINE static void
 
 #define BEGIN_OPERATOR(_oper_name)                                             \
@@ -364,7 +356,7 @@
       (Oevent_midi*)oevent_list_alloc_item(extra_params->oevent_list);
   oe->oevent_type = (U8)Oevent_type_midi;
   oe->channel = (U8)channel_num;
-  oe->octave = (U8)usz_clamp(octave_num, 1, 9);
+  oe->octave = octave_num;
   oe->note = note_num;
   oe->velocity = midi_velocity_of(velocity_g);
   oe->bar_divisor = (U8)(index_of(length_g) + 1);