History

update long/t_CKINT mismatches; address windows 64-bit warnings

Ge Wang committed 4 years ago

Commit bd96b1b1 parent 72e554b24 files · +189 −176Browse files

Unified · Split

24 files
  1. src/core/chuck_errmsg.cpp +1 −1
  2. src/core/chuck_frame.cpp +1 −1
  3. src/core/chuck_instr.cpp +2 −2
  4. src/core/chuck_instr.h +24 −24
  5. src/core/chuck_io.cpp +10 −10
  6. src/core/chuck_otf.cpp +5 −5
  7. src/core/chuck_otf.h +4 −3
  8. src/core/chuck_shell.cpp +7 −7
  9. src/core/chuck_symbol.cpp +2 −1
  10. src/core/chuck_table.cpp +15 −15
  11. src/core/chuck_utils.cpp +2 −1
  12. src/core/midiio_rtmidi.cpp +43 −43
  13. src/core/midiio_rtmidi.h +31 −31
  14. src/core/ugen_stk.cpp +2 −2
  15. src/core/ulib_opsc.cpp +6 −6
  16. src/core/ulib_regex.cpp +2 −3
  17. src/core/util_buffers.h +2 −2
  18. src/core/util_hid.cpp +3 −3
  19. src/core/util_math.c +3 −1
  20. src/core/util_math.h +4 −0
  21. src/core/util_opsc.cpp +9 −9
  22. src/core/util_sndfile.c +2 −1
  23. src/core/util_string.cpp +8 −4
  24. src/host/chuck_main.cpp +1 −1
