History

undo test commenting out code with preprocessor directives

Jack Atherton committed 7 years ago

Commit b91dd1e1 parent db1a1dd26 files · +7454 −7195Browse files

Showing the changes to src/core/chuck_vm.cpp (1 of 26 files). Show all

Unified · Split

src/core/chuck_vm.cpp+59−42
@@ -34,10 +34,18 @@ · 33 unmodified lines
3434 #include "chuck_lang.h"
3535 #include "chuck_type.h"
3636 #include "chuck_dl.h"
37−//#include "chuck_io.h"
37+
38+#ifndef __DISABLE_SERIAL__
39+#include "chuck_io.h"
40+#endif
41+
3842 #include "chuck_errmsg.h"
3943 #include "ugen_xxx.h"
40−//#include "hidio_sdl.h" // 1.4.0.0
44+
45+#ifndef __DISABLE_HID__
46+#include "hidio_sdl.h" // 1.4.0.0
47+#endif
48+
4149 #ifndef __DISABLE_MIDI__
4250 #include "midiio_rtmidi.h" // 1.4.0.1
4351 #endif
@@ -341,14 +349,17 @@ t_CKBOOL Chuck_VM::shutdown() · 297 unmodified lines
341349 // free the shreduler
342350 SAFE_DELETE( m_shreduler );
343351
352+ #ifndef __DISABLE_HID__
344353 // log
345354 EM_log( CK_LOG_SYSTEM, "unregistering VM from HID manager..." );
346355 // clean up this vm
347−// HidInManager::cleanup_buffer( this );
356+ HidInManager::cleanup_buffer( this );
357+ #endif
358+
359+ #ifndef __DISABLE_MIDI__
348360 EM_log( CK_LOG_SYSTEM, "unregistering VM from MIDI manager..." );
349−#ifndef __DISABLE_MIDI__
350361 MidiInManager::cleanup_buffer( this );
351−#endif
362+ #endif
352363
353364 // log
354365 EM_log( CK_LOG_SYSTEM, "freeing msg/reply/event buffers..." );
@@ -3559,7 +3570,9 @@ Chuck_VM_Shred::Chuck_VM_Shred() · 3204 unmodified lines
35593570 vm_ref = NULL;
35603571 event = NULL;
35613572 xid = 0;
3562−// m_serials = NULL;
3573+ #ifndef __DISABLE_SERIAL__
3574+ m_serials = NULL;
3575+ #endif
35633576
35643577 // set
35653578 CK_TRACK( stat = NULL );
@@ -3692,18 +3705,20 @@ t_CKBOOL Chuck_VM_Shred::shutdown() · 126 unmodified lines
36923705 // clear it
36933706 code_orig = code = NULL;
36943707
3708+ #ifndef __DISABLE_SERIAL__
36953709 // HACK (added 1.3.2.0): close serial devices
3696−// if(m_serials != NULL)
3697−// {
3698−// for(list<Chuck_IO_Serial *>::iterator i = m_serials->begin(); i != m_serials->end(); i++)
3699−// {
3700−// (*i)->release();
3701−// (*i)->close();
3702−// }
3703−//
3704−// m_serials->clear();
3705−// SAFE_DELETE(m_serials);
3706−// }
3710+ if(m_serials != NULL)
3711+ {
3712+ for(list<Chuck_IO_Serial *>::iterator i = m_serials->begin(); i != m_serials->end(); i++)
3713+ {
3714+ (*i)->release();
3715+ (*i)->close();
3716+ }
3717+
3718+ m_serials->clear();
3719+ SAFE_DELETE(m_serials);
3720+ }
3721+ #endif
37073722
37083723 // 1.3.5.3 pop all loop counters
37093724 while( this->popLoopCounter() );
@@ -3835,31 +3850,33 @@ CK_VM_DEBUG(CK_FPRINTF_STDERR( "CK_VM_DEBUG reg sp in: 0x%08lx out: 0x%08lx\n", · 125 unmodified lines
38353850
38363851
38373852
3838−////-----------------------------------------------------------------------------
3839−//// name: add_serialio()
3840−//// desc: ...
3841−////-----------------------------------------------------------------------------
3842−//t_CKVOID Chuck_VM_Shred::add_serialio( Chuck_IO_Serial * serial )
3843−//{
3844−// if(m_serials == NULL)
3845−// m_serials = new list<Chuck_IO_Serial *>;
3846−// serial->add_ref();
3847−// m_serials->push_back( serial );
3848−//}
3849−//
3850−//
3851−//
3852−////-----------------------------------------------------------------------------
3853−//// name: add_serialio()
3854−//// desc: ...
3855−////-----------------------------------------------------------------------------
3856−//t_CKVOID Chuck_VM_Shred::remove_serialio( Chuck_IO_Serial * serial )
3857−//{
3858−// if(m_serials == NULL)
3859−// return;
3860−// m_serials->remove( serial );
3861−// serial->release();
3862−//}
3853+#ifndef __DISABLE_SERIAL__
3854+//-----------------------------------------------------------------------------
3855+// name: add_serialio()
3856+// desc: ...
3857+//-----------------------------------------------------------------------------
3858+t_CKVOID Chuck_VM_Shred::add_serialio( Chuck_IO_Serial * serial )
3859+{
3860+ if(m_serials == NULL)
3861+ m_serials = new list<Chuck_IO_Serial *>;
3862+ serial->add_ref();
3863+ m_serials->push_back( serial );
3864+}
3865+
3866+
3867+
3868+//-----------------------------------------------------------------------------
3869+// name: add_serialio()
3870+// desc: ...
3871+//-----------------------------------------------------------------------------
3872+t_CKVOID Chuck_VM_Shred::remove_serialio( Chuck_IO_Serial * serial )
3873+{
3874+ if(m_serials == NULL)
3875+ return;
3876+ m_serials->remove( serial );
3877+ serial->release();
3878+}
3879+#endif
38633880
38643881
38653882

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