Unified · Split
| @@ -404,7 +404,7 @@ void EM_newline(void) · 403 unmodified lines | |||
| 404 | // content after rightmost '/' | 404 | // content after rightmost '/' |
| 405 | const char * mini( const char * str ) | 405 | const char * mini( const char * str ) |
| 406 | { | 406 | { |
| 407 | int len = strlen( str ); | 407 | t_CKINT len = strlen( str ); |
| 408 | const char * p = str + len; | 408 | const char * p = str + len; |
| 409 | while( p != str && *p != '/' && *p != '\\' ) p--; | 409 | while( p != str && *p != '/' && *p != '\\' ) p--; |
| 410 | return ( p == str || strlen(p+1) == 0 ? p : p+1 ); | 410 | return ( p == str || strlen(p+1) == 0 ? p : p+1 ); |
| @@ -108,7 +108,7 @@ void Chuck_Frame::get_scope( vector<Chuck_Local *> & out ) const · 107 unmodified lines | |||
| 108 | // the local | 108 | // the local |
| 109 | Chuck_Local * local = NULL; | 109 | Chuck_Local * local = NULL; |
| 110 | // the index | 110 | // the index |
| 111 | long index = this->stack.size() - 1; | 111 | t_CKINT index = this->stack.size() - 1; |
| 112 | 112 | ||
| 113 | // loop | 113 | // loop |
| 114 | while( index >= 0 && this->stack[index] != NULL ) | 114 | while( index >= 0 && this->stack[index] != NULL ) |
| @@ -4064,7 +4064,7 @@ const char * Chuck_Instr_Instantiate_Object::params() const · 4063 unmodified lines | |||
| 4064 | const char * Chuck_Instr_Pre_Ctor_Array_Top::params() const | 4064 | const char * Chuck_Instr_Pre_Ctor_Array_Top::params() const |
| 4065 | { | 4065 | { |
| 4066 | static char buffer[256]; | 4066 | 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]" ); |
| 4068 | return buffer; | 4068 | return buffer; |
| 4069 | } | 4069 | } |
| 4070 | 4070 | ||
| @@ -5015,7 +5015,7 @@ Chuck_Instr_Array_Init::Chuck_Instr_Array_Init( Chuck_Env * env, Chuck_Type * t, · 944 unmodified lines | |||
| 5015 | 5015 | ||
| 5016 | // append length | 5016 | // append length |
| 5017 | char buffer[16]; | 5017 | char buffer[16]; |
| 5018 | sprintf( buffer, "[%ld]", m_length ); | 5018 | sprintf( buffer, "[%ld]", (long)m_length ); |
| 5019 | strcat( m_param_str, buffer ); | 5019 | strcat( m_param_str, buffer ); |
| 5020 | } | 5020 | } |
| 5021 | 5021 | ||
| @@ -84,7 +84,7 @@ public: · 83 unmodified lines | |||
| 84 | 84 | ||
| 85 | public: | 85 | public: |
| 86 | virtual const char * params() const | 86 | 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; } |
| 88 | 88 | ||
| 89 | protected: | 89 | protected: |
| 90 | t_CKUINT m_jmp; | 90 | t_CKUINT m_jmp; |
| @@ -105,7 +105,7 @@ public: · 14 unmodified lines | |||
| 105 | 105 | ||
| 106 | public: | 106 | public: |
| 107 | virtual const char * params() const | 107 | 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; } |
| 109 | 109 | ||
| 110 | protected: | 110 | protected: |
| 111 | t_CKUINT m_val; | 111 | t_CKUINT m_val; |
| @@ -2134,7 +2134,7 @@ public: · 2022 unmodified lines | |||
| 2134 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 2134 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 2135 | virtual const char * params() const | 2135 | virtual const char * params() const |
| 2136 | { static char buffer[256]; | 2136 | { 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 ); |
| 2138 | return buffer; } | 2138 | return buffer; } |
| 2139 | 2139 | ||
| 2140 | protected: | 2140 | protected: |
| @@ -2159,7 +2159,7 @@ public: · 18 unmodified lines | |||
| 2159 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 2159 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 2160 | virtual const char * params() const | 2160 | virtual const char * params() const |
| 2161 | { static char buffer[256]; | 2161 | { 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 ); |
| 2163 | return buffer; } | 2163 | return buffer; } |
| 2164 | 2164 | ||
| 2165 | protected: | 2165 | protected: |
| @@ -2184,7 +2184,7 @@ public: · 18 unmodified lines | |||
| 2184 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 2184 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 2185 | virtual const char * params() const | 2185 | virtual const char * params() const |
| 2186 | { static char buffer[256]; | 2186 | { 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 ); |
| 2188 | return buffer; } | 2188 | return buffer; } |
| 2189 | 2189 | ||
| 2190 | protected: | 2190 | protected: |
| @@ -2209,7 +2209,7 @@ public: · 18 unmodified lines | |||
| 2209 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 2209 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 2210 | virtual const char * params() const | 2210 | virtual const char * params() const |
| 2211 | { static char buffer[256]; | 2211 | { 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 ); |
| 2213 | return buffer; } | 2213 | return buffer; } |
| 2214 | 2214 | ||
| 2215 | protected: | 2215 | protected: |
| @@ -2234,7 +2234,7 @@ public: · 18 unmodified lines | |||
| 2234 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 2234 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 2235 | virtual const char * params() const | 2235 | virtual const char * params() const |
| 2236 | { static char buffer[256]; | 2236 | { 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 ); |
| 2238 | return buffer; } | 2238 | return buffer; } |
| 2239 | 2239 | ||
| 2240 | protected: | 2240 | protected: |
| @@ -2284,7 +2284,7 @@ public: · 43 unmodified lines | |||
| 2284 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 2284 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 2285 | virtual const char * params() const | 2285 | virtual const char * params() const |
| 2286 | { static char buffer[256]; | 2286 | { 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 ); |
| 2288 | return buffer; } | 2288 | return buffer; } |
| 2289 | 2289 | ||
| 2290 | protected: | 2290 | protected: |
| @@ -2369,7 +2369,7 @@ public: · 78 unmodified lines | |||
| 2369 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 2369 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 2370 | virtual const char * params() const | 2370 | virtual const char * params() const |
| 2371 | { static char buffer[256]; | 2371 | { 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 ); |
| 2373 | return buffer; } | 2373 | return buffer; } |
| 2374 | 2374 | ||
| 2375 | protected: | 2375 | protected: |
| @@ -2394,7 +2394,7 @@ public: · 18 unmodified lines | |||
| 2394 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 2394 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 2395 | virtual const char * params() const | 2395 | virtual const char * params() const |
| 2396 | { static char buffer[256]; | 2396 | { 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 ); |
| 2398 | return buffer; } | 2398 | return buffer; } |
| 2399 | 2399 | ||
| 2400 | protected: | 2400 | protected: |
| @@ -3193,8 +3193,8 @@ public: · 792 unmodified lines | |||
| 3193 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3193 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3194 | virtual const char * params() const | 3194 | virtual const char * params() const |
| 3195 | { static char buffer[256]; | 3195 | { static char buffer[256]; |
| 3196 | sprintf( buffer, "kind=%ld, emit_addr=%ld istr=%ld", | 3196 | sprintf( buffer, "kind=%ld, emit_addr=%p istr=%ld", |
| 3197 | m_kind, m_emit_addr, m_istr ); | 3197 | (long)m_kind, (void *)m_emit_addr, (long)m_istr ); |
| 3198 | return buffer; } | 3198 | return buffer; } |
| 3199 | 3199 | ||
| 3200 | protected: | 3200 | protected: |
| @@ -3220,7 +3220,7 @@ public: · 19 unmodified lines | |||
| 3220 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3220 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3221 | virtual const char * params() const | 3221 | virtual const char * params() const |
| 3222 | { static char buffer[256]; | 3222 | { 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 ); |
| 3224 | return buffer; } | 3224 | return buffer; } |
| 3225 | 3225 | ||
| 3226 | protected: | 3226 | protected: |
| @@ -3247,7 +3247,7 @@ public: · 20 unmodified lines | |||
| 3247 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3247 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3248 | virtual const char * params() const | 3248 | virtual const char * params() const |
| 3249 | { static char buffer[256]; | 3249 | { 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 ); |
| 3251 | return buffer; } | 3251 | return buffer; } |
| 3252 | 3252 | ||
| 3253 | protected: | 3253 | protected: |
| @@ -3276,7 +3276,7 @@ public: · 22 unmodified lines | |||
| 3276 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3276 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3277 | virtual const char * params() const | 3277 | virtual const char * params() const |
| 3278 | { static char buffer[256]; | 3278 | { 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 ); |
| 3280 | return buffer; } | 3280 | return buffer; } |
| 3281 | 3281 | ||
| 3282 | protected: | 3282 | protected: |
| @@ -3302,7 +3302,7 @@ public: · 19 unmodified lines | |||
| 3302 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3302 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3303 | virtual const char * params() const | 3303 | virtual const char * params() const |
| 3304 | { static char buffer[256]; | 3304 | { static char buffer[256]; |
| 3305 | sprintf( buffer, "offset=%ld", m_offset ); | 3305 | sprintf( buffer, "offset=%ld", (long)m_offset ); |
| 3306 | return buffer; } | 3306 | return buffer; } |
| 3307 | 3307 | ||
| 3308 | protected: | 3308 | protected: |
| @@ -3326,7 +3326,7 @@ public: · 17 unmodified lines | |||
| 3326 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3326 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3327 | virtual const char * params() const | 3327 | virtual const char * params() const |
| 3328 | { static char buffer[256]; | 3328 | { static char buffer[256]; |
| 3329 | sprintf( buffer, "native_func=%ld", m_native_func ); | 3329 | sprintf( buffer, "native_func=%p", (void *)m_native_func ); |
| 3330 | return buffer; } | 3330 | return buffer; } |
| 3331 | 3331 | ||
| 3332 | protected: | 3332 | protected: |
| @@ -3350,7 +3350,7 @@ public: · 17 unmodified lines | |||
| 3350 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3350 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3351 | virtual const char * params() const | 3351 | virtual const char * params() const |
| 3352 | { static char buffer[256]; | 3352 | { 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 ); |
| 3354 | return buffer; } | 3354 | return buffer; } |
| 3355 | 3355 | ||
| 3356 | protected: | 3356 | protected: |
| @@ -3377,7 +3377,7 @@ public: · 20 unmodified lines | |||
| 3377 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3377 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3378 | virtual const char * params() const | 3378 | virtual const char * params() const |
| 3379 | { static char buffer[256]; | 3379 | { 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 ); |
| 3381 | return buffer; } | 3381 | return buffer; } |
| 3382 | 3382 | ||
| 3383 | protected: | 3383 | protected: |
| @@ -3403,7 +3403,7 @@ public: · 19 unmodified lines | |||
| 3403 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3403 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3404 | virtual const char * params() const | 3404 | virtual const char * params() const |
| 3405 | { static char buffer[256]; | 3405 | { static char buffer[256]; |
| 3406 | sprintf( buffer, "func=%ld", (t_CKUINT)m_func ); | 3406 | sprintf( buffer, "func=%p", (void *)m_func ); |
| 3407 | return buffer; } | 3407 | return buffer; } |
| 3408 | 3408 | ||
| 3409 | protected: | 3409 | protected: |
| @@ -3427,7 +3427,7 @@ public: · 17 unmodified lines | |||
| 3427 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3427 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3428 | virtual const char * params() const | 3428 | virtual const char * params() const |
| 3429 | { static char buffer[256]; | 3429 | { 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 ); |
| 3431 | return buffer; } | 3431 | return buffer; } |
| 3432 | 3432 | ||
| 3433 | protected: | 3433 | protected: |
| @@ -3452,7 +3452,7 @@ public: · 18 unmodified lines | |||
| 3452 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3452 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3453 | virtual const char * params() const | 3453 | virtual const char * params() const |
| 3454 | { static char buffer[256]; | 3454 | { 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 ); |
| 3456 | return buffer; } | 3456 | return buffer; } |
| 3457 | 3457 | ||
| 3458 | protected: | 3458 | protected: |
| @@ -3477,7 +3477,7 @@ public: · 18 unmodified lines | |||
| 3477 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3477 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3478 | virtual const char * params() const | 3478 | virtual const char * params() const |
| 3479 | { static char buffer[256]; | 3479 | { 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 ); |
| 3481 | return buffer; } | 3481 | return buffer; } |
| 3482 | 3482 | ||
| 3483 | protected: | 3483 | protected: |
| @@ -3502,7 +3502,7 @@ public: · 18 unmodified lines | |||
| 3502 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); | 3502 | virtual void execute( Chuck_VM * vm, Chuck_VM_Shred * shred ); |
| 3503 | virtual const char * params() const | 3503 | virtual const char * params() const |
| 3504 | { static char buffer[256]; | 3504 | { 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 ); |
| 3506 | return buffer; } | 3506 | return buffer; } |
| 3507 | 3507 | ||
| 3508 | protected: | 3508 | protected: |
| @@ -2851,7 +2851,7 @@ t_CKINT Chuck_IO_Serial::readInt( t_CKINT flags ) · 2850 unmodified lines | |||
| 2851 | return 0; | 2851 | return 0; |
| 2852 | } | 2852 | } |
| 2853 | 2853 | ||
| 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 |
| 2855 | 2855 | ||
| 2856 | if( m_flags & Chuck_IO_File::TYPE_BINARY ) | 2856 | if( m_flags & Chuck_IO_File::TYPE_BINARY ) |
| 2857 | { | 2857 | { |
| @@ -3015,8 +3015,8 @@ void Chuck_IO_Serial::write( const std::string & val ) · 157 unmodified lines | |||
| 3015 | { | 3015 | { |
| 3016 | start_read_thread(); | 3016 | start_read_thread(); |
| 3017 | 3017 | ||
| 3018 | int len = val.length(); | 3018 | t_CKUINT len = val.length(); |
| 3019 | for(int i = 0; i < len; i++) | 3019 | for(t_CKUINT i = 0; i < len; i++) |
| 3020 | // TODO: efficiency | 3020 | // TODO: efficiency |
| 3021 | m_writeBuffer.put(val[i]); | 3021 | m_writeBuffer.put(val[i]); |
| 3022 | 3022 | ||
| @@ -3063,13 +3063,13 @@ void Chuck_IO_Serial::write( t_CKINT val, t_CKINT size ) · 40 unmodified lines | |||
| 3063 | { | 3063 | { |
| 3064 | // TODO: don't use m_tmp_buf (thread safety?) | 3064 | // TODO: don't use m_tmp_buf (thread safety?) |
| 3065 | #ifdef WIN32 | 3065 | #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); |
| 3067 | m_tmp_buf[m_tmp_buf_max - 1] = '\0'; // force NULL terminator -- see http://www.di-mgt.com.au/cprog.html#snprintf | 3067 | m_tmp_buf[m_tmp_buf_max - 1] = '\0'; // force NULL terminator -- see http://www.di-mgt.com.au/cprog.html#snprintf |
| 3068 | #else | 3068 | #else |
| 3069 | snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%li", val); | 3069 | snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%li", val); |
| 3070 | #endif | 3070 | #endif |
| 3071 | int len = strlen((char *)m_tmp_buf); | 3071 | t_CKUINT len = strlen((char *)m_tmp_buf); |
| 3072 | for(int i = 0; i < len; i++) | 3072 | for(t_CKUINT i = 0; i < len; i++) |
| 3073 | // TODO: efficiency | 3073 | // TODO: efficiency |
| 3074 | m_writeBuffer.put(m_tmp_buf[i]); | 3074 | m_writeBuffer.put(m_tmp_buf[i]); |
| 3075 | 3075 | ||
| @@ -3102,7 +3102,7 @@ void Chuck_IO_Serial::write( t_CKINT val, t_CKINT size ) · 26 unmodified lines | |||
| 3102 | { | 3102 | { |
| 3103 | if( m_flags & Chuck_IO_File::TYPE_ASCII ) | 3103 | if( m_flags & Chuck_IO_File::TYPE_ASCII ) |
| 3104 | { | 3104 | { |
| 3105 | fprintf( m_cfd, "%li", val ); | 3105 | fprintf( m_cfd, "%li", (long)val ); |
| 3106 | } | 3106 | } |
| 3107 | else | 3107 | else |
| 3108 | { | 3108 | { |
| @@ -3134,8 +3134,8 @@ void Chuck_IO_Serial::write( t_CKFLOAT val ) · 25 unmodified lines | |||
| 3134 | snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%f", val); | 3134 | snprintf((char *)m_tmp_buf, m_tmp_buf_max, "%f", val); |
| 3135 | #endif | 3135 | #endif |
| 3136 | 3136 | ||
| 3137 | int len = strlen((char *)m_tmp_buf); | 3137 | t_CKUINT len = strlen((char *)m_tmp_buf); |
| 3138 | for(int i = 0; i < len; i++) | 3138 | for(t_CKUINT i = 0; i < len; i++) |
| 3139 | // TODO: efficiency | 3139 | // TODO: efficiency |
| 3140 | m_writeBuffer.put(m_tmp_buf[i]); | 3140 | m_writeBuffer.put(m_tmp_buf[i]); |
| 3141 | 3141 | ||
| @@ -3517,7 +3517,7 @@ t_CKINT Chuck_IO_Serial::buffer_bytes_to_tmp(t_CKINT num_bytes) · 375 unmodified lines | |||
| 3517 | t_CKBOOL Chuck_IO_Serial::handle_line(Chuck_IO_Serial::Request &r) | 3517 | t_CKBOOL Chuck_IO_Serial::handle_line(Chuck_IO_Serial::Request &r) |
| 3518 | { | 3518 | { |
| 3519 | t_CKUINT len = 0; | 3519 | t_CKUINT len = 0; |
| 3520 | Chuck_String * str; | 3520 | Chuck_String * str = NULL; |
| 3521 | 3521 | ||
| 3522 | while(!m_do_exit) | 3522 | while(!m_do_exit) |
| 3523 | { | 3523 | { |
| @@ -251,8 +251,8 @@ cleanup: · 250 unmodified lines | |||
| 251 | // name: otf_send_file() | 251 | // name: otf_send_file() |
| 252 | // desc: ... | 252 | // desc: ... |
| 253 | //----------------------------------------------------------------------------- | 253 | //----------------------------------------------------------------------------- |
| 254 | int otf_send_file( const char * fname, Net_Msg & msg, const char * op, | 254 | t_CKINT otf_send_file( const char * fname, Net_Msg & msg, const char * op, |
| 255 | ck_socket dest ) | 255 | ck_socket dest ) |
| 256 | { | 256 | { |
| 257 | FILE * fd = NULL; | 257 | FILE * fd = NULL; |
| 258 | struct stat fs; | 258 | struct stat fs; |
| @@ -355,7 +355,7 @@ int otf_send_file( const char * fname, Net_Msg & msg, const char * op, · 96 unmodified lines | |||
| 355 | // name: otf_send_connect() | 355 | // name: otf_send_connect() |
| 356 | // desc: ... | 356 | // desc: ... |
| 357 | //----------------------------------------------------------------------------- | 357 | //----------------------------------------------------------------------------- |
| 358 | ck_socket otf_send_connect( const char * host, int port ) | 358 | ck_socket otf_send_connect( const char * host, t_CKINT port ) |
| 359 | { | 359 | { |
| 360 | // log | 360 | // log |
| 361 | EM_log( CK_LOG_INFO, "otf connect: %s:%i", host, port ); | 361 | 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 | |||
| 389 | // name: otf_send_cmd() | 389 | // name: otf_send_cmd() |
| 390 | // desc: ... | 390 | // desc: ... |
| 391 | //----------------------------------------------------------------------------- | 391 | //----------------------------------------------------------------------------- |
| 392 | int otf_send_cmd( int argc, const char ** argv, t_CKINT & i, const char * host, int port, | 392 | t_CKINT otf_send_cmd( t_CKINT argc, const char ** argv, t_CKINT & i, |
| 393 | int * is_otf ) | 393 | const char * host, t_CKINT port, t_CKINT * is_otf ) |
| 394 | { | 394 | { |
| 395 | Net_Msg msg; | 395 | Net_Msg msg; |
| 396 | // REFACTOR-2017 TODO: wat is global sigpipe mode | 396 | // REFACTOR-2017 TODO: wat is global sigpipe mode |
| @@ -1,3 +1,4 @@ | |||
| 1 | /*---------------------------------------------------------------------------- | ||
| 1 | /*---------------------------------------------------------------------------- | 2 | /*---------------------------------------------------------------------------- |
| 2 | ChucK Concurrent, On-the-fly Audio Programming Language | 3 | ChucK Concurrent, On-the-fly Audio Programming Language |
| 3 | Compiler and Virtual Machine | 4 | Compiler and Virtual Machine |
| @@ -78,11 +79,11 @@ t_CKUINT otf_process_msg( Chuck_VM * vm, Chuck_Compiler * compiler, · 74 unmodified lines | |||
| 78 | Net_Msg * msg, t_CKBOOL immediate, void * data ); | 79 | Net_Msg * msg, t_CKBOOL immediate, void * data ); |
| 79 | 80 | ||
| 80 | // send command | 81 | // 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 ); |
| 82 | // send file to remote host | 83 | // 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 ); |
| 84 | // connect | 85 | // connect |
| 85 | ck_socket otf_send_connect( const char * host, int port ); | 86 | ck_socket otf_send_connect( const char * host, t_CKINT port ); |
| 86 | 87 | ||
| 87 | // callback | 88 | // callback |
| 88 | void * otf_cb( void * p ); | 89 | void * otf_cb( void * p ); |
| @@ -564,7 +564,7 @@ void Chuck_Shell::continue_code( string & in ) · 563 unmodified lines | |||
| 564 | #ifndef __PLATFORM_WIN32__ | 564 | #ifndef __PLATFORM_WIN32__ |
| 565 | snprintf( buf, 16, "code %2d> ", (int)scope ); | 565 | snprintf( buf, 16, "code %2d> ", (int)scope ); |
| 566 | #else | 566 | #else |
| 567 | sprintf( buf, "code %2d> ", scope); | 567 | sprintf( buf, "code %2ld> ", (long)scope); |
| 568 | #endif | 568 | #endif |
| 569 | prompt = buf; | 569 | prompt = buf; |
| 570 | } | 570 | } |
| @@ -577,7 +577,7 @@ void Chuck_Shell::continue_code( string & in ) · 6 unmodified lines | |||
| 577 | #ifndef __PLATFORM_WIN32__ | 577 | #ifndef __PLATFORM_WIN32__ |
| 578 | snprintf( buf, 16, "code %2d> ", (int)scope ); | 578 | snprintf( buf, 16, "code %2d> ", (int)scope ); |
| 579 | #else | 579 | #else |
| 580 | sprintf( buf, "code %2d> ", scope); | 580 | sprintf( buf, "code %2ld> ", (long)scope); |
| 581 | #endif | 581 | #endif |
| 582 | prompt = buf; | 582 | prompt = buf; |
| 583 | } | 583 | } |
| @@ -1421,7 +1421,7 @@ t_CKINT Chuck_Shell::Command_Ls::execute( vector< string > & argv, · 837 unmodified lines | |||
| 1421 | 1421 | ||
| 1422 | if( argv.size() == 0 ) | 1422 | if( argv.size() == 0 ) |
| 1423 | { | 1423 | { |
| 1424 | DWORD i, k = 64; | 1424 | t_CKUINT i, k = 64; |
| 1425 | LPTSTR cwd = new char [k]; | 1425 | LPTSTR cwd = new char [k]; |
| 1426 | WIN32_FIND_DATA find_data; | 1426 | WIN32_FIND_DATA find_data; |
| 1427 | 1427 | ||
| @@ -1450,12 +1450,12 @@ t_CKINT Chuck_Shell::Command_Ls::execute( vector< string > & argv, · 22 unmodified lines | |||
| 1450 | return 0; | 1450 | return 0; |
| 1451 | } | 1451 | } |
| 1452 | 1452 | ||
| 1453 | int i, len = argv.size(); | 1453 | t_CKINT i, len = argv.size(); |
| 1454 | t_CKBOOL print_parent_name = len > 1 ? TRUE : FALSE; | 1454 | t_CKBOOL print_parent_name = len > 1 ? TRUE : FALSE; |
| 1455 | 1455 | ||
| 1456 | for( i = 0; i < len; i++ ) | 1456 | for( i = 0; i < len; i++ ) |
| 1457 | { | 1457 | { |
| 1458 | int j = argv[i].size() + 3; | 1458 | t_CKINT j = argv[i].size() + 3; |
| 1459 | WIN32_FIND_DATA find_data; | 1459 | WIN32_FIND_DATA find_data; |
| 1460 | LPTSTR dir = new char [j]; | 1460 | LPTSTR dir = new char [j]; |
| 1461 | strncpy( dir, argv[i].c_str(), j ); | 1461 | strncpy( dir, argv[i].c_str(), j ); |
| @@ -1889,7 +1889,7 @@ t_CKINT Chuck_Shell::Command_VMAdd::execute( vector< string > & argv, · 427 unmodified lines | |||
| 1889 | #ifndef __PLATFORM_WIN32__ | 1889 | #ifndef __PLATFORM_WIN32__ |
| 1890 | snprintf( buf, 16, "%lu", caller->vms.size() - 1 ); | 1890 | snprintf( buf, 16, "%lu", caller->vms.size() - 1 ); |
| 1891 | #else | 1891 | #else |
| 1892 | sprintf( buf, "%u", caller->vms.size() - 1 ); | 1892 | sprintf( buf, "%lu", (long)caller->vms.size() - 1 ); |
| 1893 | #endif // __PLATFORM_WIN32__ | 1893 | #endif // __PLATFORM_WIN32__ |
| 1894 | 1894 | ||
| 1895 | out += caller->current_vm->fullname() + " saved as VM " + buf + "\n"; | 1895 | 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 | |||
| 1987 | #ifndef __PLATFORM_WIN32__ | 1987 | #ifndef __PLATFORM_WIN32__ |
| 1988 | snprintf( buf, 16, "%lu", i ); | 1988 | snprintf( buf, 16, "%lu", i ); |
| 1989 | #else | 1989 | #else |
| 1990 | sprintf( buf, "%lu", i ); | 1990 | sprintf( buf, "%lu", (long)i ); |
| 1991 | #endif // __PLATFORM_WIN32__ | 1991 | #endif // __PLATFORM_WIN32__ |
| 1992 | out += string( "VM " ) + buf + ": " + | 1992 | out += string( "VM " ) + buf + ": " + |
| 1993 | caller->vms[i]->fullname() + "\n"; | 1993 | caller->vms[i]->fullname() + "\n"; |
| @@ -43,7 +43,8 @@ struct S_Symbol_ { c_str name; S_Symbol next; }; · 42 unmodified lines | |||
| 43 | static S_Symbol mksymbol( c_constr name, S_Symbol next ) | 43 | static S_Symbol mksymbol( c_constr name, S_Symbol next ) |
| 44 | { | 44 | { |
| 45 | S_Symbol s = (S_Symbol)checked_malloc(sizeof(*s)); | 45 | 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); | ||
| 47 | strcpy(s->name, (c_str)name); s->next=next; | 48 | strcpy(s->name, (c_str)name); s->next=next; |
| 48 | return s; | 49 | return s; |
| 49 | } | 50 | } |
| @@ -127,11 +127,11 @@ void TAB_delete( TAB_table t ) · 126 unmodified lines | |||
| 127 | 127 | ||
| 128 | void TAB_enter(TAB_table t, void *key, void *value) | 128 | void TAB_enter(TAB_table t, void *key, void *value) |
| 129 | { | 129 | { |
| 130 | long index; | 130 | t_CKINT index; |
| 131 | unsigned long hval = (unsigned long)key; | 131 | t_CKUINT hval = (t_CKUINT)key; |
| 132 | assert(t && key); | 132 | assert(t && key); |
| 133 | if( t->hash_func ) | 133 | if( t->hash_func ) |
| 134 | hval = (unsigned long)t->hash_func(key); | 134 | hval = (t_CKUINT)t->hash_func(key); |
| 135 | index = hval % t->size; | 135 | index = hval % t->size; |
| 136 | t->table[index] = Binder(key, value, t->table[index], t->top); | 136 | t->table[index] = Binder(key, value, t->table[index], t->top); |
| 137 | t->top = key; | 137 | t->top = key; |
| @@ -139,12 +139,12 @@ void TAB_enter(TAB_table t, void *key, void *value) · 1 unmodified line | |||
| 139 | 139 | ||
| 140 | void *TAB_look(TAB_table t, void *key) | 140 | void *TAB_look(TAB_table t, void *key) |
| 141 | { | 141 | { |
| 142 | long index; | 142 | t_CKINT index; |
| 143 | unsigned long hval = (unsigned long)key; | 143 | t_CKUINT hval = (t_CKUINT)key; |
| 144 | binder b; | 144 | binder b; |
| 145 | assert(t && key); | 145 | assert(t && key); |
| 146 | if( t->hash_func ) | 146 | if( t->hash_func ) |
| 147 | hval = (unsigned long)t->hash_func(key); | 147 | hval = (t_CKUINT)t->hash_func(key); |
| 148 | index= hval % t->size; | 148 | index= hval % t->size; |
| 149 | if( !t->eq_func ) | 149 | if( !t->eq_func ) |
| 150 | { | 150 | { |
| @@ -163,13 +163,13 @@ void *TAB_look(TAB_table t, void *key) · 12 unmodified lines | |||
| 163 | void *TAB_pop(TAB_table t) | 163 | void *TAB_pop(TAB_table t) |
| 164 | { | 164 | { |
| 165 | void *k; binder b; long index; | 165 | void *k; binder b; long index; |
| 166 | unsigned long hval; | 166 | t_CKUINT hval; |
| 167 | assert (t); | 167 | assert (t); |
| 168 | k = t->top; | 168 | k = t->top; |
| 169 | assert (k); | 169 | assert (k); |
| 170 | hval = (unsigned long)k; | 170 | hval = (t_CKUINT)k; |
| 171 | if(t->hash_func) hval = (unsigned long)t->hash_func(k); | 171 | if(t->hash_func) hval = (t_CKUINT)t->hash_func(k); |
| 172 | index = ((unsigned long)hval) % t->size; | 172 | index = hval % t->size; |
| 173 | b = t->table[index]; | 173 | b = t->table[index]; |
| 174 | assert(b); | 174 | assert(b); |
| 175 | t->table[index] = b->next; | 175 | t->table[index] = b->next; |
| @@ -179,13 +179,13 @@ void *TAB_pop(TAB_table t) · 3 unmodified lines | |||
| 179 | 179 | ||
| 180 | void *TAB_topv(TAB_table t) | 180 | void *TAB_topv(TAB_table t) |
| 181 | { | 181 | { |
| 182 | void *k; binder b; long index; | 182 | void *k; binder b; t_CKINT index; |
| 183 | unsigned long hval; | 183 | t_CKUINT hval; |
| 184 | assert(t); | 184 | assert(t); |
| 185 | k = t->top; | 185 | k = t->top; |
| 186 | assert(k); | 186 | assert(k); |
| 187 | hval = (unsigned long)k; | 187 | hval = (t_CKUINT)k; |
| 188 | if(t->hash_func) hval = (unsigned long)t->hash_func(k); | 188 | if(t->hash_func) hval = (t_CKUINT)t->hash_func(k); |
| 189 | index = hval % t->size; | 189 | index = hval % t->size; |
| 190 | b = t->table[index]; | 190 | b = t->table[index]; |
| 191 | assert(b); | 191 | assert(b); |
| @@ -195,7 +195,7 @@ void *TAB_topv(TAB_table t) · 3 unmodified lines | |||
| 195 | void TAB_dump(TAB_table t, void (*show)(void *key, void *value)) | 195 | void TAB_dump(TAB_table t, void (*show)(void *key, void *value)) |
| 196 | { | 196 | { |
| 197 | void *k = t->top; | 197 | void *k = t->top; |
| 198 | long index = ((unsigned long)k) % t->size; | 198 | t_CKINT index = ((t_CKUINT)k) % t->size; |
| 199 | binder b = t->table[index]; | 199 | binder b = t->table[index]; |
| 200 | if (b==NULL) return; | 200 | if (b==NULL) return; |
| 201 | t->table[index]=b->next; | 201 | t->table[index]=b->next; |
| @@ -58,7 +58,8 @@ void * checked_malloc( int len ) · 57 unmodified lines | |||
| 58 | 58 | ||
| 59 | c_str cc_str( char * s ) | 59 | c_str cc_str( char * s ) |
| 60 | { | 60 | { |
| 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 ); | ||
| 62 | strcpy( p, s ); | 63 | strcpy( p, s ); |
| 63 | 64 | ||
| 64 | return p; | 65 | return p; |
| @@ -622,8 +622,8 @@ void MidiInManager::cb_midi_input( double deltatime, std::vector<unsigned char> · 621 unmodified lines | |||
| 622 | // it needs to know its device number so it can inform all VMs waiting | 622 | // it needs to know its device number so it can inform all VMs waiting |
| 623 | // on that device number. | 623 | // on that device number. |
| 624 | // --> device num stored in userData | 624 | // --> device num stored in userData |
| 625 | unsigned int nBytes = (unsigned int) msg->size(); | 625 | t_CKUINT nBytes = (t_CKUINT)msg->size(); |
| 626 | unsigned int device_num = (unsigned int) ((unsigned long) userData); | 626 | t_CKUINT device_num = (t_CKUINT)userData; |
| 627 | // check if we know the bufs for that device num (we should!) | 627 | // check if we know the bufs for that device num (we should!) |
| 628 | if( device_num >= the_bufs.size() ) | 628 | if( device_num >= the_bufs.size() ) |
| 629 | { | 629 | { |
| @@ -1196,10 +1196,10 @@ void MidiScoreReader::cleanup() · 566 unmodified lines | |||
| 1196 | MidiNoteEvent * next = NULL; | 1196 | MidiNoteEvent * next = NULL; |
| 1197 | 1197 | ||
| 1198 | // clean up the tracks | 1198 | // 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++ ) |
| 1200 | { | 1200 | { |
| 1201 | // for each track | 1201 | // 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++ ) |
| 1203 | { | 1203 | { |
| 1204 | // get track | 1204 | // get track |
| 1205 | e = m_events[i][j]; | 1205 | e = m_events[i][j]; |
| @@ -1280,7 +1280,7 @@ bool MidiScoreReader::load( const char * path, float velScale ) · 74 unmodified lines | |||
| 1280 | m_indices.resize( m_midiFile->getNumberOfTracks() ); | 1280 | m_indices.resize( m_midiFile->getNumberOfTracks() ); |
| 1281 | m_countMaps.resize( m_midiFile->getNumberOfTracks() ); | 1281 | m_countMaps.resize( m_midiFile->getNumberOfTracks() ); |
| 1282 | // iterate and set | 1282 | // iterate and set |
| 1283 | for( long i = 0; i < m_midiFile->getNumberOfTracks(); i++ ) | 1283 | for( t_CKINT i = 0; i < m_midiFile->getNumberOfTracks(); i++ ) |
| 1284 | { | 1284 | { |
| 1285 | // load up the arrays | 1285 | // load up the arrays |
| 1286 | loadTrack( i, m_events[i], m_lyricEvents[i] ); | 1286 | loadTrack( i, m_events[i], m_lyricEvents[i] ); |
| @@ -1312,7 +1312,7 @@ bool MidiScoreReader::load( const char * path, float velScale ) · 25 unmodified lines | |||
| 1312 | // name: getNumTracks() | 1312 | // name: getNumTracks() |
| 1313 | // desc: get the number of tracks | 1313 | // desc: get the number of tracks |
| 1314 | //----------------------------------------------------------------------------- | 1314 | //----------------------------------------------------------------------------- |
| 1315 | long MidiScoreReader::getNumTracks() const | 1315 | t_CKINT MidiScoreReader::getNumTracks() const |
| 1316 | { | 1316 | { |
| 1317 | if( m_midiFile == NULL ) return 0; | 1317 | if( m_midiFile == NULL ) return 0; |
| 1318 | return m_midiFile->getNumberOfTracks(); | 1318 | return m_midiFile->getNumberOfTracks(); |
| @@ -1325,7 +1325,7 @@ long MidiScoreReader::getNumTracks() const · 6 unmodified lines | |||
| 1325 | // name: getNumTracksNonZero() | 1325 | // name: getNumTracksNonZero() |
| 1326 | // desc: get number of tracks with more than 0 zero | 1326 | // desc: get number of tracks with more than 0 zero |
| 1327 | //----------------------------------------------------------------------------- | 1327 | //----------------------------------------------------------------------------- |
| 1328 | long MidiScoreReader::getNumTracksNonZero() const | 1328 | t_CKINT MidiScoreReader::getNumTracksNonZero() const |
| 1329 | { | 1329 | { |
| 1330 | if( m_midiFile == NULL ) return 0; | 1330 | if( m_midiFile == NULL ) return 0; |
| 1331 | return m_numNonZeroTracks; | 1331 | return m_numNonZeroTracks; |
| @@ -1338,7 +1338,7 @@ long MidiScoreReader::getNumTracksNonZero() const · 6 unmodified lines | |||
| 1338 | // name: getTracksNonZero() | 1338 | // name: getTracksNonZero() |
| 1339 | // desc: get a vector of tracks indices that have more than 0 events | 1339 | // desc: get a vector of tracks indices that have more than 0 events |
| 1340 | //----------------------------------------------------------------------------- | 1340 | //----------------------------------------------------------------------------- |
| 1341 | const std::vector<long> & MidiScoreReader::getTracksNonZero() const | 1341 | const std::vector<t_CKINT> & MidiScoreReader::getTracksNonZero() const |
| 1342 | { | 1342 | { |
| 1343 | return m_nonZeroTrackIndices; | 1343 | return m_nonZeroTrackIndices; |
| 1344 | } | 1344 | } |
| @@ -1363,7 +1363,7 @@ double MidiScoreReader::getBPM() const · 18 unmodified lines | |||
| 1363 | // name: getLowestNote() | 1363 | // name: getLowestNote() |
| 1364 | // desc: get lowest note for a track | 1364 | // desc: get lowest note for a track |
| 1365 | //----------------------------------------------------------------------------- | 1365 | //----------------------------------------------------------------------------- |
| 1366 | long MidiScoreReader::getLowestNote( long track, const MidiNoteEvent * start ) | 1366 | t_CKINT MidiScoreReader::getLowestNote( t_CKINT track, const MidiNoteEvent * start ) |
| 1367 | { | 1367 | { |
| 1368 | int lowestNote = 128; | 1368 | int lowestNote = 128; |
| 1369 | int startingPoint = 0; | 1369 | int startingPoint = 0; |
| @@ -1399,15 +1399,15 @@ long MidiScoreReader::getLowestNote( long track, const MidiNoteEvent * start ) · 29 unmodified lines | |||
| 1399 | // name: getHighestNote() | 1399 | // name: getHighestNote() |
| 1400 | // desc: get highest note for a track | 1400 | // desc: get highest note for a track |
| 1401 | //----------------------------------------------------------------------------- | 1401 | //----------------------------------------------------------------------------- |
| 1402 | long MidiScoreReader::getHighestNote( long track, const MidiNoteEvent *start ) | 1402 | t_CKINT MidiScoreReader::getHighestNote( t_CKINT track, const MidiNoteEvent *start ) |
| 1403 | { | 1403 | { |
| 1404 | long highestNote = 0; | 1404 | t_CKINT highestNote = 0; |
| 1405 | long startingPoint = 0; | 1405 | t_CKINT startingPoint = 0; |
| 1406 | 1406 | ||
| 1407 | // get the starting point | 1407 | // get the starting point |
| 1408 | if( start != NULL ) | 1408 | if( start != NULL ) |
| 1409 | { | 1409 | { |
| 1410 | for( long i = 0; i < m_events[track].size(); i++ ) | 1410 | for( t_CKINT i = 0; i < m_events[track].size(); i++ ) |
| 1411 | { | 1411 | { |
| 1412 | if( m_events[track].at(i) == start ) | 1412 | if( m_events[track].at(i) == start ) |
| 1413 | { | 1413 | { |
| @@ -1417,7 +1417,7 @@ long MidiScoreReader::getHighestNote( long track, const MidiNoteEvent *start ) · 3 unmodified lines | |||
| 1417 | } | 1417 | } |
| 1418 | } | 1418 | } |
| 1419 | 1419 | ||
| 1420 | for( long i = startingPoint; i < m_events[track].size(); i++ ) | 1420 | for( t_CKINT i = startingPoint; i < m_events[track].size(); i++ ) |
| 1421 | { | 1421 | { |
| 1422 | if( m_events[track].at(i)->data2 > highestNote ) | 1422 | if( m_events[track].at(i)->data2 > highestNote ) |
| 1423 | highestNote = m_events[track].at(i)->data2; | 1423 | highestNote = m_events[track].at(i)->data2; |
| @@ -1435,7 +1435,7 @@ long MidiScoreReader::getHighestNote( long track, const MidiNoteEvent *start ) · 11 unmodified lines | |||
| 1435 | // name: getTopEvent() | 1435 | // name: getTopEvent() |
| 1436 | // desc: return current (top-level) note event on track | 1436 | // desc: return current (top-level) note event on track |
| 1437 | //----------------------------------------------------------------------------- | 1437 | //----------------------------------------------------------------------------- |
| 1438 | const MidiNoteEvent * MidiScoreReader::getTopEvent( long track, long offset ) | 1438 | const MidiNoteEvent * MidiScoreReader::getTopEvent( t_CKINT track, t_CKINT offset ) |
| 1439 | { | 1439 | { |
| 1440 | // sanity check | 1440 | // sanity check |
| 1441 | if( !m_midiFile || track >= m_events.size() ) | 1441 | if( !m_midiFile || track >= m_events.size() ) |
| @@ -1445,7 +1445,7 @@ const MidiNoteEvent * MidiScoreReader::getTopEvent( long track, long offset ) · 3 unmodified lines | |||
| 1445 | } | 1445 | } |
| 1446 | 1446 | ||
| 1447 | // the new index | 1447 | // the new index |
| 1448 | long index = m_indices[track] + offset; | 1448 | t_CKINT index = m_indices[track] + offset; |
| 1449 | // check it | 1449 | // check it |
| 1450 | if( index < 0 || index >= m_events[track].size() ) return NULL; | 1450 | if( index < 0 || index >= m_events[track].size() ) return NULL; |
| 1451 | // return it | 1451 | // return it |
| @@ -1459,7 +1459,7 @@ const MidiNoteEvent * MidiScoreReader::getTopEvent( long track, long offset ) · 7 unmodified lines | |||
| 1459 | // name: scanEvent() | 1459 | // name: scanEvent() |
| 1460 | // desc: get the next event (respects simultaneous) + move to next | 1460 | // desc: get the next event (respects simultaneous) + move to next |
| 1461 | //----------------------------------------------------------------------------- | 1461 | //----------------------------------------------------------------------------- |
| 1462 | const MidiNoteEvent * MidiScoreReader::scanEvent( long track, bool & isNewSet ) | 1462 | const MidiNoteEvent * MidiScoreReader::scanEvent( t_CKINT track, bool & isNewSet ) |
| 1463 | { | 1463 | { |
| 1464 | const MidiNoteEvent * e = NULL; | 1464 | const MidiNoteEvent * e = NULL; |
| 1465 | isNewSet = false; | 1465 | isNewSet = false; |
| @@ -1492,7 +1492,7 @@ const MidiNoteEvent * MidiScoreReader::scanEvent( long track, bool & isNewSet ) · 26 unmodified lines | |||
| 1492 | // name: seek() | 1492 | // name: seek() |
| 1493 | // desc: advance to an event on a track | 1493 | // desc: advance to an event on a track |
| 1494 | //----------------------------------------------------------------------------- | 1494 | //----------------------------------------------------------------------------- |
| 1495 | bool MidiScoreReader::seek( long track, long numToAdvance ) | 1495 | bool MidiScoreReader::seek( t_CKINT track, t_CKINT numToAdvance ) |
| 1496 | { | 1496 | { |
| 1497 | // sanity check | 1497 | // sanity check |
| 1498 | if( !m_midiFile || track >= m_events.size() ) | 1498 | if( !m_midiFile || track >= m_events.size() ) |
| @@ -1502,7 +1502,7 @@ bool MidiScoreReader::seek( long track, long numToAdvance ) · 3 unmodified lines | |||
| 1502 | } | 1502 | } |
| 1503 | 1503 | ||
| 1504 | // the next index | 1504 | // the next index |
| 1505 | long index = m_indices[track] + numToAdvance; | 1505 | t_CKINT index = m_indices[track] + numToAdvance; |
| 1506 | // check it | 1506 | // check it |
| 1507 | if( index < 0 ) index = 0; | 1507 | if( index < 0 ) index = 0; |
| 1508 | else if( index >= m_events[track].size() ) index = m_events[track].size(); | 1508 | 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 | |||
| 1521 | // name: seekToNoteOn() | 1521 | // name: seekToNoteOn() |
| 1522 | // desc: advance to an event on a track | 1522 | // desc: advance to an event on a track |
| 1523 | //----------------------------------------------------------------------------- | 1523 | //----------------------------------------------------------------------------- |
| 1524 | bool MidiScoreReader::seekToNoteOn( long track ) | 1524 | bool MidiScoreReader::seekToNoteOn( t_CKINT track ) |
| 1525 | { | 1525 | { |
| 1526 | // sanity check | 1526 | // sanity check |
| 1527 | if( !m_midiFile || track >= m_events.size() ) | 1527 | if( !m_midiFile || track >= m_events.size() ) |
| @@ -1532,7 +1532,7 @@ bool MidiScoreReader::seekToNoteOn( long track ) · 4 unmodified lines | |||
| 1532 | 1532 | ||
| 1533 | // event | 1533 | // event |
| 1534 | const MidiNoteEvent * e = NULL; | 1534 | const MidiNoteEvent * e = NULL; |
| 1535 | long index = 0; | 1535 | t_CKINT index = 0; |
| 1536 | 1536 | ||
| 1537 | // go | 1537 | // go |
| 1538 | do { | 1538 | do { |
| @@ -1567,7 +1567,7 @@ void MidiScoreReader::rewind() · 28 unmodified lines | |||
| 1567 | if( !m_midiFile ) return; | 1567 | if( !m_midiFile ) return; |
| 1568 | 1568 | ||
| 1569 | // set all indices to 0 | 1569 | // 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++ ) |
| 1571 | { | 1571 | { |
| 1572 | // clear | 1572 | // clear |
| 1573 | m_indices[i] = 0; | 1573 | m_indices[i] = 0; |
| @@ -1582,7 +1582,7 @@ void MidiScoreReader::rewind() · 8 unmodified lines | |||
| 1582 | // name: getEvents() | 1582 | // name: getEvents() |
| 1583 | // desc: get notes in a time window | 1583 | // desc: get notes in a time window |
| 1584 | //----------------------------------------------------------------------------- | 1584 | //----------------------------------------------------------------------------- |
| 1585 | void MidiScoreReader::getEvents( long track, double startTime, double endTime, | 1585 | void MidiScoreReader::getEvents( t_CKINT track, double startTime, double endTime, |
| 1586 | vector<const MidiNoteEvent *> & result, | 1586 | vector<const MidiNoteEvent *> & result, |
| 1587 | bool includeSimultaneous ) | 1587 | bool includeSimultaneous ) |
| 1588 | { | 1588 | { |
| @@ -1616,7 +1616,7 @@ void MidiScoreReader::getEvents( long track, double startTime, double endTime, · 27 unmodified lines | |||
| 1616 | return; | 1616 | return; |
| 1617 | 1617 | ||
| 1618 | // the index | 1618 | // the index |
| 1619 | unsigned long searchIndex = m_searchIndices[track]; | 1619 | t_CKUINT searchIndex = m_searchIndices[track]; |
| 1620 | 1620 | ||
| 1621 | // scan for events within the window | 1621 | // scan for events within the window |
| 1622 | while( searchPtr ) | 1622 | while( searchPtr ) |
| @@ -1652,14 +1652,14 @@ void MidiScoreReader::getEvents( long track, double startTime, double endTime, · 29 unmodified lines | |||
| 1652 | // name: isDone() | 1652 | // name: isDone() |
| 1653 | // desc: is done | 1653 | // desc: is done |
| 1654 | //----------------------------------------------------------------------------- | 1654 | //----------------------------------------------------------------------------- |
| 1655 | bool MidiScoreReader::isDone( long track, double currTime ) | 1655 | bool MidiScoreReader::isDone( t_CKINT track, double currTime ) |
| 1656 | { | 1656 | { |
| 1657 | // sanity check | 1657 | // sanity check |
| 1658 | if( track < 0 || track >= m_events.size() ) | 1658 | if( track < 0 || track >= m_events.size() ) |
| 1659 | return true; | 1659 | return true; |
| 1660 | 1660 | ||
| 1661 | // number of events on a track | 1661 | // number of events on a track |
| 1662 | long numEvents = m_events[track].size(); | 1662 | t_CKINT numEvents = m_events[track].size(); |
| 1663 | // check time against last element | 1663 | // check time against last element |
| 1664 | if( numEvents <= 0 ) | 1664 | if( numEvents <= 0 ) |
| 1665 | return true; | 1665 | return true; |
| @@ -1674,7 +1674,7 @@ bool MidiScoreReader::isDone( long track, double currTime ) · 8 unmodified lines | |||
| 1674 | // name: applyControl() | 1674 | // name: applyControl() |
| 1675 | // desc: applies control data to an existing event | 1675 | // desc: applies control data to an existing event |
| 1676 | //----------------------------------------------------------------------------- | 1676 | //----------------------------------------------------------------------------- |
| 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 ) |
| 1678 | { | 1678 | { |
| 1679 | // sanity check | 1679 | // sanity check |
| 1680 | if( !e ) return false; | 1680 | if( !e ) return false; |
| @@ -1713,7 +1713,7 @@ bool MidiScoreReader::applyControl( long track, long data2, long data3, MidiNote · 32 unmodified lines | |||
| 1713 | // name: loadTrack() | 1713 | // name: loadTrack() |
| 1714 | // desc: load a track from file | 1714 | // desc: load a track from file |
| 1715 | //----------------------------------------------------------------------------- | 1715 | //----------------------------------------------------------------------------- |
| 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 ) |
| 1717 | { | 1717 | { |
| 1718 | // sanity check | 1718 | // sanity check |
| 1719 | if( !m_midiFile || track >= m_events.size() ) | 1719 | if( !m_midiFile || track >= m_events.size() ) |
| @@ -1748,7 +1748,7 @@ bool MidiScoreReader::loadTrack( long track, std::vector<MidiNoteEvent *> & data · 28 unmodified lines | |||
| 1748 | while( true ) | 1748 | while( true ) |
| 1749 | { | 1749 | { |
| 1750 | // get the next MIDI event | 1750 | // 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 ); |
| 1752 | 1752 | ||
| 1753 | // accumulate time | 1753 | // accumulate time |
| 1754 | secondsAccum += ticks * m_midiFile->getTickSeconds(); | 1754 | secondsAccum += ticks * m_midiFile->getTickSeconds(); |
| @@ -1952,7 +1952,7 @@ void MidiScoreReader::enqueue_front( const MidiNoteEvent * e ) · 197 unmodified lines | |||
| 1952 | // name: getNumEvents() | 1952 | // name: getNumEvents() |
| 1953 | // desc: get number of events on a track | 1953 | // desc: get number of events on a track |
| 1954 | //----------------------------------------------------------------------------- | 1954 | //----------------------------------------------------------------------------- |
| 1955 | long MidiScoreReader::getNumEvents( long track ) const | 1955 | t_CKINT MidiScoreReader::getNumEvents( t_CKINT track ) const |
| 1956 | { | 1956 | { |
| 1957 | // sanity check | 1957 | // sanity check |
| 1958 | if( track < 0 || track >= m_events.size() ) | 1958 | if( track < 0 || track >= m_events.size() ) |
| @@ -1970,7 +1970,7 @@ long MidiScoreReader::getNumEvents( long track ) const · 11 unmodified lines | |||
| 1970 | // desc: get an entire track's note events | 1970 | // desc: get an entire track's note events |
| 1971 | //----------------------------------------------------------------------------- | 1971 | //----------------------------------------------------------------------------- |
| 1972 | static vector<MidiNoteEvent *> s_nullNoteVector; | 1972 | static vector<MidiNoteEvent *> s_nullNoteVector; |
| 1973 | const vector<MidiNoteEvent *> & MidiScoreReader::getNoteEvents( long track ) | 1973 | const vector<MidiNoteEvent *> & MidiScoreReader::getNoteEvents( t_CKINT track ) |
| 1974 | { | 1974 | { |
| 1975 | // sanity check | 1975 | // sanity check |
| 1976 | if( track < 0 || track >= m_events.size() ) | 1976 | if( track < 0 || track >= m_events.size() ) |
| @@ -1987,7 +1987,7 @@ const vector<MidiNoteEvent *> & MidiScoreReader::getNoteEvents( long track ) · 10 unmodified lines | |||
| 1987 | // desc: get an entire track's lyric events | 1987 | // desc: get an entire track's lyric events |
| 1988 | //----------------------------------------------------------------------------- | 1988 | //----------------------------------------------------------------------------- |
| 1989 | static vector<MidiLyricEvent *> s_nullLyricVector; | 1989 | static vector<MidiLyricEvent *> s_nullLyricVector; |
| 1990 | const vector<MidiLyricEvent *> & MidiScoreReader::getLyricEvents( long track ) | 1990 | const vector<MidiLyricEvent *> & MidiScoreReader::getLyricEvents( t_CKINT track ) |
| 1991 | { | 1991 | { |
| 1992 | // sanity check | 1992 | // sanity check |
| 1993 | if( track < 0 || track >= m_lyricEvents.size() ) | 1993 | if( track < 0 || track >= m_lyricEvents.size() ) |
| @@ -2003,12 +2003,12 @@ const vector<MidiLyricEvent *> & MidiScoreReader::getLyricEvents( long track ) · 9 unmodified lines | |||
| 2003 | // name: getCount() | 2003 | // name: getCount() |
| 2004 | // desc: return a count associated with key | 2004 | // desc: return a count associated with key |
| 2005 | //----------------------------------------------------------------------------- | 2005 | //----------------------------------------------------------------------------- |
| 2006 | long MidiScoreReader::getCount( long track, const std::string & key ) | 2006 | t_CKINT MidiScoreReader::getCount( t_CKINT track, const std::string & key ) |
| 2007 | { | 2007 | { |
| 2008 | // sanity check | 2008 | // sanity check |
| 2009 | if( track < 0 || track >= m_events.size() ) return 0; | 2009 | if( track < 0 || track >= m_events.size() ) return 0; |
| 2010 | // find | 2010 | // 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 ); |
| 2012 | // not found | 2012 | // not found |
| 2013 | if( iter == m_countMaps[track].end() ) return 0; | 2013 | if( iter == m_countMaps[track].end() ) return 0; |
| 2014 | // return value | 2014 | // return value |
| @@ -2022,13 +2022,13 @@ long MidiScoreReader::getCount( long track, const std::string & key ) · 7 unmodified lines | |||
| 2022 | // name: incrementCount() | 2022 | // name: incrementCount() |
| 2023 | // desc: increment a count associated with key | 2023 | // desc: increment a count associated with key |
| 2024 | //----------------------------------------------------------------------------- | 2024 | //----------------------------------------------------------------------------- |
| 2025 | void MidiScoreReader::incrementCount( long track, const std::string & key ) | 2025 | void MidiScoreReader::incrementCount( t_CKINT track, const std::string & key ) |
| 2026 | { | 2026 | { |
| 2027 | // sanity check | 2027 | // sanity check |
| 2028 | if( track < 0 || track >= m_events.size() ) return; | 2028 | if( track < 0 || track >= m_events.size() ) return; |
| 2029 | 2029 | ||
| 2030 | // find | 2030 | // 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 ); |
| 2032 | 2032 | ||
| 2033 | if( iter == m_countMaps[track].end() ) | 2033 | if( iter == m_countMaps[track].end() ) |
| 2034 | { | 2034 | { |
| @@ -2049,7 +2049,7 @@ void MidiScoreReader::incrementCount( long track, const std::string & key ) · 14 unmodified lines | |||
| 2049 | // name: handleNoteOn() | 2049 | // name: handleNoteOn() |
| 2050 | // desc: insert a note on into table | 2050 | // desc: insert a note on into table |
| 2051 | //----------------------------------------------------------------------------- | 2051 | //----------------------------------------------------------------------------- |
| 2052 | void MidiScoreReader::handleNoteOn( MidiNoteEvent * e, long note ) | 2052 | void MidiScoreReader::handleNoteOn( MidiNoteEvent * e, t_CKINT note ) |
| 2053 | { | 2053 | { |
| 2054 | // sanity check | 2054 | // sanity check |
| 2055 | if( !e ) | 2055 | if( !e ) |
| @@ -2073,7 +2073,7 @@ void MidiScoreReader::handleNoteOn( MidiNoteEvent * e, long note ) · 17 unmodified lines | |||
| 2073 | // name: handleNoteOff() | 2073 | // name: handleNoteOff() |
| 2074 | // desc: insert a note off into table | 2074 | // desc: insert a note off into table |
| 2075 | //----------------------------------------------------------------------------- | 2075 | //----------------------------------------------------------------------------- |
| 2076 | void MidiScoreReader::handleNoteOff( long note, double time ) | 2076 | void MidiScoreReader::handleNoteOff( t_CKINT note, double time ) |
| 2077 | { | 2077 | { |
| 2078 | // get the piano event | 2078 | // get the piano event |
| 2079 | MidiNoteEvent * e = m_activeNotes[note]; | 2079 | MidiNoteEvent * e = m_activeNotes[note]; |
| @@ -2095,7 +2095,7 @@ void MidiScoreReader::handleNoteOff( long note, double time ) · 15 unmodified lines | |||
| 2095 | // name: setTrackName() | 2095 | // name: setTrackName() |
| 2096 | // desc: sets track name | 2096 | // desc: sets track name |
| 2097 | //----------------------------------------------------------------------------- | 2097 | //----------------------------------------------------------------------------- |
| 2098 | void MidiScoreReader::setTrackName( long track, const std::string & name ) | 2098 | void MidiScoreReader::setTrackName( t_CKINT track, const std::string & name ) |
| 2099 | { | 2099 | { |
| 2100 | // x-map it! | 2100 | // x-map it! |
| 2101 | m_trackToName[track] = name; | 2101 | m_trackToName[track] = name; |
| @@ -2109,9 +2109,9 @@ void MidiScoreReader::setTrackName( long track, const std::string & name ) · 7 unmodified lines | |||
| 2109 | // name: getTrackName() | 2109 | // name: getTrackName() |
| 2110 | // desc: gets track name ("" if not present) | 2110 | // desc: gets track name ("" if not present) |
| 2111 | //----------------------------------------------------------------------------- | 2111 | //----------------------------------------------------------------------------- |
| 2112 | string MidiScoreReader::getTrackName( long track ) | 2112 | string MidiScoreReader::getTrackName( t_CKINT track ) |
| 2113 | { | 2113 | { |
| 2114 | map<long, string>::iterator itr = m_trackToName.find( track ); | 2114 | map<t_CKINT, string>::iterator itr = m_trackToName.find( track ); |
| 2115 | 2115 | ||
| 2116 | if( itr == m_trackToName.end() ) | 2116 | if( itr == m_trackToName.end() ) |
| 2117 | return ""; | 2117 | return ""; |
| @@ -2126,10 +2126,10 @@ string MidiScoreReader::getTrackName( long track ) · 8 unmodified lines | |||
| 2126 | // name: getTrackForName() | 2126 | // name: getTrackForName() |
| 2127 | // desc: gets the track with the given name (-1 if not present) | 2127 | // desc: gets the track with the given name (-1 if not present) |
| 2128 | //----------------------------------------------------------------------------- | 2128 | //----------------------------------------------------------------------------- |
| 2129 | long MidiScoreReader::getTrackForName( const std::string & name ) | 2129 | t_CKINT MidiScoreReader::getTrackForName( const std::string & name ) |
| 2130 | { | 2130 | { |
| 2131 | // look up the track index by name | 2131 | // 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 ); |
| 2133 | 2133 | ||
| 2134 | // didn't find | 2134 | // didn't find |
| 2135 | if( itr == m_nameToTrack.end() ) | 2135 | if( itr == m_nameToTrack.end() ) |
| @@ -399,41 +399,41 @@ public: · 398 unmodified lines | |||
| 399 | // rewind to beginning | 399 | // rewind to beginning |
| 400 | void rewind(); | 400 | void rewind(); |
| 401 | // get current top event (NO simultaneous) | 401 | // 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 ); |
| 403 | // get current event (YES simultaneous) + move to next | 403 | // 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 ); |
| 405 | // advance to next event | 405 | // advance to next event |
| 406 | bool seek( long track, long numToAdvance = 1 ); | 406 | bool seek( t_CKINT track, t_CKINT numToAdvance = 1 ); |
| 407 | // advance to next note on | 407 | // advance to next note on |
| 408 | bool seekToNoteOn( long track ); | 408 | bool seekToNoteOn( t_CKINT track ); |
| 409 | // get notes in a time window | 409 | // 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, |
| 411 | bool includeSimultaneous = false ); | 411 | bool includeSimultaneous = false ); |
| 412 | // isDone | 412 | // isDone |
| 413 | bool isDone( long track, double currTime ); | 413 | bool isDone( t_CKINT track, double currTime ); |
| 414 | 414 | ||
| 415 | 415 | ||
| 416 | public: | 416 | public: |
| 417 | // get number of tracks | 417 | // get number of tracks |
| 418 | long getNumTracks() const; | 418 | t_CKINT getNumTracks() const; |
| 419 | // get number of events per track | 419 | // get number of events per track |
| 420 | long getNumEvents( long track ) const; | 420 | t_CKINT getNumEvents( t_CKINT track ) const; |
| 421 | // get number of tracks with more than 0 events | 421 | // get number of tracks with more than 0 events |
| 422 | long getNumTracksNonZero() const; | 422 | t_CKINT getNumTracksNonZero() const; |
| 423 | // get a vector of tracks indices that have more than 0 events | 423 | // 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; |
| 425 | // get BPM | 425 | // get BPM |
| 426 | double getBPM() const; | 426 | double getBPM() const; |
| 427 | // get an entire track's note events | 427 | // get an entire track's note events |
| 428 | const std::vector<MidiNoteEvent *> & getNoteEvents( long track ); | 428 | const std::vector<MidiNoteEvent *> & getNoteEvents( t_CKINT track ); |
| 429 | // get an entire track's lyric events | 429 | // get an entire track's lyric events |
| 430 | const std::vector<MidiLyricEvent *> & getLyricEvents( long track ); | 430 | const std::vector<MidiLyricEvent *> & getLyricEvents( t_CKINT track ); |
| 431 | // get count | 431 | // get count |
| 432 | long getCount( long track, const std::string & key ); | 432 | t_CKINT getCount( t_CKINT track, const std::string & key ); |
| 433 | // get lowest note for a track | 433 | // get lowest note for a track |
| 434 | long getLowestNote( long track, const MidiNoteEvent *start ); | 434 | t_CKINT getLowestNote( t_CKINT track, const MidiNoteEvent *start ); |
| 435 | // get highest note for a track | 435 | // get highest note for a track |
| 436 | long getHighestNote( long track, const MidiNoteEvent *start ); | 436 | t_CKINT getHighestNote( t_CKINT track, const MidiNoteEvent *start ); |
| 437 | 437 | ||
| 438 | public: // TODO: these may as well be a separate object | 438 | public: // TODO: these may as well be a separate object |
| 439 | // push a event to remember | 439 | // push a event to remember |
| @@ -447,22 +447,22 @@ public: // TODO: these may as well be a separate object · 7 unmodified lines | |||
| 447 | 447 | ||
| 448 | public: // track naming | 448 | public: // track naming |
| 449 | // sets track name | 449 | // sets track name |
| 450 | void setTrackName( long track, const std::string & name ); | 450 | void setTrackName( t_CKINT track, const std::string & name ); |
| 451 | // gets track name ("" if not present) | 451 | // gets track name ("" if not present) |
| 452 | std::string getTrackName( long track ); | 452 | std::string getTrackName( t_CKINT track ); |
| 453 | // gets the track with the given name (-1 if not present) | 453 | // 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 ); |
| 455 | 455 | ||
| 456 | protected: // for use while loading a track | 456 | protected: // for use while loading a track |
| 457 | // load a track | 457 | // 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 ); |
| 459 | // apply control to existing event | 459 | // 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 ); |
| 461 | // increment count for the given key (used for counting the number of notes, glissandi, etc) | 461 | // 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 ); |
| 463 | // handle note events, managing m_activeNotes and setting the event's endTime | 463 | // handle note events, managing m_activeNotes and setting the event's endTime |
| 464 | void handleNoteOn( MidiNoteEvent * e, long note ); | 464 | void handleNoteOn( MidiNoteEvent * e, t_CKINT note ); |
| 465 | void handleNoteOff( long note, double time ); | 465 | void handleNoteOff( t_CKINT note, double time ); |
| 466 | 466 | ||
| 467 | protected: | 467 | protected: |
| 468 | // midi | 468 | // midi |
| @@ -472,28 +472,28 @@ protected: · 3 unmodified lines | |||
| 472 | // vector of tracks of events | 472 | // vector of tracks of events |
| 473 | std::vector< std::vector<MidiLyricEvent *> > m_lyricEvents; | 473 | std::vector< std::vector<MidiLyricEvent *> > m_lyricEvents; |
| 474 | // vector of indices | 474 | // vector of indices |
| 475 | std::vector<unsigned long> m_indices; | 475 | std::vector<t_CKUINT> m_indices; |
| 476 | // stack of events | 476 | // stack of events |
| 477 | std::deque<const MidiNoteEvent *> m_queue; | 477 | std::deque<const MidiNoteEvent *> m_queue; |
| 478 | // vector of event | 478 | // vector of event |
| 479 | std::vector<const MidiNoteEvent *> m_result; | 479 | std::vector<const MidiNoteEvent *> m_result; |
| 480 | // search pointer | 480 | // search pointer |
| 481 | std::vector<unsigned long> m_searchIndices; | 481 | std::vector<t_CKUINT> m_searchIndices; |
| 482 | // count map | 482 | // count map |
| 483 | std::vector< std::map< std::string, long > > m_countMaps; | 483 | std::vector< std::map< std::string, t_CKINT > > m_countMaps; |
| 484 | // HACK: scale the velocity (0-1) | 484 | // HACK: scale the velocity (0-1) |
| 485 | float m_velocity_scale; | 485 | float m_velocity_scale; |
| 486 | // track names | 486 | // track names |
| 487 | std::map<std::string, long> m_nameToTrack; | 487 | std::map<std::string, t_CKINT> m_nameToTrack; |
| 488 | std::map<long, std::string> m_trackToName; | 488 | std::map<t_CKINT, std::string> m_trackToName; |
| 489 | // number of non-zero tracks | 489 | // number of non-zero tracks |
| 490 | long m_numNonZeroTracks; | 490 | t_CKINT m_numNonZeroTracks; |
| 491 | // vector of indices of non-zero tracks | 491 | // vector of indices of non-zero tracks |
| 492 | std::vector<long> m_nonZeroTrackIndices; | 492 | std::vector<t_CKINT> m_nonZeroTrackIndices; |
| 493 | 493 | ||
| 494 | private: // used during track loading | 494 | private: // used during track loading |
| 495 | // active notes, map from MIDI note to event | 495 | // active notes, map from MIDI note to event |
| 496 | std::map<long, MidiNoteEvent *> m_activeNotes; | 496 | std::map<t_CKINT, MidiNoteEvent *> m_activeNotes; |
| 497 | }; | 497 | }; |
| 498 | 498 | ||
| 499 | 499 | ||
| @@ -13511,7 +13511,7 @@ SKINI :: SKINI(char *fileName) · 13510 unmodified lines | |||
| 13511 | char msg[256]; | 13511 | char msg[256]; |
| 13512 | 13512 | ||
| 13513 | myFile = fopen(fileName,"r"); | 13513 | myFile = fopen(fileName,"r"); |
| 13514 | if ((long) myFile < 0) { | 13514 | if ((t_CKUINT)myFile < 0) { |
| 13515 | sprintf(msg, "[chuck](via SKINI): Could not open or find file (%s).", fileName); | 13515 | sprintf(msg, "[chuck](via SKINI): Could not open or find file (%s).", fileName); |
| 13516 | handleError(msg, StkError::FILE_NOT_FOUND); | 13516 | handleError(msg, StkError::FILE_NOT_FOUND); |
| 13517 | } | 13517 | } |
| @@ -19445,7 +19445,7 @@ bool WvOut :: setMatFile( const char *fileName ) · 5927 unmodified lines | |||
| 19445 | memset( hdr.heading, 0, sizeof(hdr.heading) ); | 19445 | memset( hdr.heading, 0, sizeof(hdr.heading) ); |
| 19446 | 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."); | 19446 | 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."); |
| 19447 | 19447 | ||
| 19448 | int i; | 19448 | t_CKINT i; |
| 19449 | for (i=strlen(hdr.heading);i<124;i++) hdr.heading[i] = ' '; | 19449 | for (i=strlen(hdr.heading);i<124;i++) hdr.heading[i] = ' '; |
| 19450 | 19450 | ||
| 19451 | // Header Flag Fields | 19451 | // Header Flag Fields |
| @@ -167,7 +167,7 @@ private: · 166 unmodified lines | |||
| 167 | OscInServer * _this = (OscInServer *) data; | 167 | OscInServer * _this = (OscInServer *) data; |
| 168 | 168 | ||
| 169 | #ifdef WIN32 | 169 | #ifdef WIN32 |
| 170 | return (int) _this->server_cb(); | 170 | return (t_CKINT)_this->server_cb(); |
| 171 | #else | 171 | #else |
| 172 | return _this->server_cb(); | 172 | return _this->server_cb(); |
| 173 | #endif | 173 | #endif |
| @@ -185,7 +185,7 @@ private: · 11 unmodified lines | |||
| 185 | std::string &path, t_CKBOOL &nopath, | 185 | std::string &path, t_CKBOOL &nopath, |
| 186 | std::string &type, t_CKBOOL ¬ype) | 186 | std::string &type, t_CKBOOL ¬ype) |
| 187 | { | 187 | { |
| 188 | int comma_pos = method.find(','); | 188 | t_CKINT comma_pos = method.find(','); |
| 189 | 189 | ||
| 190 | if(comma_pos != method.npos) | 190 | if(comma_pos != method.npos) |
| 191 | { | 191 | { |
| @@ -519,7 +519,7 @@ public: · 327 unmodified lines | |||
| 519 | t_CKBOOL start(const std::string &method) | 519 | t_CKBOOL start(const std::string &method) |
| 520 | { | 520 | { |
| 521 | std::string path; | 521 | std::string path; |
| 522 | int comma_pos = method.find(','); | 522 | t_CKINT comma_pos = method.find(','); |
| 523 | if(comma_pos != method.npos) m_path = method.substr(0, comma_pos); | 523 | if(comma_pos != method.npos) m_path = method.substr(0, comma_pos); |
| 524 | else m_path = method; | 524 | else m_path = method; |
| 525 | 525 | ||
| @@ -888,7 +888,7 @@ CK_DLL_MFUN(oscin_removeAllAddresses) · 362 unmodified lines | |||
| 888 | 888 | ||
| 889 | in->removeAllMethods(); | 889 | in->removeAllMethods(); |
| 890 | 890 | ||
| 891 | error: | 891 | // error: |
| 892 | return; | 892 | return; |
| 893 | } | 893 | } |
| 894 | 894 | ||
| @@ -898,7 +898,7 @@ CK_DLL_MFUN(oscin_listenAll) · 3 unmodified lines | |||
| 898 | 898 | ||
| 899 | in->addMethod(""); | 899 | in->addMethod(""); |
| 900 | 900 | ||
| 901 | error: | 901 | // error: |
| 902 | return; | 902 | return; |
| 903 | } | 903 | } |
| 904 | 904 | ||
| @@ -908,7 +908,7 @@ CK_DLL_MFUN(oscin_msg) · 3 unmodified lines | |||
| 908 | 908 | ||
| 909 | in->removeAllMethods(); | 909 | in->removeAllMethods(); |
| 910 | 910 | ||
| 911 | error: | 911 | // error: |
| 912 | return; | 912 | return; |
| 913 | } | 913 | } |
| 914 | 914 | ||
| @@ -84,9 +84,8 @@ DLL_QUERY regex_query( Chuck_DL_Query * QUERY ) · 83 unmodified lines | |||
| 84 | 84 | ||
| 85 | return TRUE; | 85 | return TRUE; |
| 86 | 86 | ||
| 87 | error: | 87 | //error: |
| 88 | 88 | // return FALSE; | |
| 89 | return FALSE; | ||
| 90 | } | 89 | } |
| 91 | 90 | ||
| 92 | 91 | ||
| @@ -43,8 +43,8 @@ · 42 unmodified lines | |||
| 43 | #include <queue> | 43 | #include <queue> |
| 44 | #include <iostream> | 44 | #include <iostream> |
| 45 | 45 | ||
| 46 | #define DWORD__ unsigned long | 46 | #define DWORD__ t_CKUINT |
| 47 | #define SINT__ long | 47 | #define SINT__ t_CKINT |
| 48 | #define UINT__ DWORD__ | 48 | #define UINT__ DWORD__ |
| 49 | #define BOOL__ DWORD__ | 49 | #define BOOL__ DWORD__ |
| 50 | #define BYTE__ unsigned char | 50 | #define BYTE__ unsigned char |
| @@ -5255,7 +5255,7 @@ int Joystick_count() · 5254 unmodified lines | |||
| 5255 | { | 5255 | { |
| 5256 | if( !joysticks ) | 5256 | if( !joysticks ) |
| 5257 | return 0; | 5257 | return 0; |
| 5258 | return joysticks->size(); | 5258 | return (int)joysticks->size(); |
| 5259 | } | 5259 | } |
| 5260 | 5260 | ||
| 5261 | int Joystick_open( int js ) | 5261 | int Joystick_open( int js ) |
| @@ -5887,7 +5887,7 @@ int Keyboard_count() · 625 unmodified lines | |||
| 5887 | { | 5887 | { |
| 5888 | if( !keyboards ) | 5888 | if( !keyboards ) |
| 5889 | return 0; | 5889 | return 0; |
| 5890 | return keyboards->size(); | 5890 | return (int)keyboards->size(); |
| 5891 | } | 5891 | } |
| 5892 | 5892 | ||
| 5893 | int Keyboard_open( int k ) | 5893 | int Keyboard_open( int k ) |
| @@ -6155,7 +6155,7 @@ int Mouse_count() · 261 unmodified lines | |||
| 6155 | { | 6155 | { |
| 6156 | if( !mice ) | 6156 | if( !mice ) |
| 6157 | return 0; | 6157 | return 0; |
| 6158 | return mice->size(); | 6158 | return (int)mice->size(); |
| 6159 | } | 6159 | } |
| 6160 | 6160 | ||
| 6161 | int Mouse_open( int m ) | 6161 | int Mouse_open( int m ) |
| @@ -40,6 +40,8 @@ · 39 unmodified lines | |||
| 40 | #ifdef __PLATFORM_WIN32__ | 40 | #ifdef __PLATFORM_WIN32__ |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | |||
| 44 | #ifdef __CK_MATH_DEFINE_ROUND_TRUNC__ | ||
| 43 | //----------------------------------------------------------------------------- | 45 | //----------------------------------------------------------------------------- |
| 44 | // name: round() | 46 | // name: round() |
| 45 | // desc: ... | 47 | // desc: ... |
| @@ -59,7 +61,7 @@ double trunc( double a ) · 13 unmodified lines | |||
| 59 | { | 61 | { |
| 60 | return (double)(long)a; | 62 | return (double)(long)a; |
| 61 | } | 63 | } |
| 62 | 64 | #endif // #ifdef __CK_MATH_DEFINE_ROUND_TRUNC | |
| 63 | 65 | ||
| 64 | 66 | ||
| 65 | 67 | ||
| @@ -39,10 +39,13 @@ · 38 unmodified lines | |||
| 39 | extern "C" { | 39 | extern "C" { |
| 40 | #endif | 40 | #endif |
| 41 | 41 | ||
| 42 | // 1.4.1.1 (ge) removed -- seems no longer needed on more modern windows | ||
| 42 | #ifdef __PLATFORM_WIN32__ | 43 | #ifdef __PLATFORM_WIN32__ |
| 44 | #ifdef __CK_MATH_DEFINE_ROUND_TRUNC__ | ||
| 43 | double round( double a ); | 45 | double round( double a ); |
| 44 | double trunc( double a ); | 46 | double trunc( double a ); |
| 45 | #endif | 47 | #endif |
| 48 | #endif | ||
| 46 | 49 | ||
| 47 | // 1.4.1.0 (ge) need this since __WINDOWS_MODERN__ can be defined but remainder still not found (VC++ 2010) | 50 | // 1.4.1.0 (ge) need this since __WINDOWS_MODERN__ can be defined but remainder still not found (VC++ 2010) |
| 48 | double ck_remainder( double a, double b ); | 51 | double ck_remainder( double a, double b ); |
| @@ -70,4 +73,5 @@ unsigned long ensurepow2( unsigned long i ); · 21 unmodified lines | |||
| 70 | 73 | ||
| 71 | 74 | ||
| 72 | 75 | ||
| 76 | |||
| 73 | #endif | 77 | #endif |
| @@ -885,7 +885,7 @@ static int strlen(char *s) { · 884 unmodified lines | |||
| 885 | #define STRING_ALIGN_PAD 4 | 885 | #define STRING_ALIGN_PAD 4 |
| 886 | int OSC_effectiveStringLength(char *string) | 886 | int OSC_effectiveStringLength(char *string) |
| 887 | { | 887 | { |
| 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. */ |
| 889 | 889 | ||
| 890 | /* Round up len to next multiple of STRING_ALIGN_PAD to account for alignment padding */ | 890 | /* Round up len to next multiple of STRING_ALIGN_PAD to account for alignment padding */ |
| 891 | if((len % STRING_ALIGN_PAD) != 0) { | 891 | if((len % STRING_ALIGN_PAD) != 0) { |
| @@ -1168,7 +1168,7 @@ void UDP_Port_Listener::init() · 276 unmodified lines | |||
| 1168 | m_in->init(); | 1168 | m_in->init(); |
| 1169 | } | 1169 | } |
| 1170 | 1170 | ||
| 1171 | int UDP_Port_Listener::nsubs() { return m_subscribers.size(); } | 1171 | int UDP_Port_Listener::nsubs() { return (int)m_subscribers.size(); } |
| 1172 | 1172 | ||
| 1173 | bool UDP_Port_Listener::add( UDP_Subscriber * sub ) | 1173 | bool UDP_Port_Listener::add( UDP_Subscriber * sub ) |
| 1174 | { | 1174 | { |
| @@ -1485,9 +1485,9 @@ OSC_Transmitter::addMessage( char *address, char * args, ...) · 310 unmodified lines | |||
| 1485 | 1485 | ||
| 1486 | OSC_writeAddressAndTypes( &_osc, address, args ); | 1486 | OSC_writeAddressAndTypes( &_osc, address, args ); |
| 1487 | 1487 | ||
| 1488 | int argnum = strlen(args); | 1488 | t_CKINT argnum = strlen(args); |
| 1489 | int osc_err = 0; | 1489 | t_CKINT osc_err = 0; |
| 1490 | for( int j = 1; !osc_err && j < argnum; j++ ) { | 1490 | for(t_CKINT j = 1; !osc_err && j < argnum; j++ ) { |
| 1491 | switch ( args[j] ) { | 1491 | switch ( args[j] ) { |
| 1492 | case 'i': | 1492 | case 'i': |
| 1493 | osc_err = OSC_writeIntArg ( &_osc, va_arg(tags, int) ); | 1493 | osc_err = OSC_writeIntArg ( &_osc, va_arg(tags, int) ); |
| @@ -1513,7 +1513,7 @@ OSC_Transmitter::addMessage( char *address, char * args, ...) · 19 unmodified lines | |||
| 1513 | void | 1513 | void |
| 1514 | OSC_Transmitter::startMessage( char * spec ) { | 1514 | OSC_Transmitter::startMessage( char * spec ) { |
| 1515 | 1515 | ||
| 1516 | int len = strlen( spec ); | 1516 | t_CKINT len = strlen( spec ); |
| 1517 | 1517 | ||
| 1518 | char * comma = strchr( spec, ','); | 1518 | char * comma = strchr( spec, ','); |
| 1519 | char * space = strchr ( spec, ' '); | 1519 | char * space = strchr ( spec, ' '); |
| @@ -1532,7 +1532,7 @@ OSC_Transmitter::startMessage( char * address, char * args ) · 12 unmodified lines | |||
| 1532 | { | 1532 | { |
| 1533 | // OSC_writeAddressAndTypes( &_osc, address, args ); | 1533 | // OSC_writeAddressAndTypes( &_osc, address, args ); |
| 1534 | char addrfix[512]; | 1534 | char addrfix[512]; |
| 1535 | int addrlen = strlen( address ); | 1535 | t_CKINT addrlen = strlen( address ); |
| 1536 | // int mx = strlen(address) + strlen(args) + 1; // either we need to add a comma to args, | 1536 | // int mx = strlen(address) + strlen(args) + 1; // either we need to add a comma to args, |
| 1537 | // or it's got junk in it. | 1537 | // or it's got junk in it. |
| 1538 | // char addrfix[] = new char[mx]; // (char*) malloc( mx * sizeof( char ) ); | 1538 | // char addrfix[] = new char[mx]; // (char*) malloc( mx * sizeof( char ) ); |
| @@ -2230,7 +2230,7 @@ OSC_Address_Space::parseSpec() { · 691 unmodified lines | |||
| 2230 | 2230 | ||
| 2231 | // CK_FPRINTF_STDERR( " parsing spec- address %s :: type %s\n", _address, _type ); | 2231 | // CK_FPRINTF_STDERR( " parsing spec- address %s :: type %s\n", _address, _type ); |
| 2232 | 2232 | ||
| 2233 | int n = strlen ( type ); | 2233 | t_CKINT n = strlen ( type ); |
| 2234 | _noArgs = ( n == 0 ); | 2234 | _noArgs = ( n == 0 ); |
| 2235 | resizeData( ( n < 1 ) ? 1 : n ); | 2235 | resizeData( ( n < 1 ) ? 1 : n ); |
| 2236 | _qread = 0; | 2236 | _qread = 0; |
| @@ -2491,7 +2491,7 @@ OSC_Address_Space::queue_mesg( OSCMesg * m ) · 254 unmodified lines | |||
| 2491 | 2491 | ||
| 2492 | float *fp; | 2492 | float *fp; |
| 2493 | int *ip; | 2493 | int *ip; |
| 2494 | int clen; | 2494 | t_CKINT clen; |
| 2495 | while ( *type != '\0' ) { | 2495 | while ( *type != '\0' ) { |
| 2496 | switch ( *type ) { | 2496 | switch ( *type ) { |
| 2497 | case 'f': | 2497 | case 'f': |
| @@ -4958,7 +4958,8 @@ psf_memset (void *s, int c, sf_count_t len) · 4957 unmodified lines | |||
| 4958 | 4958 | ||
| 4959 | void psf_get_date_str (char *str, int maxlen) | 4959 | void psf_get_date_str (char *str, int maxlen) |
| 4960 | { time_t current ; | 4960 | { 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 | ||
| 4962 | 4963 | ||
| 4963 | time (¤t) ; | 4964 | time (¤t) ; |
| 4964 | 4965 | ||
| @@ -53,7 +53,11 @@ using namespace std; · 52 unmodified lines | |||
| 53 | string itoa( t_CKINT val ) | 53 | string itoa( t_CKINT val ) |
| 54 | { | 54 | { |
| 55 | char buffer[128]; | 55 | 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 | ||
| 57 | return string(buffer); | 61 | return string(buffer); |
| 58 | } | 62 | } |
| 59 | 63 | ||
| @@ -68,7 +72,7 @@ string ftoa( t_CKFLOAT val, t_CKUINT precision ) · 8 unmodified lines | |||
| 68 | char str[32]; | 72 | char str[32]; |
| 69 | char buffer[128]; | 73 | char buffer[128]; |
| 70 | if( precision > 32 ) precision = 32; | 74 | if( precision > 32 ) precision = 32; |
| 71 | sprintf( str, "%%.%lif", precision ); | 75 | sprintf( str, "%%.%lif", (long)precision ); |
| 72 | sprintf( buffer, str, val ); | 76 | sprintf( buffer, str, val ); |
| 73 | return string(buffer); | 77 | return string(buffer); |
| 74 | } | 78 | } |
| @@ -469,7 +473,7 @@ std::string extract_filepath_dir(std::string &filepath) · 394 unmodified lines | |||
| 469 | //#endif | 473 | //#endif |
| 470 | 474 | ||
| 471 | // if the last character is a slash, skip it | 475 | // if the last character is a slash, skip it |
| 472 | int i = filepath.rfind(path_separator); | 476 | t_CKINT i = filepath.rfind(path_separator); |
| 473 | 477 | ||
| 474 | if(i == std::string::npos) | 478 | if(i == std::string::npos) |
| 475 | return std::string(); | 479 | return std::string(); |
| @@ -556,7 +560,7 @@ std::string normalize_directory_separator(const std::string &filepath) · 80 unmodified lines | |||
| 556 | { | 560 | { |
| 557 | #ifdef __PLATFORM_WIN32__ | 561 | #ifdef __PLATFORM_WIN32__ |
| 558 | std::string new_filepath = filepath; | 562 | std::string new_filepath = filepath; |
| 559 | int len = new_filepath.size(); | 563 | t_CKINT len = new_filepath.size(); |
| 560 | for(int i = 0; i < len; i++) | 564 | for(int i = 0; i < len; i++) |
| 561 | { | 565 | { |
| 562 | if(new_filepath[i] == '\\') new_filepath[i] = '/'; | 566 | if(new_filepath[i] == '\\') new_filepath[i] = '/'; |
| @@ -738,7 +738,7 @@ bool go( int argc, const char ** argv ) · 737 unmodified lines | |||
| 738 | // boost log level | 738 | // boost log level |
| 739 | g_otf_log = CK_LOG_CORE; | 739 | g_otf_log = CK_LOG_CORE; |
| 740 | // flag | 740 | // flag |
| 741 | int is_otf = FALSE; | 741 | t_CKINT is_otf = FALSE; |
| 742 | // log level | 742 | // log level |
| 743 | EM_setlog( log_level ); | 743 | EM_setlog( log_level ); |
| 744 | 744 | ||