src/core/chuck_errmsg.cpp+1−1
@@ -404,7 +404,7 @@ void EM_newline(void) · 403 unmodified lines
404404 // content after rightmost '/'
405405 const char * mini( const char * str )
406406 {
407− int len = strlen( str );
407+ t_CKINT len = strlen( str );
408408 const char * p = str + len;
409409 while( p != str && *p != '/' && *p != '\\' ) p--;
410410 return ( p == str || strlen(p+1) == 0 ? p : p+1 );
src/core/chuck_frame.cpp+1−1
@@ -108,7 +108,7 @@ void Chuck_Frame::get_scope( vector<Chuck_Local *> & out ) const · 107 unmodified lines
108108 // the local
109109 Chuck_Local * local = NULL;
110110 // the index
111− long index = this->stack.size() - 1;
111+ t_CKINT index = this->stack.size() - 1;
112112
113113 // loop
114114 while( index >= 0 && this->stack[index] != NULL )
src/core/chuck_instr.cpp+2−2
@@ -4064,7 +4064,7 @@ const char * Chuck_Instr_Instantiate_Object::params() const · 4063 unmodified lines
40644064 const char * Chuck_Instr_Pre_Ctor_Array_Top::params() const
40654065 {
40664066 static char buffer[256];
4067− sprintf( buffer, "val=%ld, type=\"%s\"", m_val, type ? type->c_name() : "[empty]" );
4067+ sprintf( buffer, "val=%ld, type=\"%s\"", (long)m_val, type ? type->c_name() : "[empty]" );
40684068 return buffer;
40694069 }
40704070
@@ -5015,7 +5015,7 @@ Chuck_Instr_Array_Init::Chuck_Instr_Array_Init( Chuck_Env * env, Chuck_Type * t, · 944 unmodified lines
50155015
50165016 // append length
50175017 char buffer[16];
5018− sprintf( buffer, "[%ld]", m_length );
5018+ sprintf( buffer, "[%ld]", (long)m_length );
50195019 strcat( m_param_str, buffer );
50205020 }
50215021
src/core/chuck_instr.h+24−24
@@ -84,7 +84,7 @@ public: · 83 unmodified lines
8484
8585 public:
8686 virtual const char * params() const
87− { static char buffer[256]; sprintf( buffer, "%ld", m_jmp ); return buffer; }
87+ { static char buffer[256]; sprintf( buffer, "%ld", (long)m_jmp ); return buffer; }
8888
8989 protected:
9090 t_CKUINT m_jmp;
@@ -105,7 +105,7 @@ public: · 14 unmodified lines
105105
106106 public:
107107 virtual const char * params() const
108− { static char buffer[256]; sprintf( buffer, "%ld", m_val ); return buffer; }
108+ { static char buffer[256]; sprintf( buffer, "%ld", (long)m_val ); return buffer; }
109109
110110 protected:
111111 t_CKUINT m_val;
@@ -2134,7 +2134,7 @@ public: · 2022 unmodified lines
21342134 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
21352135 virtual const char * params() const
21362136 { static char buffer[256];
2137− sprintf( buffer, "src=%ld, base=%ld", m_val, base );
2137+ sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
21382138 return buffer; }
21392139
21402140 protected:
@@ -2159,7 +2159,7 @@ public: · 18 unmodified lines
21592159 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
21602160 virtual const char * params() const
21612161 { static char buffer[256];
2162− sprintf( buffer, "src=%ld, base=%ld", m_val, base );
2162+ sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
21632163 return buffer; }
21642164
21652165 protected:
@@ -2184,7 +2184,7 @@ public: · 18 unmodified lines
21842184 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
21852185 virtual const char * params() const
21862186 { static char buffer[256];
2187− sprintf( buffer, "src=%ld, base=%ld", m_val, base );
2187+ sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
21882188 return buffer; }
21892189
21902190 protected:
@@ -2209,7 +2209,7 @@ public: · 18 unmodified lines
22092209 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
22102210 virtual const char * params() const
22112211 { static char buffer[256];
2212− sprintf( buffer, "src=%ld, base=%ld", m_val, base );
2212+ sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
22132213 return buffer; }
22142214
22152215 protected:
@@ -2234,7 +2234,7 @@ public: · 18 unmodified lines
22342234 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
22352235 virtual const char * params() const
22362236 { static char buffer[256];
2237− sprintf( buffer, "src=%ld, base=%ld", m_val, base );
2237+ sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
22382238 return buffer; }
22392239
22402240 protected:
@@ -2284,7 +2284,7 @@ public: · 43 unmodified lines
22842284 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
22852285 virtual const char * params() const
22862286 { static char buffer[256];
2287− sprintf( buffer, "src=%ld, base=%ld", m_val, base );
2287+ sprintf( buffer, "src=%ld, base=%ld", (long)m_val, (long)base );
22882288 return buffer; }
22892289
22902290 protected:
@@ -2369,7 +2369,7 @@ public: · 78 unmodified lines
23692369 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
23702370 virtual const char * params() const
23712371 { static char buffer[256];
2372− sprintf( buffer, "offset=%ld, value=%ld", m_offset, m_val );
2372+ sprintf( buffer, "offset=%ld, value=%ld", (long)m_offset, (long)m_val );
23732373 return buffer; }
23742374
23752375 protected:
@@ -2394,7 +2394,7 @@ public: · 18 unmodified lines
23942394 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
23952395 virtual const char * params() const
23962396 { static char buffer[256];
2397− sprintf( buffer, "offset=%ld, value=%f", m_offset, m_val );
2397+ sprintf( buffer, "offset=%ld, value=%f", (long)m_offset, m_val );
23982398 return buffer; }
23992399
24002400 protected:
@@ -3193,8 +3193,8 @@ public: · 792 unmodified lines
31933193 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
31943194 virtual const char * params() const
31953195 { static char buffer[256];
3196− sprintf( buffer, "kind=%ld, emit_addr=%ld istr=%ld",
3197− m_kind, m_emit_addr, m_istr );
3196+ sprintf( buffer, "kind=%ld, emit_addr=%p istr=%ld",
3197+ (long)m_kind, (void *)m_emit_addr, (long)m_istr );
31983198 return buffer; }
31993199
32003200 protected:
@@ -3220,7 +3220,7 @@ public: · 19 unmodified lines
32203220 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
32213221 virtual const char * params() const
32223222 { static char buffer[256];
3223− sprintf( buffer, "kind=%ld, emit_addr=%ld", m_kind, m_emit_addr );
3223+ sprintf( buffer, "kind=%ld, emit_addr=%p", (long)m_kind, (void *)m_emit_addr );
32243224 return buffer; }
32253225
32263226 protected:
@@ -3247,7 +3247,7 @@ public: · 20 unmodified lines
32473247 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
32483248 virtual const char * params() const
32493249 { static char buffer[256];
3250− sprintf( buffer, "depth=%ld, kind=%ld, emit_addr=%ld", m_depth, m_kind, m_emit_addr );
3250+ sprintf( buffer, "depth=%ld, kind=%ld, emit_addr=%p", (long)m_depth, (long)m_kind, (void *)m_emit_addr );
32513251 return buffer; }
32523252
32533253 protected:
@@ -3276,7 +3276,7 @@ public: · 22 unmodified lines
32763276 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
32773277 virtual const char * params() const
32783278 { static char buffer[256];
3279− sprintf( buffer, "offset=%ld, kind=%ld, emit_addr=%ld", m_offset, m_kind, m_emit_addr );
3279+ sprintf( buffer, "offset=%ld, kind=%ld, emit_addr=%p", (long)m_offset, (long)m_kind, (void *)m_emit_addr );
32803280 return buffer; }
32813281
32823282 protected:
@@ -3302,7 +3302,7 @@ public: · 19 unmodified lines
33023302 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
33033303 virtual const char * params() const
33043304 { static char buffer[256];
3305− sprintf( buffer, "offset=%ld", m_offset );
3305+ sprintf( buffer, "offset=%ld", (long)m_offset );
33063306 return buffer; }
33073307
33083308 protected:
@@ -3326,7 +3326,7 @@ public: · 17 unmodified lines
33263326 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
33273327 virtual const char * params() const
33283328 { static char buffer[256];
3329− sprintf( buffer, "native_func=%ld", m_native_func );
3329+ sprintf( buffer, "native_func=%p", (void *)m_native_func );
33303330 return buffer; }
33313331
33323332 protected:
@@ -3350,7 +3350,7 @@ public: · 17 unmodified lines
33503350 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
33513351 virtual const char * params() const
33523352 { static char buffer[256];
3353− sprintf( buffer, "offset=%ld, size=%ld, kind=%ld, emit_addr=%ld", m_offset, m_size, m_kind, m_emit_addr );
3353+ sprintf( buffer, "offset=%ld, size=%ld, kind=%ld, emit_addr=%p", (long)m_offset, (long)m_size, (long)m_kind, (void *)m_emit_addr );
33543354 return buffer; }
33553355
33563356 protected:
@@ -3377,7 +3377,7 @@ public: · 20 unmodified lines
33773377 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
33783378 virtual const char * params() const
33793379 { static char buffer[256];
3380− sprintf( buffer, "addr=%ld, kind=%ld, emit_addr=%ld", (t_CKUINT)m_addr, m_kind, m_emit_addr );
3380+ sprintf( buffer, "addr=%p, kind=%ld, emit_addr=%p", (void *)m_addr, (long)m_kind, (void *)m_emit_addr );
33813381 return buffer; }
33823382
33833383 protected:
@@ -3403,7 +3403,7 @@ public: · 19 unmodified lines
34033403 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
34043404 virtual const char * params() const
34053405 { static char buffer[256];
3406− sprintf( buffer, "func=%ld", (t_CKUINT)m_func );
3406+ sprintf( buffer, "func=%p", (void *)m_func );
34073407 return buffer; }
34083408
34093409 protected:
@@ -3427,7 +3427,7 @@ public: · 17 unmodified lines
34273427 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
34283428 virtual const char * params() const
34293429 { static char buffer[256];
3430− sprintf( buffer, "is_mem=%ld, emit_addr=%ld", m_is_mem, m_emit_addr );
3430+ sprintf( buffer, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
34313431 return buffer; }
34323432
34333433 protected:
@@ -3452,7 +3452,7 @@ public: · 18 unmodified lines
34523452 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
34533453 virtual const char * params() const
34543454 { static char buffer[256];
3455− sprintf( buffer, "is_mem=%ld, emit_addr=%ld", m_is_mem, m_emit_addr );
3455+ sprintf( buffer, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
34563456 return buffer; }
34573457
34583458 protected:
@@ -3477,7 +3477,7 @@ public: · 18 unmodified lines
34773477 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
34783478 virtual const char * params() const
34793479 { static char buffer[256];
3480− sprintf( buffer, "is_mem=%ld, emit_addr=%ld", m_is_mem, m_emit_addr );
3480+ sprintf( buffer, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
34813481 return buffer; }
34823482
34833483 protected:
@@ -3502,7 +3502,7 @@ public: · 18 unmodified lines
35023502 virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred );
35033503 virtual const char * params() const
35043504 { static char buffer[256];
3505− sprintf( buffer, "is_mem=%ld, emit_addr=%ld", m_is_mem, m_emit_addr );
3505+ sprintf( buffer, "is_mem=%ld, emit_addr=%p", (long)m_is_mem, (void *)m_emit_addr );
35063506 return buffer; }
35073507
35083508 protected:
src/core/chuck_io.cpp+10−10
@@ -2851,7 +2851,7 @@ t_CKINT Chuck_IO_Serial::readInt( t_CKINT flags ) · 2850 unmodified lines
28512851 return 0;
28522852 }
28532853
2854− t_CKINT i = 0;
2854+ long i = 0; // 1.4.1.1 (ge) changed from t_CKUINT; to clear warning for fscanf using %li
28552855
28562856 if( m_flags & Chuck_IO_File::TYPE_BINARY )
28572857 {
@@ -3015,8 +3015,8 @@ void Chuck_IO_Serial::write( const std::string & val ) · 157 unmodified lines
30153015 {
30163016 start_read_thread();
30173017
3018− int len = val.length();
3019− for(int i = 0; i < len; i++)
3018+ t_CKUINT len = val.length();
3019+ for(t_CKUINT i = 0; i < len; i++)
30203020 // TODO: efficiency
30213021 m_writeBuffer.put(val[i]);
30223022
@@ -3063,13 +3063,13 @@ void Chuck_IO_Serial::write( t_CKINT val, t_CKINT size ) · 40 unmodified lines
30633063 {
30643064 // TODO: don't use m_tmp_buf (thread safety?)
30653065 #ifdef WIN32
3066− _snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%li", val);
3066+ _snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%li", (long)val);
30673067 m_tmp_buf[m_tmp_buf_max - 1] = '\0'; // force NULL terminator -- see http://www.di-mgt.com.au/cprog.html#snprintf
30683068 #else
30693069 snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%li", val);
30703070 #endif
3071− int len = strlen((char *)m_tmp_buf);
3072− for(int i = 0; i < len; i++)
3071+ t_CKUINT len = strlen((char *)m_tmp_buf);
3072+ for(t_CKUINT i = 0; i < len; i++)
30733073 // TODO: efficiency
30743074 m_writeBuffer.put(m_tmp_buf[i]);
30753075
@@ -3102,7 +3102,7 @@ void Chuck_IO_Serial::write( t_CKINT val, t_CKINT size ) · 26 unmodified lines
31023102 {
31033103 if( m_flags & Chuck_IO_File::TYPE_ASCII )
31043104 {
3105− fprintf( m_cfd, "%li", val );
3105+ fprintf( m_cfd, "%li", (long)val );
31063106 }
31073107 else
31083108 {
@@ -3134,8 +3134,8 @@ void Chuck_IO_Serial::write( t_CKFLOAT val ) · 25 unmodified lines
31343134 snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%f", val);
31353135 #endif
31363136
3137− int len = strlen((char *)m_tmp_buf);
3138− for(int i = 0; i < len; i++)
3137+ t_CKUINT len = strlen((char *)m_tmp_buf);
3138+ for(t_CKUINT i = 0; i < len; i++)
31393139 // TODO: efficiency
31403140 m_writeBuffer.put(m_tmp_buf[i]);
31413141
@@ -3517,7 +3517,7 @@ t_CKINT Chuck_IO_Serial::buffer_bytes_to_tmp(t_CKINT num_bytes) · 375 unmodified lines
35173517 t_CKBOOL Chuck_IO_Serial::handle_line(Chuck_IO_Serial::Request &r)
35183518 {
35193519 t_CKUINT len = 0;
3520− Chuck_String * str;
3520+ Chuck_String * str = NULL;
35213521
35223522 while(!m_do_exit)
35233523 {
src/core/chuck_otf.cpp+5−5
@@ -251,8 +251,8 @@ cleanup: · 250 unmodified lines
251251 // name: otf_send_file()
252252 // desc: ...
253253 //-----------------------------------------------------------------------------
254−int otf_send_file( const char * fname, Net_Msg & msg, const char * op,
255− ck_socket dest )
254+t_CKINT otf_send_file( const char * fname, Net_Msg & msg, const char * op,
255+ ck_socket dest )
256256 {
257257 FILE * fd = NULL;
258258 struct stat fs;
@@ -355,7 +355,7 @@ int otf_send_file( const char * fname, Net_Msg & msg, const char * op, · 96 unmodified lines
355355 // name: otf_send_connect()
356356 // desc: ...
357357 //-----------------------------------------------------------------------------
358−ck_socket otf_send_connect( const char * host, int port )
358+ck_socket otf_send_connect( const char * host, t_CKINT port )
359359 {
360360 // log
361361 EM_log( CK_LOG_INFO, "otf connect: %s:%i", host, port );
@@ -389,8 +389,8 @@ ck_socket otf_send_connect( const char * host, int port ) · 27 unmodified lines
389389 // name: otf_send_cmd()
390390 // desc: ...
391391 //-----------------------------------------------------------------------------
392−int otf_send_cmd( int argc, const char ** argv, t_CKINT & i, const char * host, int port,
393− int * is_otf )
392+t_CKINT otf_send_cmd( t_CKINT argc, const char ** argv, t_CKINT & i,
393+ const char * host, t_CKINT port, t_CKINT * is_otf )
394394 {
395395 Net_Msg msg;
396396 // REFACTOR-2017 TODO: wat is global sigpipe mode
src/core/chuck_otf.h+4−3
@@ -1,3 +1,4 @@
1+/*----------------------------------------------------------------------------
12 /*----------------------------------------------------------------------------
23 ChucK Concurrent, On-the-fly Audio Programming Language
34 Compiler and Virtual Machine
@@ -78,11 +79,11 @@ t_CKUINT otf_process_msg( Chuck_VM * vm, Chuck_Compiler * compiler, · 74 unmodified lines
7879 Net_Msg * msg, t_CKBOOL immediate, void * data );
7980
8081 // send command
81−int otf_send_cmd( int argc, const char ** argv, t_CKINT & i, const char * host, int port, int * is_otf = NULL );
82+t_CKINT otf_send_cmd( t_CKINT argc, const char ** argv, t_CKINT & i, const char * host, t_CKINT port, t_CKINT * is_otf = NULL );
8283 // send file to remote host
83−int otf_send_file( const char * filename, Net_Msg & msg, const char * op, ck_socket sock );
84+t_CKINT otf_send_file( const char * filename, Net_Msg & msg, const char * op, ck_socket sock );
8485 // connect
85−ck_socket otf_send_connect( const char * host, int port );
86+ck_socket otf_send_connect( const char * host, t_CKINT port );
8687
8788 // callback
8889 void * otf_cb( void * p );
src/core/chuck_shell.cpp+7−7
@@ -564,7 +564,7 @@ void Chuck_Shell::continue_code( string & in ) · 563 unmodified lines
564564 #ifndef __PLATFORM_WIN32__
565565 snprintf( buf, 16, "code %2d> ", (int)scope );
566566 #else
567− sprintf( buf, "code %2d> ", scope);
567+ sprintf( buf, "code %2ld> ", (long)scope);
568568 #endif
569569 prompt = buf;
570570 }
@@ -577,7 +577,7 @@ void Chuck_Shell::continue_code( string & in ) · 6 unmodified lines
577577 #ifndef __PLATFORM_WIN32__
578578 snprintf( buf, 16, "code %2d> ", (int)scope );
579579 #else
580− sprintf( buf, "code %2d> ", scope);
580+ sprintf( buf, "code %2ld> ", (long)scope);
581581 #endif
582582 prompt = buf;
583583 }
@@ -1421,7 +1421,7 @@ t_CKINT Chuck_Shell::Command_Ls::execute( vector< string > & argv, · 837 unmodified lines
14211421
14221422 if( argv.size() == 0 )
14231423 {
1424− DWORD i, k = 64;
1424+ t_CKUINT i, k = 64;
14251425 LPTSTR cwd = new char [k];
14261426 WIN32_FIND_DATA find_data;
14271427
@@ -1450,12 +1450,12 @@ t_CKINT Chuck_Shell::Command_Ls::execute( vector< string > & argv, · 22 unmodified lines
14501450 return 0;
14511451 }
14521452
1453− int i, len = argv.size();
1453+ t_CKINT i, len = argv.size();
14541454 t_CKBOOL print_parent_name = len > 1 ? TRUE : FALSE;
14551455
14561456 for( i = 0; i < len; i++ )
14571457 {
1458− int j = argv[i].size() + 3;
1458+ t_CKINT j = argv[i].size() + 3;
14591459 WIN32_FIND_DATA find_data;
14601460 LPTSTR dir = new char [j];
14611461 strncpy( dir, argv[i].c_str(), j );
@@ -1889,7 +1889,7 @@ t_CKINT Chuck_Shell::Command_VMAdd::execute( vector< string > & argv, · 427 unmodified lines
18891889 #ifndef __PLATFORM_WIN32__
18901890 snprintf( buf, 16, "%lu", caller->vms.size() - 1 );
18911891 #else
1892− sprintf( buf, "%u", caller->vms.size() - 1 );
1892+ sprintf( buf, "%lu", (long)caller->vms.size() - 1 );
18931893 #endif // __PLATFORM_WIN32__
18941894
18951895 out += caller->current_vm->fullname() + " saved as VM " + buf + "\n";
@@ -1987,7 +1987,7 @@ t_CKINT Chuck_Shell::Command_VMList::execute( vector< string > & argv, · 91 unmodified lines
19871987 #ifndef __PLATFORM_WIN32__
19881988 snprintf( buf, 16, "%lu", i );
19891989 #else
1990− sprintf( buf, "%lu", i );
1990+ sprintf( buf, "%lu", (long)i );
19911991 #endif // __PLATFORM_WIN32__
19921992 out += string( "VM " ) + buf + ": " +
19931993 caller->vms[i]->fullname() + "\n";
src/core/chuck_symbol.cpp+2−1
@@ -43,7 +43,8 @@ struct S_Symbol_ { c_str name; S_Symbol next; }; · 42 unmodified lines
4343 static S_Symbol mksymbol( c_constr name, S_Symbol next )
4444 {
4545 S_Symbol s = (S_Symbol)checked_malloc(sizeof(*s));
46− s->name = (c_str)checked_malloc(strlen(name)+1);
46+ t_CKINT len = strlen(name) + 1;
47+ s->name = (c_str)checked_malloc(len);
4748 strcpy(s->name, (c_str)name); s->next=next;
4849 return s;
4950 }
src/core/chuck_table.cpp+15−15
@@ -127,11 +127,11 @@ void TAB_delete( TAB_table t ) · 126 unmodified lines
127127
128128 void TAB_enter(TAB_table t, void *key, void *value)
129129 {
130− long index;
131− unsigned long hval = (unsigned long)key;
130+ t_CKINT index;
131+ t_CKUINT hval = (t_CKUINT)key;
132132 assert(t && key);
133133 if( t->hash_func )
134− hval = (unsigned long)t->hash_func(key);
134+ hval = (t_CKUINT)t->hash_func(key);
135135 index = hval % t->size;
136136 t->table[index] = Binder(key, value, t->table[index], t->top);
137137 t->top = key;
@@ -139,12 +139,12 @@ void TAB_enter(TAB_table t, void *key, void *value) · 1 unmodified line
139139
140140 void *TAB_look(TAB_table t, void *key)
141141 {
142− long index;
143− unsigned long hval = (unsigned long)key;
142+ t_CKINT index;
143+ t_CKUINT hval = (t_CKUINT)key;
144144 binder b;
145145 assert(t && key);
146146 if( t->hash_func )
147− hval = (unsigned long)t->hash_func(key);
147+ hval = (t_CKUINT)t->hash_func(key);
148148 index= hval % t->size;
149149 if( !t->eq_func )
150150 {
@@ -163,13 +163,13 @@ void *TAB_look(TAB_table t, void *key) · 12 unmodified lines
163163 void *TAB_pop(TAB_table t)
164164 {
165165 void *k; binder b; long index;
166− unsigned long hval;
166+ t_CKUINT hval;
167167 assert (t);
168168 k = t->top;
169169 assert (k);
170− hval = (unsigned long)k;
171− if(t->hash_func) hval = (unsigned long)t->hash_func(k);
172− index = ((unsigned long)hval) % t->size;
170+ hval = (t_CKUINT)k;
171+ if(t->hash_func) hval = (t_CKUINT)t->hash_func(k);
172+ index = hval % t->size;
173173 b = t->table[index];
174174 assert(b);
175175 t->table[index] = b->next;
@@ -179,13 +179,13 @@ void *TAB_pop(TAB_table t) · 3 unmodified lines
179179
180180 void *TAB_topv(TAB_table t)
181181 {
182− void *k; binder b; long index;
183− unsigned long hval;
182+ void *k; binder b; t_CKINT index;
183+ t_CKUINT hval;
184184 assert(t);
185185 k = t->top;
186186 assert(k);
187− hval = (unsigned long)k;
188− if(t->hash_func) hval = (unsigned long)t->hash_func(k);
187+ hval = (t_CKUINT)k;
188+ if(t->hash_func) hval = (t_CKUINT)t->hash_func(k);
189189 index = hval % t->size;
190190 b = t->table[index];
191191 assert(b);
@@ -195,7 +195,7 @@ void *TAB_topv(TAB_table t) · 3 unmodified lines
195195 void TAB_dump(TAB_table t, void (*show)(void *key, void *value))
196196 {
197197 void *k = t->top;
198− long index = ((unsigned long)k) % t->size;
198+ t_CKINT index = ((t_CKUINT)k) % t->size;
199199 binder b = t->table[index];
200200 if (b==NULL) return;
201201 t->table[index]=b->next;
src/core/chuck_utils.cpp+2−1
@@ -58,7 +58,8 @@ void * checked_malloc( int len ) · 57 unmodified lines
5858
5959 c_str cc_str( char * s )
6060 {
61− c_str p = (c_str)checked_malloc( strlen(s)+1 );
61+ t_CKINT len = strlen(s) + 1;
62+ c_str p = (c_str)checked_malloc( len );
6263 strcpy( p, s );
6364
6465 return p;
src/core/midiio_rtmidi.cpp+43−43
@@ -622,8 +622,8 @@ void MidiInManager::cb_midi_input( double deltatime, std::vector<unsigned char> · 621 unmodified lines
622622 // it needs to know its device number so it can inform all VMs waiting
623623 // on that device number.
624624 // --> device num stored in userData
625− unsigned int nBytes = (unsigned int) msg->size();
626− unsigned int device_num = (unsigned int) ((unsigned long) userData);
625+ t_CKUINT nBytes = (t_CKUINT)msg->size();
626+ t_CKUINT device_num = (t_CKUINT)userData;
627627 // check if we know the bufs for that device num (we should!)
628628 if( device_num >= the_bufs.size() )
629629 {
@@ -1196,10 +1196,10 @@ void MidiScoreReader::cleanup() · 566 unmodified lines
11961196 MidiNoteEvent * next = NULL;
11971197
11981198 // clean up the tracks
1199− for( long i = 0; i < m_midiFile->getNumberOfTracks(); i++ )
1199+ for( t_CKINT i = 0; i < m_midiFile->getNumberOfTracks(); i++ )
12001200 {
12011201 // for each track
1202− for( long j = 0; j < m_events[i].size(); j++ )
1202+ for( t_CKINT j = 0; j < m_events[i].size(); j++ )
12031203 {
12041204 // get track
12051205 e = m_events[i][j];
@@ -1280,7 +1280,7 @@ bool MidiScoreReader::load( const char * path, float velScale ) · 74 unmodified lines
12801280 m_indices.resize( m_midiFile->getNumberOfTracks() );
12811281 m_countMaps.resize( m_midiFile->getNumberOfTracks() );
12821282 // iterate and set
1283− for( long i = 0; i < m_midiFile->getNumberOfTracks(); i++ )
1283+ for( t_CKINT i = 0; i < m_midiFile->getNumberOfTracks(); i++ )
12841284 {
12851285 // load up the arrays
12861286 loadTrack( i, m_events[i], m_lyricEvents[i] );
@@ -1312,7 +1312,7 @@ bool MidiScoreReader::load( const char * path, float velScale ) · 25 unmodified lines
13121312 // name: getNumTracks()
13131313 // desc: get the number of tracks
13141314 //-----------------------------------------------------------------------------
1315−long MidiScoreReader::getNumTracks() const
1315+t_CKINT MidiScoreReader::getNumTracks() const
13161316 {
13171317 if( m_midiFile == NULL ) return 0;
13181318 return m_midiFile->getNumberOfTracks();
@@ -1325,7 +1325,7 @@ long MidiScoreReader::getNumTracks() const · 6 unmodified lines
13251325 // name: getNumTracksNonZero()
13261326 // desc: get number of tracks with more than 0 zero
13271327 //-----------------------------------------------------------------------------
1328−long MidiScoreReader::getNumTracksNonZero() const
1328+t_CKINT MidiScoreReader::getNumTracksNonZero() const
13291329 {
13301330 if( m_midiFile == NULL ) return 0;
13311331 return m_numNonZeroTracks;
@@ -1338,7 +1338,7 @@ long MidiScoreReader::getNumTracksNonZero() const · 6 unmodified lines
13381338 // name: getTracksNonZero()
13391339 // desc: get a vector of tracks indices that have more than 0 events
13401340 //-----------------------------------------------------------------------------
1341−const std::vector<long> & MidiScoreReader::getTracksNonZero() const
1341+const std::vector<t_CKINT> & MidiScoreReader::getTracksNonZero() const
13421342 {
13431343 return m_nonZeroTrackIndices;
13441344 }
@@ -1363,7 +1363,7 @@ double MidiScoreReader::getBPM() const · 18 unmodified lines
13631363 // name: getLowestNote()
13641364 // desc: get lowest note for a track
13651365 //-----------------------------------------------------------------------------
1366−long MidiScoreReader::getLowestNote( long track, const MidiNoteEvent * start )
1366+t_CKINT MidiScoreReader::getLowestNote( t_CKINT track, const MidiNoteEvent * start )
13671367 {
13681368 int lowestNote = 128;
13691369 int startingPoint = 0;
@@ -1399,15 +1399,15 @@ long MidiScoreReader::getLowestNote( long track, const MidiNoteEvent * start ) · 29 unmodified lines
13991399 // name: getHighestNote()
14001400 // desc: get highest note for a track
14011401 //-----------------------------------------------------------------------------
1402−long MidiScoreReader::getHighestNote( long track, const MidiNoteEvent *start )
1402+t_CKINT MidiScoreReader::getHighestNote( t_CKINT track, const MidiNoteEvent *start )
14031403 {
1404− long highestNote = 0;
1405− long startingPoint = 0;
1404+ t_CKINT highestNote = 0;
1405+ t_CKINT startingPoint = 0;
14061406
14071407 // get the starting point
14081408 if( start != NULL )
14091409 {
1410− for( long i = 0; i < m_events[track].size(); i++ )
1410+ for( t_CKINT i = 0; i < m_events[track].size(); i++ )
14111411 {
14121412 if( m_events[track].at(i) == start )
14131413 {
@@ -1417,7 +1417,7 @@ long MidiScoreReader::getHighestNote( long track, const MidiNoteEvent *start ) · 3 unmodified lines
14171417 }
14181418 }
14191419
1420− for( long i = startingPoint; i < m_events[track].size(); i++ )
1420+ for( t_CKINT i = startingPoint; i < m_events[track].size(); i++ )
14211421 {
14221422 if( m_events[track].at(i)->data2 > highestNote )
14231423 highestNote = m_events[track].at(i)->data2;
@@ -1435,7 +1435,7 @@ long MidiScoreReader::getHighestNote( long track, const MidiNoteEvent *start ) · 11 unmodified lines
14351435 // name: getTopEvent()
14361436 // desc: return current (top-level) note event on track
14371437 //-----------------------------------------------------------------------------
1438−const MidiNoteEvent * MidiScoreReader::getTopEvent( long track, long offset )
1438+const MidiNoteEvent * MidiScoreReader::getTopEvent( t_CKINT track, t_CKINT offset )
14391439 {
14401440 // sanity check
14411441 if( !m_midiFile || track >= m_events.size() )
@@ -1445,7 +1445,7 @@ const MidiNoteEvent * MidiScoreReader::getTopEvent( long track, long offset ) · 3 unmodified lines
14451445 }
14461446
14471447 // the new index
1448− long index = m_indices[track] + offset;
1448+ t_CKINT index = m_indices[track] + offset;
14491449 // check it
14501450 if( index < 0 || index >= m_events[track].size() ) return NULL;
14511451 // return it
@@ -1459,7 +1459,7 @@ const MidiNoteEvent * MidiScoreReader::getTopEvent( long track, long offset ) · 7 unmodified lines
14591459 // name: scanEvent()
14601460 // desc: get the next event (respects simultaneous) + move to next
14611461 //-----------------------------------------------------------------------------
1462−const MidiNoteEvent * MidiScoreReader::scanEvent( long track, bool & isNewSet )
1462+const MidiNoteEvent * MidiScoreReader::scanEvent( t_CKINT track, bool & isNewSet )
14631463 {
14641464 const MidiNoteEvent * e = NULL;
14651465 isNewSet = false;
@@ -1492,7 +1492,7 @@ const MidiNoteEvent * MidiScoreReader::scanEvent( long track, bool & isNewSet ) · 26 unmodified lines
14921492 // name: seek()
14931493 // desc: advance to an event on a track
14941494 //-----------------------------------------------------------------------------
1495−bool MidiScoreReader::seek( long track, long numToAdvance )
1495+bool MidiScoreReader::seek( t_CKINT track, t_CKINT numToAdvance )
14961496 {
14971497 // sanity check
14981498 if( !m_midiFile || track >= m_events.size() )
@@ -1502,7 +1502,7 @@ bool MidiScoreReader::seek( long track, long numToAdvance ) · 3 unmodified lines
15021502 }
15031503
15041504 // the next index
1505− long index = m_indices[track] + numToAdvance;
1505+ t_CKINT index = m_indices[track] + numToAdvance;
15061506 // check it
15071507 if( index < 0 ) index = 0;
15081508 else if( index >= m_events[track].size() ) index = m_events[track].size();
@@ -1521,7 +1521,7 @@ bool MidiScoreReader::seek( long track, long numToAdvance ) · 12 unmodified lines
15211521 // name: seekToNoteOn()
15221522 // desc: advance to an event on a track
15231523 //-----------------------------------------------------------------------------
1524−bool MidiScoreReader::seekToNoteOn( long track )
1524+bool MidiScoreReader::seekToNoteOn( t_CKINT track )
15251525 {
15261526 // sanity check
15271527 if( !m_midiFile || track >= m_events.size() )
@@ -1532,7 +1532,7 @@ bool MidiScoreReader::seekToNoteOn( long track ) · 4 unmodified lines
15321532
15331533 // event
15341534 const MidiNoteEvent * e = NULL;
1535− long index = 0;
1535+ t_CKINT index = 0;
15361536
15371537 // go
15381538 do {
@@ -1567,7 +1567,7 @@ void MidiScoreReader::rewind() · 28 unmodified lines
15671567 if( !m_midiFile ) return;
15681568
15691569 // set all indices to 0
1570− for( long i = 0; i < m_midiFile->getNumberOfTracks(); i++ )
1570+ for( t_CKINT i = 0; i < m_midiFile->getNumberOfTracks(); i++ )
15711571 {
15721572 // clear
15731573 m_indices[i] = 0;
@@ -1582,7 +1582,7 @@ void MidiScoreReader::rewind() · 8 unmodified lines
15821582 // name: getEvents()
15831583 // desc: get notes in a time window
15841584 //-----------------------------------------------------------------------------
1585−void MidiScoreReader::getEvents( long track, double startTime, double endTime,
1585+void MidiScoreReader::getEvents( t_CKINT track, double startTime, double endTime,
15861586 vector<const MidiNoteEvent *> & result,
15871587 bool includeSimultaneous )
15881588 {
@@ -1616,7 +1616,7 @@ void MidiScoreReader::getEvents( long track, double startTime, double endTime, · 27 unmodified lines
16161616 return;
16171617
16181618 // the index
1619− unsigned long searchIndex = m_searchIndices[track];
1619+ t_CKUINT searchIndex = m_searchIndices[track];
16201620
16211621 // scan for events within the window
16221622 while( searchPtr )
@@ -1652,14 +1652,14 @@ void MidiScoreReader::getEvents( long track, double startTime, double endTime, · 29 unmodified lines
16521652 // name: isDone()
16531653 // desc: is done
16541654 //-----------------------------------------------------------------------------
1655−bool MidiScoreReader::isDone( long track, double currTime )
1655+bool MidiScoreReader::isDone( t_CKINT track, double currTime )
16561656 {
16571657 // sanity check
16581658 if( track < 0 || track >= m_events.size() )
16591659 return true;
16601660
16611661 // number of events on a track
1662− long numEvents = m_events[track].size();
1662+ t_CKINT numEvents = m_events[track].size();
16631663 // check time against last element
16641664 if( numEvents <= 0 )
16651665 return true;
@@ -1674,7 +1674,7 @@ bool MidiScoreReader::isDone( long track, double currTime ) · 8 unmodified lines
16741674 // name: applyControl()
16751675 // desc: applies control data to an existing event
16761676 //-----------------------------------------------------------------------------
1677−bool MidiScoreReader::applyControl( long track, long data2, long data3, MidiNoteEvent * e )
1677+bool MidiScoreReader::applyControl( t_CKINT track, t_CKINT data2, t_CKINT data3, MidiNoteEvent * e )
16781678 {
16791679 // sanity check
16801680 if( !e ) return false;
@@ -1713,7 +1713,7 @@ bool MidiScoreReader::applyControl( long track, long data2, long data3, MidiNote · 32 unmodified lines
17131713 // name: loadTrack()
17141714 // desc: load a track from file
17151715 //-----------------------------------------------------------------------------
1716−bool MidiScoreReader::loadTrack( long track, std::vector<MidiNoteEvent *> & data, std::vector<MidiLyricEvent *> & lyricData )
1716+bool MidiScoreReader::loadTrack( t_CKINT track, std::vector<MidiNoteEvent *> & data, std::vector<MidiLyricEvent *> & lyricData )
17171717 {
17181718 // sanity check
17191719 if( !m_midiFile || track >= m_events.size() )
@@ -1748,7 +1748,7 @@ bool MidiScoreReader::loadTrack( long track, std::vector<MidiNoteEvent *> & data · 28 unmodified lines
17481748 while( true )
17491749 {
17501750 // get the next MIDI event
1751− unsigned long ticks = m_midiFile->getNextEvent( &shuttle, (unsigned int)track );
1751+ t_CKUINT ticks = m_midiFile->getNextEvent( &shuttle, (unsigned int)track );
17521752
17531753 // accumulate time
17541754 secondsAccum += ticks * m_midiFile->getTickSeconds();
@@ -1952,7 +1952,7 @@ void MidiScoreReader::enqueue_front( const MidiNoteEvent * e ) · 197 unmodified lines
19521952 // name: getNumEvents()
19531953 // desc: get number of events on a track
19541954 //-----------------------------------------------------------------------------
1955−long MidiScoreReader::getNumEvents( long track ) const
1955+t_CKINT MidiScoreReader::getNumEvents( t_CKINT track ) const
19561956 {
19571957 // sanity check
19581958 if( track < 0 || track >= m_events.size() )
@@ -1970,7 +1970,7 @@ long MidiScoreReader::getNumEvents( long track ) const · 11 unmodified lines
19701970 // desc: get an entire track's note events
19711971 //-----------------------------------------------------------------------------
19721972 static vector<MidiNoteEvent *> s_nullNoteVector;
1973−const vector<MidiNoteEvent *> & MidiScoreReader::getNoteEvents( long track )
1973+const vector<MidiNoteEvent *> & MidiScoreReader::getNoteEvents( t_CKINT track )
19741974 {
19751975 // sanity check
19761976 if( track < 0 || track >= m_events.size() )
@@ -1987,7 +1987,7 @@ const vector<MidiNoteEvent *> & MidiScoreReader::getNoteEvents( long track ) · 10 unmodified lines
19871987 // desc: get an entire track's lyric events
19881988 //-----------------------------------------------------------------------------
19891989 static vector<MidiLyricEvent *> s_nullLyricVector;
1990−const vector<MidiLyricEvent *> & MidiScoreReader::getLyricEvents( long track )
1990+const vector<MidiLyricEvent *> & MidiScoreReader::getLyricEvents( t_CKINT track )
19911991 {
19921992 // sanity check
19931993 if( track < 0 || track >= m_lyricEvents.size() )
@@ -2003,12 +2003,12 @@ const vector<MidiLyricEvent *> & MidiScoreReader::getLyricEvents( long track ) · 9 unmodified lines
20032003 // name: getCount()
20042004 // desc: return a count associated with key
20052005 //-----------------------------------------------------------------------------
2006−long MidiScoreReader::getCount( long track, const std::string & key )
2006+t_CKINT MidiScoreReader::getCount( t_CKINT track, const std::string & key )
20072007 {
20082008 // sanity check
20092009 if( track < 0 || track >= m_events.size() ) return 0;
20102010 // find
2011− std::map< std::string, long >::iterator iter = m_countMaps[track].find( key );
2011+ std::map< std::string, t_CKINT >::iterator iter = m_countMaps[track].find( key );
20122012 // not found
20132013 if( iter == m_countMaps[track].end() ) return 0;
20142014 // return value
@@ -2022,13 +2022,13 @@ long MidiScoreReader::getCount( long track, const std::string & key ) · 7 unmodified lines
20222022 // name: incrementCount()
20232023 // desc: increment a count associated with key
20242024 //-----------------------------------------------------------------------------
2025−void MidiScoreReader::incrementCount( long track, const std::string & key )
2025+void MidiScoreReader::incrementCount( t_CKINT track, const std::string & key )
20262026 {
20272027 // sanity check
20282028 if( track < 0 || track >= m_events.size() ) return;
20292029
20302030 // find
2031− std::map< std::string, long >::iterator iter = m_countMaps[track].find( key );
2031+ std::map< std::string, t_CKINT >::iterator iter = m_countMaps[track].find( key );
20322032
20332033 if( iter == m_countMaps[track].end() )
20342034 {
@@ -2049,7 +2049,7 @@ void MidiScoreReader::incrementCount( long track, const std::string & key ) · 14 unmodified lines
20492049 // name: handleNoteOn()
20502050 // desc: insert a note on into table
20512051 //-----------------------------------------------------------------------------
2052−void MidiScoreReader::handleNoteOn( MidiNoteEvent * e, long note )
2052+void MidiScoreReader::handleNoteOn( MidiNoteEvent * e, t_CKINT note )
20532053 {
20542054 // sanity check
20552055 if( !e )
@@ -2073,7 +2073,7 @@ void MidiScoreReader::handleNoteOn( MidiNoteEvent * e, long note ) · 17 unmodified lines
20732073 // name: handleNoteOff()
20742074 // desc: insert a note off into table
20752075 //-----------------------------------------------------------------------------
2076−void MidiScoreReader::handleNoteOff( long note, double time )
2076+void MidiScoreReader::handleNoteOff( t_CKINT note, double time )
20772077 {
20782078 // get the piano event
20792079 MidiNoteEvent * e = m_activeNotes[note];
@@ -2095,7 +2095,7 @@ void MidiScoreReader::handleNoteOff( long note, double time ) · 15 unmodified lines
20952095 // name: setTrackName()
20962096 // desc: sets track name
20972097 //-----------------------------------------------------------------------------
2098−void MidiScoreReader::setTrackName( long track, const std::string & name )
2098+void MidiScoreReader::setTrackName( t_CKINT track, const std::string & name )
20992099 {
21002100 // x-map it!
21012101 m_trackToName[track] = name;
@@ -2109,9 +2109,9 @@ void MidiScoreReader::setTrackName( long track, const std::string & name ) · 7 unmodified lines
21092109 // name: getTrackName()
21102110 // desc: gets track name ("" if not present)
21112111 //-----------------------------------------------------------------------------
2112−string MidiScoreReader::getTrackName( long track )
2112+string MidiScoreReader::getTrackName( t_CKINT track )
21132113 {
2114− map<long, string>::iterator itr = m_trackToName.find( track );
2114+ map<t_CKINT, string>::iterator itr = m_trackToName.find( track );
21152115
21162116 if( itr == m_trackToName.end() )
21172117 return "";
@@ -2126,10 +2126,10 @@ string MidiScoreReader::getTrackName( long track ) · 8 unmodified lines
21262126 // name: getTrackForName()
21272127 // desc: gets the track with the given name (-1 if not present)
21282128 //-----------------------------------------------------------------------------
2129−long MidiScoreReader::getTrackForName( const std::string & name )
2129+t_CKINT MidiScoreReader::getTrackForName( const std::string & name )
21302130 {
21312131 // look up the track index by name
2132− map<string, long>::iterator itr = m_nameToTrack.find( name );
2132+ map<string, t_CKINT>::iterator itr = m_nameToTrack.find( name );
21332133
21342134 // didn't find
21352135 if( itr == m_nameToTrack.end() )
src/core/midiio_rtmidi.h+31−31
@@ -399,41 +399,41 @@ public: · 398 unmodified lines
399399 // rewind to beginning
400400 void rewind();
401401 // get current top event (NO simultaneous)
402− const MidiNoteEvent * getTopEvent( long track, long offset = 0 );
402+ const MidiNoteEvent * getTopEvent( t_CKINT track, t_CKINT offset = 0 );
403403 // get current event (YES simultaneous) + move to next
404− const MidiNoteEvent * scanEvent( long track, bool & isNewSet );
404+ const MidiNoteEvent * scanEvent( t_CKINT track, bool & isNewSet );
405405 // advance to next event
406− bool seek( long track, long numToAdvance = 1 );
406+ bool seek( t_CKINT track, t_CKINT numToAdvance = 1 );
407407 // advance to next note on
408− bool seekToNoteOn( long track );
408+ bool seekToNoteOn( t_CKINT track );
409409 // get notes in a time window
410− void getEvents( long track, double startTime, double endTime, std::vector<const MidiNoteEvent *> & result,
410+ void getEvents( t_CKINT track, double startTime, double endTime, std::vector<const MidiNoteEvent *> & result,
411411 bool includeSimultaneous = false );
412412 // isDone
413− bool isDone( long track, double currTime );
413+ bool isDone( t_CKINT track, double currTime );
414414
415415
416416 public:
417417 // get number of tracks
418− long getNumTracks() const;
418+ t_CKINT getNumTracks() const;
419419 // get number of events per track
420− long getNumEvents( long track ) const;
420+ t_CKINT getNumEvents( t_CKINT track ) const;
421421 // get number of tracks with more than 0 events
422− long getNumTracksNonZero() const;
422+ t_CKINT getNumTracksNonZero() const;
423423 // get a vector of tracks indices that have more than 0 events
424− const std::vector<long> & getTracksNonZero() const;
424+ const std::vector<t_CKINT> & getTracksNonZero() const;
425425 // get BPM
426426 double getBPM() const;
427427 // get an entire track's note events
428− const std::vector<MidiNoteEvent *> & getNoteEvents( long track );
428+ const std::vector<MidiNoteEvent *> & getNoteEvents( t_CKINT track );
429429 // get an entire track's lyric events
430− const std::vector<MidiLyricEvent *> & getLyricEvents( long track );
430+ const std::vector<MidiLyricEvent *> & getLyricEvents( t_CKINT track );
431431 // get count
432− long getCount( long track, const std::string & key );
432+ t_CKINT getCount( t_CKINT track, const std::string & key );
433433 // get lowest note for a track
434− long getLowestNote( long track, const MidiNoteEvent *start );
434+ t_CKINT getLowestNote( t_CKINT track, const MidiNoteEvent *start );
435435 // get highest note for a track
436− long getHighestNote( long track, const MidiNoteEvent *start );
436+ t_CKINT getHighestNote( t_CKINT track, const MidiNoteEvent *start );
437437
438438 public: // TODO: these may as well be a separate object
439439 // push a event to remember
@@ -447,22 +447,22 @@ public: // TODO: these may as well be a separate object · 7 unmodified lines
447447
448448 public: // track naming
449449 // sets track name
450− void setTrackName( long track, const std::string & name );
450+ void setTrackName( t_CKINT track, const std::string & name );
451451 // gets track name ("" if not present)
452− std::string getTrackName( long track );
452+ std::string getTrackName( t_CKINT track );
453453 // gets the track with the given name (-1 if not present)
454− long getTrackForName( const std::string & name );
454+ t_CKINT getTrackForName( const std::string & name );
455455
456456 protected: // for use while loading a track
457457 // load a track
458− bool loadTrack( long track, std::vector<MidiNoteEvent *> & data, std::vector<MidiLyricEvent *> & lyricData );
458+ bool loadTrack( t_CKINT track, std::vector<MidiNoteEvent *> & data, std::vector<MidiLyricEvent *> & lyricData );
459459 // apply control to existing event
460− bool applyControl( long track, long data2, long data3, MidiNoteEvent * e );
460+ bool applyControl( t_CKINT track, t_CKINT data2, t_CKINT data3, MidiNoteEvent * e );
461461 // increment count for the given key (used for counting the number of notes, glissandi, etc)
462− void incrementCount( long track, const std::string & key );
462+ void incrementCount( t_CKINT track, const std::string & key );
463463 // handle note events, managing m_activeNotes and setting the event's endTime
464− void handleNoteOn( MidiNoteEvent * e, long note );
465− void handleNoteOff( long note, double time );
464+ void handleNoteOn( MidiNoteEvent * e, t_CKINT note );
465+ void handleNoteOff( t_CKINT note, double time );
466466
467467 protected:
468468 // midi
@@ -472,28 +472,28 @@ protected: · 3 unmodified lines
472472 // vector of tracks of events
473473 std::vector< std::vector<MidiLyricEvent *> > m_lyricEvents;
474474 // vector of indices
475− std::vector<unsigned long> m_indices;
475+ std::vector<t_CKUINT> m_indices;
476476 // stack of events
477477 std::deque<const MidiNoteEvent *> m_queue;
478478 // vector of event
479479 std::vector<const MidiNoteEvent *> m_result;
480480 // search pointer
481− std::vector<unsigned long> m_searchIndices;
481+ std::vector<t_CKUINT> m_searchIndices;
482482 // count map
483− std::vector< std::map< std::string, long > > m_countMaps;
483+ std::vector< std::map< std::string, t_CKINT > > m_countMaps;
484484 // HACK: scale the velocity (0-1)
485485 float m_velocity_scale;
486486 // track names
487− std::map<std::string, long> m_nameToTrack;
488− std::map<long, std::string> m_trackToName;
487+ std::map<std::string, t_CKINT> m_nameToTrack;
488+ std::map<t_CKINT, std::string> m_trackToName;
489489 // number of non-zero tracks
490− long m_numNonZeroTracks;
490+ t_CKINT m_numNonZeroTracks;
491491 // vector of indices of non-zero tracks
492− std::vector<long> m_nonZeroTrackIndices;
492+ std::vector<t_CKINT> m_nonZeroTrackIndices;
493493
494494 private: // used during track loading
495495 // active notes, map from MIDI note to event
496− std::map<long, MidiNoteEvent *> m_activeNotes;
496+ std::map<t_CKINT, MidiNoteEvent *> m_activeNotes;
497497 };
498498
499499
src/core/ugen_stk.cpp+2−2
@@ -13511,7 +13511,7 @@ SKINI :: SKINI(char *fileName) · 13510 unmodified lines
1351113511 char msg[256];
1351213512
1351313513 myFile = fopen(fileName,"r");
13514− if ((long) myFile < 0) {
13514+ if ((t_CKUINT)myFile < 0) {
1351513515 sprintf(msg, "[chuck](via SKINI): Could not open or find file (%s).", fileName);
1351613516 handleError(msg, StkError::FILE_NOT_FOUND);
1351713517 }
@@ -19445,7 +19445,7 @@ bool WvOut :: setMatFile( const char *fileName ) · 5927 unmodified lines
1944519445 memset( hdr.heading, 0, sizeof(hdr.heading) );
1944619446 strcpy(hdr.heading,"MATLAB 5.0 MAT-file, Generated using the Synthesis ToolKit in C++ (STK). By Perry R. Cook and Gary P. Scavone, 1995-2002.");
1944719447
19448− int i;
19448+ t_CKINT i;
1944919449 for (i=strlen(hdr.heading);i<124;i++) hdr.heading[i] = ' ';
1945019450
1945119451 // Header Flag Fields
src/core/ulib_opsc.cpp+6−6
@@ -167,7 +167,7 @@ private: · 166 unmodified lines
167167 OscInServer * _this = (OscInServer *) data;
168168
169169 #ifdef WIN32
170− return (int) _this->server_cb();
170+ return (t_CKINT)_this->server_cb();
171171 #else
172172 return _this->server_cb();
173173 #endif
@@ -185,7 +185,7 @@ private: · 11 unmodified lines
185185 std::string &path, t_CKBOOL &nopath,
186186 std::string &type, t_CKBOOL &notype)
187187 {
188− int comma_pos = method.find(',');
188+ t_CKINT comma_pos = method.find(',');
189189
190190 if(comma_pos != method.npos)
191191 {
@@ -519,7 +519,7 @@ public: · 327 unmodified lines
519519 t_CKBOOL start(const std::string &method)
520520 {
521521 std::string path;
522− int comma_pos = method.find(',');
522+ t_CKINT comma_pos = method.find(',');
523523 if(comma_pos != method.npos) m_path = method.substr(0, comma_pos);
524524 else m_path = method;
525525
@@ -888,7 +888,7 @@ CK_DLL_MFUN(oscin_removeAllAddresses) · 362 unmodified lines
888888
889889 in->removeAllMethods();
890890
891−error:
891+// error:
892892 return;
893893 }
894894
@@ -898,7 +898,7 @@ CK_DLL_MFUN(oscin_listenAll) · 3 unmodified lines
898898
899899 in->addMethod("");
900900
901−error:
901+// error:
902902 return;
903903 }
904904
@@ -908,7 +908,7 @@ CK_DLL_MFUN(oscin_msg) · 3 unmodified lines
908908
909909 in->removeAllMethods();
910910
911−error:
911+// error:
912912 return;
913913 }
914914
src/core/ulib_regex.cpp+2−3
@@ -84,9 +84,8 @@ DLL_QUERY regex_query( Chuck_DL_Query * QUERY ) · 83 unmodified lines
8484
8585 return TRUE;
8686
87−error:
88−
89− return FALSE;
87+//error:
88+// return FALSE;
9089 }
9190
9291
src/core/util_buffers.h+2−2
@@ -43,8 +43,8 @@ · 42 unmodified lines
4343 #include <queue>
4444 #include <iostream>
4545
46−#define DWORD__ unsigned long
47−#define SINT__ long
46+#define DWORD__ t_CKUINT
47+#define SINT__ t_CKINT
4848 #define UINT__ DWORD__
4949 #define BOOL__ DWORD__
5050 #define BYTE__ unsigned char
src/core/util_hid.cpp+3−3
@@ -5255,7 +5255,7 @@ int Joystick_count() · 5254 unmodified lines
52555255 {
52565256 if( !joysticks )
52575257 return 0;
5258− return joysticks->size();
5258+ return (int)joysticks->size();
52595259 }
52605260
52615261 int Joystick_open( int js )
@@ -5887,7 +5887,7 @@ int Keyboard_count() · 625 unmodified lines
58875887 {
58885888 if( !keyboards )
58895889 return 0;
5890− return keyboards->size();
5890+ return (int)keyboards->size();
58915891 }
58925892
58935893 int Keyboard_open( int k )
@@ -6155,7 +6155,7 @@ int Mouse_count() · 261 unmodified lines
61556155 {
61566156 if( !mice )
61576157 return 0;
6158− return mice->size();
6158+ return (int)mice->size();
61596159 }
61606160
61616161 int Mouse_open( int m )
src/core/util_math.c+3−1
@@ -40,6 +40,8 @@ · 39 unmodified lines
4040 #ifdef __PLATFORM_WIN32__
4141
4242
43+
44+#ifdef __CK_MATH_DEFINE_ROUND_TRUNC__
4345 //-----------------------------------------------------------------------------
4446 // name: round()
4547 // desc: ...
@@ -59,7 +61,7 @@ double trunc( double a ) · 13 unmodified lines
5961 {
6062 return (double)(long)a;
6163 }
62−
64+#endif // #ifdef __CK_MATH_DEFINE_ROUND_TRUNC
6365
6466
6567
src/core/util_math.h+4−0
@@ -39,10 +39,13 @@ · 38 unmodified lines
3939 extern "C" {
4040 #endif
4141
42+// 1.4.1.1 (ge) removed -- seems no longer needed on more modern windows
4243 #ifdef __PLATFORM_WIN32__
44+#ifdef __CK_MATH_DEFINE_ROUND_TRUNC__
4345 double round( double a );
4446 double trunc( double a );
4547 #endif
48+#endif
4649
4750 // 1.4.1.0 (ge) need this since __WINDOWS_MODERN__ can be defined but remainder still not found (VC++ 2010)
4851 double ck_remainder( double a, double b );
@@ -70,4 +73,5 @@ unsigned long ensurepow2( unsigned long i ); · 21 unmodified lines
7073
7174
7275
76+
7377 #endif
src/core/util_opsc.cpp+9−9
@@ -885,7 +885,7 @@ static int strlen(char *s) { · 884 unmodified lines
885885 #define STRING_ALIGN_PAD 4
886886 int OSC_effectiveStringLength(char *string)
887887 {
888− int len = strlen(string) + 1; /* We need space for the null char. */
888+ t_CKINT len = strlen(string) + 1; /* We need space for the null char. */
889889
890890 /* Round up len to next multiple of STRING_ALIGN_PAD to account for alignment padding */
891891 if((len % STRING_ALIGN_PAD) != 0) {
@@ -1168,7 +1168,7 @@ void UDP_Port_Listener::init() · 276 unmodified lines
11681168 m_in->init();
11691169 }
11701170
1171−int UDP_Port_Listener::nsubs() { return m_subscribers.size(); }
1171+int UDP_Port_Listener::nsubs() { return (int)m_subscribers.size(); }
11721172
11731173 bool UDP_Port_Listener::add( UDP_Subscriber * sub )
11741174 {
@@ -1485,9 +1485,9 @@ OSC_Transmitter::addMessage( char *address, char * args, ...) · 310 unmodified lines
14851485
14861486 OSC_writeAddressAndTypes( &_osc, address, args );
14871487
1488− int argnum = strlen(args);
1489− int osc_err = 0;
1490− for( int j = 1; !osc_err && j < argnum; j++ ) {
1488+ t_CKINT argnum = strlen(args);
1489+ t_CKINT osc_err = 0;
1490+ for(t_CKINT j = 1; !osc_err && j < argnum; j++ ) {
14911491 switch ( args[j] ) {
14921492 case 'i':
14931493 osc_err = OSC_writeIntArg ( &_osc, va_arg(tags, int) );
@@ -1513,7 +1513,7 @@ OSC_Transmitter::addMessage( char *address, char * args, ...) · 19 unmodified lines
15131513 void
15141514 OSC_Transmitter::startMessage( char * spec ) {
15151515
1516− int len = strlen( spec );
1516+ t_CKINT len = strlen( spec );
15171517
15181518 char * comma = strchr( spec, ',');
15191519 char * space = strchr ( spec, ' ');
@@ -1532,7 +1532,7 @@ OSC_Transmitter::startMessage( char * address, char * args ) · 12 unmodified lines
15321532 {
15331533 // OSC_writeAddressAndTypes( &_osc, address, args );
15341534 char addrfix[512];
1535− int addrlen = strlen( address );
1535+ t_CKINT addrlen = strlen( address );
15361536 // int mx = strlen(address) + strlen(args) + 1; // either we need to add a comma to args,
15371537 // or it's got junk in it.
15381538 // char addrfix[] = new char[mx]; // (char*) malloc( mx * sizeof( char ) );
@@ -2230,7 +2230,7 @@ OSC_Address_Space::parseSpec() { · 691 unmodified lines
22302230
22312231 // CK_FPRINTF_STDERR( " parsing spec- address %s :: type %s\n", _address, _type );
22322232
2233− int n = strlen ( type );
2233+ t_CKINT n = strlen ( type );
22342234 _noArgs = ( n == 0 );
22352235 resizeData( ( n < 1 ) ? 1 : n );
22362236 _qread = 0;
@@ -2491,7 +2491,7 @@ OSC_Address_Space::queue_mesg( OSCMesg * m ) · 254 unmodified lines
24912491
24922492 float *fp;
24932493 int *ip;
2494− int clen;
2494+ t_CKINT clen;
24952495 while ( *type != '\0' ) {
24962496 switch ( *type ) {
24972497 case 'f':
src/core/util_sndfile.c+2−1
@@ -4958,7 +4958,8 @@ psf_memset (void *s, int c, sf_count_t len) · 4957 unmodified lines
49584958
49594959 void psf_get_date_str (char *str, int maxlen)
49604960 { time_t current ;
4961− struct tm timedata, *tmptr ;
4961+ struct tm timedata, *tmptr = NULL;
4962+ memset( &timedata, 0, sizeof(struct tm) ); // 1.4.1.1 (ge) clear memory
49624963
49634964 time (&current) ;
49644965
src/core/util_string.cpp+8−4
@@ -53,7 +53,11 @@ using namespace std; · 52 unmodified lines
5353 string itoa( t_CKINT val )
5454 {
5555 char buffer[128];
56− sprintf( buffer, "%li", val );
56+#ifdef _WIN64
57+ sprintf( buffer, "%lld", val );
58+#else
59+ sprintf( buffer, "%ld", val );
60+#endif
5761 return string(buffer);
5862 }
5963
@@ -68,7 +72,7 @@ string ftoa( t_CKFLOAT val, t_CKUINT precision ) · 8 unmodified lines
6872 char str[32];
6973 char buffer[128];
7074 if( precision > 32 ) precision = 32;
71− sprintf( str, "%%.%lif", precision );
75+ sprintf( str, "%%.%lif", (long)precision );
7276 sprintf( buffer, str, val );
7377 return string(buffer);
7478 }
@@ -469,7 +473,7 @@ std::string extract_filepath_dir(std::string &filepath) · 394 unmodified lines
469473 //#endif
470474
471475 // if the last character is a slash, skip it
472− int i = filepath.rfind(path_separator);
476+ t_CKINT i = filepath.rfind(path_separator);
473477
474478 if(i == std::string::npos)
475479 return std::string();
@@ -556,7 +560,7 @@ std::string normalize_directory_separator(const std::string &filepath) · 80 unmodified lines
556560 {
557561 #ifdef __PLATFORM_WIN32__
558562 std::string new_filepath = filepath;
559− int len = new_filepath.size();
563+ t_CKINT len = new_filepath.size();
560564 for(int i = 0; i < len; i++)
561565 {
562566 if(new_filepath[i] == '\\') new_filepath[i] = '/';
src/host/chuck_main.cpp+1−1
@@ -738,7 +738,7 @@ bool go( int argc, const char ** argv ) · 737 unmodified lines
738738 // boost log level
739739 g_otf_log = CK_LOG_CORE;
740740 // flag
741− int is_otf = FALSE;
741+ t_CKINT is_otf = FALSE;
742742 // log level
743743 EM_setlog( log_level );
744744

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t