@@ -123,7 +123,7 @@ void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsam
123123// * @param output buffer of 2*numsamples elements (A left and right value for each sample)
124124// * @param numsamples number of samples to generate
125125void jar_xm_generate_samples_16bit (jar_xm_context_t * ctx , short * output , size_t numsamples ) {
126- float * musicBuffer = (float * )JARXM_MALLOC ((2 * numsamples )* sizeof (float ));
126+ float * musicBuffer = (float * )JARXM_MALLOC ((2 * numsamples )* sizeof (float ));
127127 jar_xm_generate_samples (ctx , musicBuffer , numsamples );
128128
129129 if (output ){
@@ -136,7 +136,7 @@ void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t
136136// * @param output buffer of 2*numsamples elements (A left and right value for each sample)
137137// * @param numsamples number of samples to generate
138138void jar_xm_generate_samples_8bit (jar_xm_context_t * ctx , char * output , size_t numsamples ) {
139- float * musicBuffer = (float * )JARXM_MALLOC ((2 * numsamples )* sizeof (float ));
139+ float * musicBuffer = (float * )JARXM_MALLOC ((2 * numsamples )* sizeof (float ));
140140 jar_xm_generate_samples (ctx , musicBuffer , numsamples );
141141
142142 if (output ){
@@ -543,7 +543,7 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
543543#endif
544544
545545 bytes_needed = jar_xm_get_memory_needed_for_context (moddata , moddata_length );
546- mempool = (char * )JARXM_MALLOC (bytes_needed );
546+ mempool = (char * )JARXM_MALLOC (bytes_needed );
547547 if (mempool == NULL && bytes_needed > 0 ) { /* JARXM_MALLOC() failed, trouble ahead */
548548 DEBUG ("call to JARXM_MALLOC() failed, returned %p" , (void * )mempool );
549549 return 2 ;
@@ -558,11 +558,11 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
558558
559559 ctx -> rate = rate ;
560560 mempool = jar_xm_load_module (ctx , moddata , moddata_length , mempool );
561- mempool = (char * )ALIGN_PTR (mempool , 16 );
561+ mempool = (char * )ALIGN_PTR (mempool , 16 );
562562
563563 ctx -> channels = (jar_xm_channel_context_t * )mempool ;
564564 mempool += ctx -> module .num_channels * sizeof (jar_xm_channel_context_t );
565- mempool = (char * )ALIGN_PTR (mempool , 16 );
565+ mempool = (char * )ALIGN_PTR (mempool , 16 );
566566
567567 ctx -> default_global_volume = 1.f ;
568568 ctx -> global_volume = ctx -> default_global_volume ;
@@ -583,7 +583,7 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
583583 ch -> actual_panning = .5f ;
584584 }
585585
586- mempool = (char * )ALIGN_PTR (mempool , 16 );
586+ mempool = (char * )ALIGN_PTR (mempool , 16 );
587587 ctx -> row_loop_count = (uint8_t * )mempool ;
588588 mempool += MAX_NUM_ROWS * sizeof (uint8_t );
589589
@@ -681,14 +681,14 @@ uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t *ctx, uint16_t ch
681681
682682//* Bound reader macros.
683683//* If we attempt to read the buffer out-of-bounds, pretend that the buffer is infinitely padded with zeroes.
684- #define READ_U8 (offset ) (((offset) < moddata_length) ? (*(uint8_t*)(moddata + (offset))) : 0)
684+ #define READ_U8 (offset ) (((offset) < moddata_length) ? (*(uint8_t *)(moddata + (offset))) : 0)
685685#define READ_U16 (offset ) ((uint16_t)READ_U8(offset) | ((uint16_t)READ_U8((offset) + 1) << 8))
686686#define READ_U32 (offset ) ((uint32_t)READ_U16(offset) | ((uint32_t)READ_U16((offset) + 2) << 16))
687687#define READ_MEMCPY (ptr , offset , length ) memcpy_pad(ptr, length, moddata, moddata_length, offset)
688688
689689static void memcpy_pad (void * dst , size_t dst_len , const void * src , size_t src_len , size_t offset ) {
690690 uint8_t * dst_c = (uint8_t * )dst ;
691- const uint8_t * src_c = (uint8_t * )src ;
691+ const uint8_t * src_c = (uint8_t * )src ;
692692
693693 /* how many bytes can be copied without overrunning `src` */
694694 size_t copy_bytes = (src_len >= offset ) ? (src_len - offset ) : 0 ;
@@ -808,10 +808,10 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
808808 mod -> linear_interpolation = 1 ; // Linear interpolation can be set after loading
809809 mod -> ramping = 1 ; // ramping can be set after loading
810810 mempool += mod -> num_patterns * sizeof (jar_xm_pattern_t );
811- mempool = (char * )ALIGN_PTR (mempool , 16 );
811+ mempool = (char * )ALIGN_PTR (mempool , 16 );
812812 mod -> instruments = (jar_xm_instrument_t * )mempool ;
813813 mempool += mod -> num_instruments * sizeof (jar_xm_instrument_t );
814- mempool = (char * )ALIGN_PTR (mempool , 16 );
814+ mempool = (char * )ALIGN_PTR (mempool , 16 );
815815 uint16_t flags = READ_U32 (offset + 14 );
816816 mod -> frequency_type = (flags & (1 << 0 )) ? jar_xm_LINEAR_FREQUENCIES : jar_xm_AMIGA_FREQUENCIES ;
817817 ctx -> default_tempo = READ_U16 (offset + 16 );
@@ -884,7 +884,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
884884
885885 offset += packed_patterndata_size ;
886886 }
887- mempool = (char * )ALIGN_PTR (mempool , 16 );
887+ mempool = (char * )ALIGN_PTR (mempool , 16 );
888888
889889 /* Read instruments */
890890 for (uint16_t i = 0 ; i < ctx -> module .num_instruments ; ++ i ) {
@@ -928,7 +928,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
928928 instr -> panning_envelope .enabled = flags & (1 << 0 );
929929 instr -> panning_envelope .sustain_enabled = flags & (1 << 1 );
930930 instr -> panning_envelope .loop_enabled = flags & (1 << 2 );
931- instr -> vibrato_type = (jar_xm_waveform_type_t )READ_U8 (offset + 235 );
931+ instr -> vibrato_type = (jar_xm_waveform_type_t )READ_U8 (offset + 235 );
932932 if (instr -> vibrato_type == 2 ) {
933933 instr -> vibrato_type = (jar_xm_waveform_type_t )1 ;
934934 } else if (instr -> vibrato_type == 1 ) {
@@ -976,7 +976,7 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
976976 sample -> panning = (float )READ_U8 (offset + 15 ) / 255.f ;
977977 sample -> relative_note = (int8_t )READ_U8 (offset + 16 );
978978 READ_MEMCPY (sample -> name , 18 , SAMPLE_NAME_LENGTH );
979- sample -> data = (float * )mempool ;
979+ sample -> data = (float * )mempool ;
980980 if (sample -> bits == 16 ) {
981981 /* 16 bit sample */
982982 mempool += sample -> length * (sizeof (float ) >> 1 );
@@ -2223,7 +2223,7 @@ int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const
22232223 return 4 ;
22242224 }
22252225
2226- char * data = (char * )JARXM_MALLOC (size + 1 );
2226+ char * data = (char * )JARXM_MALLOC (size + 1 );
22272227 if (!data || fread (data , 1 , size , xmf ) < size ) {
22282228 fclose (xmf );
22292229 DEBUG_ERR (data ? "fread() failed" : "JARXM_MALLOC() failed" );
0 commit comments