clang.patch 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. Description: Fix build with Clang
  2. Several issues are present:
  3. - Unused private elements.
  4. - Wrong use of delete.
  5. - Unsupported compiler options.
  6. - Shifting negative values.
  7. - Possible truncations.
  8. - Uninitialized variables.
  9. - Unused code.
  10. - Hiding overloaded virtual functions.
  11. - Declarations outside namespace.
  12. - Mismatched class tag.
  13. .
  14. Be careful editing this patch because allegrosmfwr.cpp has CRLF terminators.
  15. Author: Javier Serrano Polo <javier@jasp.net>
  16. Bug: https://github.com/LMMS/lmms/issues/3073
  17. Index: lmms-1.1.3/include/AutomatableModel.h
  18. ===================================================================
  19. --- lmms-1.1.3.orig/include/AutomatableModel.h 2017-01-03 13:01:47.000000000 +0100
  20. +++ lmms-1.1.3/include/AutomatableModel.h 2017-01-03 13:11:25.000000000 +0100
  21. @@ -307,7 +307,6 @@
  22. // most objects will need this temporarily (until sampleExact is
  23. // standard)
  24. - float m_oldValue;
  25. int m_setValueDepth;
  26. AutoModelVector m_linkedModels;
  27. Index: lmms-1.1.3/plugins/LadspaEffect/calf/CMakeLists.txt
  28. ===================================================================
  29. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/CMakeLists.txt 2017-01-03 16:03:14.000000000 +0100
  30. +++ lmms-1.1.3/plugins/LadspaEffect/calf/CMakeLists.txt 2017-01-03 16:14:28.000000000 +0100
  31. @@ -7,11 +7,22 @@
  32. "${CMAKE_CURRENT_SOURCE_DIR}/src")
  33. INSTALL(TARGETS calf LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa")
  34. SET_TARGET_PROPERTIES(calf PROPERTIES PREFIX "")
  35. +
  36. SET(INLINE_FLAGS "")
  37. -IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  38. -SET(INLINE_FLAGS "-finline-functions-called-once -finline-limit=80")
  39. +
  40. +INCLUDE(CheckCXXCompilerFlag)
  41. +CHECK_CXX_COMPILER_FLAG(-finline-functions CXX_HAVE_INLINE_FUNCTIONS)
  42. +IF(${CXX_HAVE_INLINE_FUNCTIONS})
  43. + SET(INLINE_FLAGS "${INLINE_FLAGS} -finline-functions")
  44. ENDIF()
  45. -SET_TARGET_PROPERTIES(calf PROPERTIES COMPILE_FLAGS "-O2 -finline-functions ${INLINE_FLAGS}")
  46. +CHECK_CXX_COMPILER_FLAG(-finline-functions-called-once
  47. + CXX_HAVE_INLINE_FUNCTIONS_CALLED_ONCE)
  48. +IF(${CXX_HAVE_INLINE_FUNCTIONS_CALLED_ONCE})
  49. + SET(INLINE_FLAGS "${INLINE_FLAGS} -finline-functions-called-once \
  50. + -finline-limit=80")
  51. +ENDIF()
  52. +
  53. +SET_TARGET_PROPERTIES(calf PROPERTIES COMPILE_FLAGS "-O2 ${INLINE_FLAGS}")
  54. IF(LMMS_BUILD_WIN32)
  55. ADD_CUSTOM_COMMAND(TARGET calf POST_BUILD COMMAND "${STRIP}" "\"${CMAKE_CURRENT_BINARY_DIR}/calf.dll\"")
  56. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/metadata.h
  57. ===================================================================
  58. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/calf/metadata.h 2017-01-03 17:41:17.000000000 +0100
  59. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/metadata.h 2017-01-03 17:50:40.000000000 +0100
  60. @@ -51,7 +51,7 @@
  61. enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, rt_capable = true, require_midi = false, support_midi = false };
  62. PLUGIN_NAME_ID_LABEL("filter", "filter", "Filter")
  63. /// do not export mode and inertia as CVs, as those are settings and not parameters
  64. - bool is_cv(int param_no) { return param_no != par_mode && param_no != par_inertia; }
  65. + bool is_cv(int param_no) const { return param_no != par_mode && param_no != par_inertia; }
  66. };
  67. /// Filterclavier - metadata
  68. @@ -61,7 +61,7 @@
  69. enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, rt_capable = true, require_midi = true, support_midi = true };
  70. PLUGIN_NAME_ID_LABEL("filterclavier", "filterclavier", "Filterclavier")
  71. /// do not export mode and inertia as CVs, as those are settings and not parameters
  72. - bool is_cv(int param_no) { return param_no != par_mode && param_no != par_inertia; }
  73. + bool is_cv(int param_no) const { return param_no != par_mode && param_no != par_inertia; }
  74. };
  75. struct reverb_metadata: public plugin_metadata<reverb_metadata>
  76. @@ -499,7 +499,7 @@
  77. PLUGIN_NAME_ID_LABEL("organ", "organ", "Organ")
  78. public:
  79. - plugin_command_info *get_commands();
  80. + plugin_command_info *get_commands() const;
  81. const char *const *get_configure_vars() const;
  82. };
  83. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/modules.h
  84. ===================================================================
  85. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/calf/modules.h 2017-01-03 19:02:59.000000000 +0100
  86. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/modules.h 2017-01-03 19:30:35.000000000 +0100
  87. @@ -89,13 +89,14 @@
  88. using audio_module<Metadata>::ins;
  89. using audio_module<Metadata>::outs;
  90. using audio_module<Metadata>::params;
  91. + using FilterClass::calculate_filter;
  92. dsp::inertia<dsp::exponential_ramp> inertia_cutoff, inertia_resonance, inertia_gain;
  93. dsp::once_per_n timer;
  94. bool is_active;
  95. mutable volatile int last_generation, last_calculated_generation;
  96. - filter_module_with_inertia(float **ins, float **outs, float **params)
  97. + filter_module_with_inertia()
  98. : inertia_cutoff(dsp::exponential_ramp(128), 20)
  99. , inertia_resonance(dsp::exponential_ramp(128), 20)
  100. , inertia_gain(dsp::exponential_ramp(128), 1.0)
  101. @@ -193,7 +194,7 @@
  102. mutable float old_cutoff, old_resonance, old_mode;
  103. public:
  104. filter_audio_module()
  105. - : filter_module_with_inertia<dsp::biquad_filter_module, filter_metadata>(ins, outs, params)
  106. + : filter_module_with_inertia<dsp::biquad_filter_module, filter_metadata>()
  107. {
  108. last_generation = 0;
  109. old_mode = old_resonance = old_cutoff = -1;
  110. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/modules_comp.h
  111. ===================================================================
  112. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/calf/modules_comp.h 2017-01-03 19:35:53.000000000 +0100
  113. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/modules_comp.h 2017-01-03 19:38:06.000000000 +0100
  114. @@ -39,10 +39,10 @@
  115. class gain_reduction_audio_module
  116. {
  117. private:
  118. - float linSlope, detected, kneeSqrt, kneeStart, linKneeStart, kneeStop;
  119. + float linSlope, detected, kneeStart, linKneeStart, kneeStop;
  120. float compressedKneeStop, adjKneeStart, thres;
  121. float attack, release, threshold, ratio, knee, makeup, detection, stereo_link, bypass, mute, meter_out, meter_comp;
  122. - mutable float old_threshold, old_ratio, old_knee, old_makeup, old_bypass, old_mute, old_detection, old_stereo_link;
  123. + mutable float old_threshold, old_ratio, old_knee, old_makeup, old_bypass, old_mute, old_detection;
  124. mutable volatile int last_generation;
  125. uint32_t srate;
  126. bool is_active;
  127. @@ -69,7 +69,7 @@
  128. /// Main gate routine by Damien called by various audio modules
  129. class expander_audio_module {
  130. private:
  131. - float linSlope, peak, detected, kneeSqrt, kneeStart, linKneeStart, kneeStop, linKneeStop;
  132. + float linSlope, detected, kneeStart, linKneeStart, kneeStop, linKneeStop;
  133. float compressedKneeStop, adjKneeStart, range, thres, attack_coeff, release_coeff;
  134. float attack, release, threshold, ratio, knee, makeup, detection, stereo_link, bypass, mute, meter_out, meter_gate;
  135. mutable float old_threshold, old_ratio, old_knee, old_makeup, old_bypass, old_range, old_trigger, old_mute, old_detection, old_stereo_link;
  136. @@ -142,7 +142,7 @@
  137. mutable float f1_freq_old, f2_freq_old, f1_level_old, f2_level_old;
  138. mutable float f1_freq_old1, f2_freq_old1, f1_level_old1, f2_level_old1;
  139. CalfScModes sc_mode;
  140. - mutable CalfScModes sc_mode_old, sc_mode_old1;
  141. + mutable CalfScModes sc_mode_old1;
  142. float f1_active, f2_active;
  143. stereo_in_out_metering<sidechaincompressor_metadata> meters;
  144. gain_reduction_audio_module compressor;
  145. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/modules_limit.h
  146. ===================================================================
  147. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/calf/modules_limit.h 2017-01-03 19:39:00.000000000 +0100
  148. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/modules_limit.h 2017-01-03 19:40:20.000000000 +0100
  149. @@ -37,7 +37,6 @@
  150. private:
  151. typedef limiter_audio_module AM;
  152. uint32_t clip_inL, clip_inR, clip_outL, clip_outR, asc_led;
  153. - int mode, mode_old;
  154. float meter_inL, meter_inR, meter_outL, meter_outR;
  155. dsp::lookahead_limiter limiter;
  156. public:
  157. @@ -73,7 +72,6 @@
  158. unsigned int overall_buffer_size;
  159. float *buffer;
  160. int channels;
  161. - float striprel[strips];
  162. float weight[strips];
  163. float weight_old[strips];
  164. float limit_old;
  165. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/modules_mod.h
  166. ===================================================================
  167. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/calf/modules_mod.h 2017-01-03 19:41:55.000000000 +0100
  168. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/modules_mod.h 2017-01-03 19:42:19.000000000 +0100
  169. @@ -160,8 +160,6 @@
  170. typedef pulsator_audio_module AM;
  171. uint32_t clip_inL, clip_inR, clip_outL, clip_outR;
  172. float meter_inL, meter_inR, meter_outL, meter_outR;
  173. - float offset_old;
  174. - int mode_old;
  175. bool clear_reset;
  176. dsp::simple_lfo lfoL, lfoR;
  177. public:
  178. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/organ.h
  179. ===================================================================
  180. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/calf/organ.h 2017-01-03 19:43:08.000000000 +0100
  181. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/organ.h 2017-01-03 19:53:55.000000000 +0100
  182. @@ -318,6 +318,7 @@
  183. using drawbar_organ::note_on;
  184. using drawbar_organ::note_off;
  185. using drawbar_organ::control_change;
  186. + using drawbar_organ::pitch_bend;
  187. enum { param_count = drawbar_organ::param_count};
  188. dsp::organ_parameters par_values;
  189. uint32_t srate;
  190. @@ -338,9 +339,9 @@
  191. void deactivate();
  192. uint32_t process(uint32_t offset, uint32_t nsamples, uint32_t inputs_mask, uint32_t outputs_mask);
  193. /// No CV inputs for now
  194. - bool is_cv(int param_no) { return false; }
  195. + bool is_cv(int param_no) const { return false; }
  196. /// Practically all the stuff here is noisy
  197. - bool is_noisy(int param_no) { return true; }
  198. + bool is_noisy(int param_no) const { return true; }
  199. void execute(int cmd_no);
  200. bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context) const;
  201. char *configure(const char *key, const char *value);
  202. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/preset.h
  203. ===================================================================
  204. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/calf/preset.h 2017-01-03 19:57:02.000000000 +0100
  205. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/preset.h 2017-01-03 20:00:25.000000000 +0100
  206. @@ -27,7 +27,7 @@
  207. namespace calf_plugins {
  208. -class plugin_ctl_iface;
  209. +struct plugin_ctl_iface;
  210. /// Contents of single preset
  211. struct plugin_preset
  212. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/primitives.h
  213. ===================================================================
  214. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/calf/primitives.h 2017-01-03 17:36:12.000000000 +0100
  215. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/calf/primitives.h 2017-01-03 16:22:16.000000000 +0100
  216. @@ -370,11 +370,6 @@
  217. next_task = (unsigned)-1;
  218. eob = false;
  219. }
  220. - inline bool is_next_tick() {
  221. - if (time < next_task)
  222. - return true;
  223. - do_tasks();
  224. - }
  225. inline void next_tick() {
  226. time++;
  227. }
  228. @@ -382,14 +377,6 @@
  229. timeline.insert(std::pair<unsigned int, task *>(time+pos, t));
  230. next_task = timeline.begin()->first;
  231. }
  232. - void do_tasks() {
  233. - std::multimap<unsigned int, task *>::iterator i = timeline.begin();
  234. - while(i != timeline.end() && i->first == time) {
  235. - i->second->execute(this);
  236. - i->second->dispose();
  237. - timeline.erase(i);
  238. - }
  239. - }
  240. bool is_eob() {
  241. return eob;
  242. }
  243. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/metadata.cpp
  244. ===================================================================
  245. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/metadata.cpp 2017-01-03 17:52:03.000000000 +0100
  246. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/metadata.cpp 2017-01-03 18:49:18.000000000 +0100
  247. @@ -29,6 +29,8 @@
  248. const char *calf_plugins::calf_copyright_info = "(C) 2001-2009 Krzysztof Foltman, Thor Harald Johanssen, Markus Schmidt and others; license: LGPL";
  249. +namespace calf_plugins {
  250. +
  251. ////////////////////////////////////////////////////////////////////////////
  252. CALF_PORT_NAMES(flanger) = {"In L", "In R", "Out L", "Out R"};
  253. @@ -1105,7 +1107,7 @@
  254. CALF_PLUGIN_INFO(organ) = { 0x8481, "Organ", "Calf Organ", "Krzysztof Foltman", calf_plugins::calf_copyright_info, "SynthesizerPlugin" };
  255. -plugin_command_info *organ_metadata::get_commands()
  256. +plugin_command_info *organ_metadata::get_commands() const
  257. {
  258. static plugin_command_info cmds[] = {
  259. { "cmd_panic", "Panic!", "Stop all sounds and reset all controllers" },
  260. @@ -1439,6 +1441,8 @@
  261. ////////////////////////////////////////////////////////////////////////////
  262. +}; // namespace calf_plugins
  263. +
  264. calf_plugins::plugin_registry::plugin_registry()
  265. {
  266. #define PER_MODULE_ITEM(name, isSynth, jackname) plugins.push_back((new name##_metadata));
  267. Index: lmms-1.1.3/plugins/LadspaEffect/calf/src/modules.cpp
  268. ===================================================================
  269. --- lmms-1.1.3.orig/plugins/LadspaEffect/calf/src/modules.cpp 2017-01-03 19:32:38.000000000 +0100
  270. +++ lmms-1.1.3/plugins/LadspaEffect/calf/src/modules.cpp 2017-01-03 19:33:13.000000000 +0100
  271. @@ -339,7 +339,7 @@
  272. ///////////////////////////////////////////////////////////////////////////////////////////////
  273. filterclavier_audio_module::filterclavier_audio_module()
  274. -: filter_module_with_inertia<biquad_filter_module, filterclavier_metadata>(ins, outs, params)
  275. +: filter_module_with_inertia<biquad_filter_module, filterclavier_metadata>()
  276. , min_gain(1.0)
  277. , max_gain(32.0)
  278. , last_note(-1)
  279. Index: lmms-1.1.3/plugins/LadspaEffect/swh/flanger_1191.c
  280. ===================================================================
  281. --- lmms-1.1.3.orig/plugins/LadspaEffect/swh/flanger_1191.c 2017-01-03 15:44:13.000000000 +0100
  282. +++ lmms-1.1.3/plugins/LadspaEffect/swh/flanger_1191.c 2017-01-03 15:45:17.000000000 +0100
  283. @@ -266,7 +266,7 @@
  284. // Calculate position in delay table
  285. d_base = LIN_INTERP(frac, old_d_base, new_d_base);
  286. - n_ph = (float)(law_p - abs(next_law_pos - count))/(float)law_p;
  287. + n_ph = (float)(law_p - labs(next_law_pos - count))/(float)law_p;
  288. p_ph = n_ph + 0.5f;
  289. while (p_ph > 1.0f) {
  290. p_ph -= 1.0f;
  291. @@ -392,7 +392,7 @@
  292. // Calculate position in delay table
  293. d_base = LIN_INTERP(frac, old_d_base, new_d_base);
  294. - n_ph = (float)(law_p - abs(next_law_pos - count))/(float)law_p;
  295. + n_ph = (float)(law_p - labs(next_law_pos - count))/(float)law_p;
  296. p_ph = n_ph + 0.5f;
  297. while (p_ph > 1.0f) {
  298. p_ph -= 1.0f;
  299. Index: lmms-1.1.3/plugins/LadspaEffect/swh/gsm/short_term.c
  300. ===================================================================
  301. --- lmms-1.1.3.orig/plugins/LadspaEffect/swh/gsm/short_term.c 2017-01-03 15:35:13.000000000 +0100
  302. +++ lmms-1.1.3/plugins/LadspaEffect/swh/gsm/short_term.c 2017-01-03 15:35:55.000000000 +0100
  303. @@ -53,7 +53,7 @@
  304. #undef STEP
  305. #define STEP( B, MIC, INVA ) \
  306. temp1 = GSM_ADD( *LARc++, MIC ) << 10; \
  307. - temp1 = GSM_SUB( temp1, B << 1 ); \
  308. + temp1 = GSM_SUB( temp1, B * 2 ); \
  309. temp1 = GSM_MULT_R( INVA, temp1 ); \
  310. *LARpp++ = GSM_ADD( temp1, temp1 );
  311. Index: lmms-1.1.3/plugins/LadspaEffect/swh/multivoice_chorus_1201.c
  312. ===================================================================
  313. --- lmms-1.1.3.orig/plugins/LadspaEffect/swh/multivoice_chorus_1201.c 2017-01-03 15:47:51.000000000 +0100
  314. +++ lmms-1.1.3/plugins/LadspaEffect/swh/multivoice_chorus_1201.c 2017-01-03 15:48:18.000000000 +0100
  315. @@ -345,7 +345,7 @@
  316. if (count % 16 < laws) {
  317. unsigned int t = count % 16;
  318. // Calculate sinus phases
  319. - float n_ph = (float)(law_p - abs(next_peak_pos[t] - count))/law_p;
  320. + float n_ph = (float)(law_p - labs(next_peak_pos[t] - count))/law_p;
  321. float p_ph = n_ph + 0.5f;
  322. if (p_ph > 1.0f) {
  323. p_ph -= 1.0f;
  324. @@ -488,7 +488,7 @@
  325. if (count % 16 < laws) {
  326. unsigned int t = count % 16;
  327. // Calculate sinus phases
  328. - float n_ph = (float)(law_p - abs(next_peak_pos[t] - count))/law_p;
  329. + float n_ph = (float)(law_p - labs(next_peak_pos[t] - count))/law_p;
  330. float p_ph = n_ph + 0.5f;
  331. if (p_ph > 1.0f) {
  332. p_ph -= 1.0f;
  333. Index: lmms-1.1.3/plugins/LadspaEffect/swh/retro_flange_1208.c
  334. ===================================================================
  335. --- lmms-1.1.3.orig/plugins/LadspaEffect/swh/retro_flange_1208.c 2017-01-03 15:46:35.000000000 +0100
  336. +++ lmms-1.1.3/plugins/LadspaEffect/swh/retro_flange_1208.c 2017-01-03 15:47:02.000000000 +0100
  337. @@ -321,7 +321,7 @@
  338. prev_law_pos = count + law_p;
  339. }
  340. - n_ph = (float)(law_p - abs(next_law_pos - count))/(float)law_p;
  341. + n_ph = (float)(law_p - labs(next_law_pos - count))/(float)law_p;
  342. p_ph = n_ph + 0.5f;
  343. if (p_ph > 1.0f) {
  344. p_ph -= 1.0f;
  345. @@ -446,7 +446,7 @@
  346. prev_law_pos = count + law_p;
  347. }
  348. - n_ph = (float)(law_p - abs(next_law_pos - count))/(float)law_p;
  349. + n_ph = (float)(law_p - labs(next_law_pos - count))/(float)law_p;
  350. p_ph = n_ph + 0.5f;
  351. if (p_ph > 1.0f) {
  352. p_ph -= 1.0f;
  353. Index: lmms-1.1.3/plugins/LadspaEffect/swh/vynil_1905.c
  354. ===================================================================
  355. --- lmms-1.1.3.orig/plugins/LadspaEffect/swh/vynil_1905.c 2017-01-03 15:51:56.000000000 +0100
  356. +++ lmms-1.1.3/plugins/LadspaEffect/swh/vynil_1905.c 2017-01-03 16:01:32.000000000 +0100
  357. @@ -243,6 +243,8 @@
  358. buffer_s = malloc(sizeof(LADSPA_Data) * buffer_size);
  359. buffer_mask = buffer_size - 1;
  360. buffer_pos = 0;
  361. + click_buffer_omega.all = 0;
  362. + click_buffer_pos.all = 0;
  363. click_gain = 0;
  364. phi = 0.0f; /* Angular phase */
  365. Index: lmms-1.1.3/plugins/LadspaEffect/tap/CMakeLists.txt
  366. ===================================================================
  367. --- lmms-1.1.3.orig/plugins/LadspaEffect/tap/CMakeLists.txt 2017-01-03 13:52:28.000000000 +0100
  368. +++ lmms-1.1.3/plugins/LadspaEffect/tap/CMakeLists.txt 2017-01-03 15:12:14.000000000 +0100
  369. @@ -1,7 +1,15 @@
  370. INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
  371. FILE(GLOB PLUGIN_SOURCES *.c)
  372. LIST(SORT PLUGIN_SOURCES)
  373. -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -fomit-frame-pointer -fno-strict-aliasing -fstrength-reduce -funroll-loops -ffast-math")
  374. +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings \
  375. + -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
  376. +
  377. +INCLUDE(CheckCCompilerFlag)
  378. +CHECK_C_COMPILER_FLAG(-fstrength-reduce C_HAVE_STRENGTH_REDUCE)
  379. +IF(${C_HAVE_STRENGTH_REDUCE})
  380. + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstrength-reduce")
  381. +ENDIF()
  382. +
  383. FOREACH(_item ${PLUGIN_SOURCES})
  384. GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE)
  385. ADD_LIBRARY("${_plugin}" MODULE "${_item}")
  386. Index: lmms-1.1.3/plugins/MidiImport/portsmf/allegro.h
  387. ===================================================================
  388. --- lmms-1.1.3.orig/plugins/MidiImport/portsmf/allegro.h 2017-01-03 20:02:37.000000000 +0100
  389. +++ lmms-1.1.3/plugins/MidiImport/portsmf/allegro.h 2017-01-03 20:06:48.000000000 +0100
  390. @@ -842,6 +842,8 @@
  391. Alg_event_ptr write_track_name(std::ostream &file, int n,
  392. Alg_events &events);
  393. public:
  394. + using Alg_track::paste;
  395. +
  396. int channel_offset_per_track; // used to encode track_num into channel
  397. Alg_tracks track_list; // array of Alg_events
  398. Alg_time_sigs time_sig;
  399. Index: lmms-1.1.3/plugins/MidiImport/portsmf/allegrosmfwr.cpp
  400. ===================================================================
  401. --- lmms-1.1.3.orig/plugins/MidiImport/portsmf/allegrosmfwr.cpp 2017-01-03 20:07:50.000000000 +0100
  402. +++ lmms-1.1.3/plugins/MidiImport/portsmf/allegrosmfwr.cpp 2017-01-03 20:08:34.000000000 +0100
  403. @@ -57,13 +57,11 @@
  404. Alg_seq_ptr seq;
  405. - int num_tracks; // number of tracks not counting tempo track
  406. int division; // divisions per quarter note, default = 120
  407. int initial_tempo;
  408. int timesig_num; // numerator of time signature
  409. int timesig_den; // denominator of time signature
  410. - double timesig_when; // time of time signature
  411. int keysig; // number of sharps (+) or flats (-), -99 for undefined
  412. char keysig_mode; // 'M' or 'm' for major/minor
  413. Index: lmms-1.1.3/plugins/delay/stereodelay.cpp
  414. ===================================================================
  415. --- lmms-1.1.3.orig/plugins/delay/stereodelay.cpp 2017-01-03 13:40:27.000000000 +0100
  416. +++ lmms-1.1.3/plugins/delay/stereodelay.cpp 2017-01-03 13:42:16.000000000 +0100
  417. @@ -48,7 +48,7 @@
  418. {
  419. if( m_buffer )
  420. {
  421. - delete m_buffer;
  422. + delete[] m_buffer;
  423. }
  424. }
  425. @@ -84,7 +84,7 @@
  426. {
  427. if( m_buffer )
  428. {
  429. - delete m_buffer;
  430. + delete[] m_buffer;
  431. }
  432. int bufferSize = ( int )( sampleRate * m_maxTime );
  433. Index: lmms-1.1.3/plugins/opl2/fmopl.c
  434. ===================================================================
  435. --- lmms-1.1.3.orig/plugins/opl2/fmopl.c 2017-01-03 20:11:03.000000000 +0100
  436. +++ lmms-1.1.3/plugins/opl2/fmopl.c 2017-01-03 20:22:23.000000000 +0100
  437. @@ -70,7 +70,7 @@
  438. /* final output shift , limit minimum and maximum */
  439. #define OPL_OUTSB (TL_BITS+3-16) /* OPL output final shift 16bit */
  440. #define OPL_MAXOUT (0x7fff<<OPL_OUTSB)
  441. -#define OPL_MINOUT (-0x8000<<OPL_OUTSB)
  442. +#define OPL_MINOUT (~((0x8000<<OPL_OUTSB)-1))
  443. /* -------------------- quality selection --------------------- */
  444. Index: lmms-1.1.3/src/core/track.cpp
  445. ===================================================================
  446. --- lmms-1.1.3.orig/src/core/track.cpp 2017-01-03 13:16:46.000000000 +0100
  447. +++ lmms-1.1.3/src/core/track.cpp 2017-01-03 13:18:33.000000000 +0100
  448. @@ -75,11 +75,6 @@
  449. */
  450. const int RESIZE_GRIP_WIDTH = 4;
  451. -/*! The size of the track buttons in pixels
  452. - */
  453. -const int TRACK_OP_BTN_WIDTH = 20;
  454. -const int TRACK_OP_BTN_HEIGHT = 14;
  455. -
  456. /*! A pointer for that text bubble used when moving segments, etc.
  457. *
  458. Index: lmms-1.1.3/src/gui/LfoControllerDialog.cpp
  459. ===================================================================
  460. --- lmms-1.1.3.orig/src/gui/LfoControllerDialog.cpp 2017-01-03 13:24:43.000000000 +0100
  461. +++ lmms-1.1.3/src/gui/LfoControllerDialog.cpp 2017-01-03 13:25:24.000000000 +0100
  462. @@ -50,7 +50,6 @@
  463. const int CD_LFO_SHAPES_X = 6;
  464. const int CD_LFO_SHAPES_Y = 36;
  465. -const int CD_LFO_GRAPH_X = 6;
  466. const int CD_LFO_GRAPH_Y = CD_ENV_KNOBS_LBL_Y+15;
  467. const int CD_LFO_CD_KNOB_Y = CD_LFO_GRAPH_Y-2;
  468. const int CD_LFO_BASE_CD_KNOB_X = CD_LFO_SHAPES_X + 64;
  469. Index: lmms-1.1.3/src/gui/LmmsStyle.cpp
  470. ===================================================================
  471. --- lmms-1.1.3.orig/src/gui/LmmsStyle.cpp 2017-01-03 13:27:38.000000000 +0100
  472. +++ lmms-1.1.3/src/gui/LmmsStyle.cpp 2017-01-03 13:29:35.000000000 +0100
  473. @@ -34,78 +34,6 @@
  474. #include "LmmsStyle.h"
  475. #include "LmmsPalette.h"
  476. -const int BUTTON_LENGTH = 24;
  477. -
  478. -static const char * const s_scrollbarArrowUpXpm[] = {
  479. - "7 6 8 1",
  480. - " g None",
  481. - ". g #000000",
  482. - "+ g #101010",
  483. - "@ g #A0A0A0",
  484. - "# g #C0C0C0",
  485. - "$ g #FFFFFF",
  486. - "% g #808080",
  487. - "& g #202020",
  488. - "..+@+..",
  489. - "..#$#..",
  490. - ".%$$$%.",
  491. - "&$$$$$&",
  492. - "@$$$$$@",
  493. - "@#####@"};
  494. -
  495. -static const char * const s_scrollbarArrowRightXpm[] = {
  496. - "6 7 8 1",
  497. - " c None",
  498. - ". c #A0A0A0",
  499. - "+ c #202020",
  500. - "@ c #000000",
  501. - "# c #C0C0C0",
  502. - "$ c #FFFFFF",
  503. - "% c #808080",
  504. - "& c #101010",
  505. - "..+@@@",
  506. - "#$$%@@",
  507. - "#$$$#&",
  508. - "#$$$$.",
  509. - "#$$$#&",
  510. - "#$$%@@",
  511. - "..+@@@"};
  512. -
  513. -static const char * const s_scrollbarArrowDownXpm[] = {
  514. - "7 6 8 1",
  515. - " g None",
  516. - ". g #000000",
  517. - "+ g #101010",
  518. - "@ g #A0A0A0",
  519. - "# g #C0C0C0",
  520. - "$ g #FFFFFF",
  521. - "% g #808080",
  522. - "& g #202020",
  523. - "@#####@",
  524. - "@$$$$$@",
  525. - "&$$$$$&",
  526. - ".%$$$%.",
  527. - "..#$#..",
  528. - "..+@+.."};
  529. -
  530. -static const char * const s_scrollbarArrowLeftXpm[] = {
  531. - "6 7 8 1",
  532. - " g None",
  533. - ". g #000000",
  534. - "+ g #202020",
  535. - "@ g #A0A0A0",
  536. - "# g #808080",
  537. - "$ g #FFFFFF",
  538. - "% g #C0C0C0",
  539. - "& g #101010",
  540. - "...+@@",
  541. - "..#$$%",
  542. - "&%$$$%",
  543. - "@$$$$%",
  544. - "&%$$$%",
  545. - "..#$$%",
  546. - "...+@@"};
  547. -
  548. QPalette * LmmsStyle::s_palette = NULL;
  549. QLinearGradient getGradient( const QColor & _col, const QRectF & _rect )
  550. Index: lmms-1.1.3/src/gui/PianoRoll.cpp
  551. ===================================================================
  552. --- lmms-1.1.3.orig/src/gui/PianoRoll.cpp 2017-01-03 13:30:47.000000000 +0100
  553. +++ lmms-1.1.3/src/gui/PianoRoll.cpp 2017-01-03 13:34:14.000000000 +0100
  554. @@ -88,7 +88,6 @@
  555. const int PIANO_X = 0;
  556. const int WHITE_KEY_WIDTH = 64;
  557. -const int BLACK_KEY_WIDTH = 41;
  558. const int WHITE_KEY_SMALL_HEIGHT = 18;
  559. const int WHITE_KEY_BIG_HEIGHT = 24;
  560. const int BLACK_KEY_HEIGHT = 16;