Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15139/src
Modified Files: Tag: devel_0_39 SConscript d_filter.c d_soundfile.c m_pd.h m_sched.c s_audio_asio.cpp s_inter.c s_main.c Log Message: - osx 10.4 fixes - preprocessor macros (DEBUG, NDEBUG) - removed old-style idle hook (since we have the lockfree idle callbacks - fixed bug in clock_unset - fixed biquad_perf8 stability problem - some scons stuff
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.4.4.11.2.2 retrieving revision 1.4.4.11.2.3 diff -C2 -d -r1.4.4.11.2.2 -r1.4.4.11.2.3 *** m_pd.h 12 Jul 2005 15:11:10 -0000 1.4.4.11.2.2 --- m_pd.h 13 Jul 2005 22:49:39 -0000 1.4.4.11.2.3 *************** *** 472,476 **** EXTERN int sched_geteventno(void); EXTERN double sys_getrealtime(void); - EXTERN int (*sys_idlehook)(void); /* hook to add idle time computation */
--- 472,475 ----
Index: s_audio_asio.cpp =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/s_audio_asio.cpp,v retrieving revision 1.1.4.26.2.2 retrieving revision 1.1.4.26.2.3 diff -C2 -d -r1.1.4.26.2.2 -r1.1.4.26.2.3 *** s_audio_asio.cpp 12 Jul 2005 15:11:10 -0000 1.1.4.26.2.2 --- s_audio_asio.cpp 13 Jul 2005 22:49:39 -0000 1.1.4.26.2.3 *************** *** 51,58 **** #define DRIVERWAIT 1
- #ifdef PD_DEBUG - #define ASIODEBUG - #endif - #define ASIODEBUG
--- 51,54 ----
Index: d_filter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_filter.c,v retrieving revision 1.3.4.3.2.1 retrieving revision 1.3.4.3.2.2 diff -C2 -d -r1.3.4.3.2.1 -r1.3.4.3.2.2 *** d_filter.c 12 Jul 2005 15:11:06 -0000 1.3.4.3.2.1 --- d_filter.c 13 Jul 2005 22:49:39 -0000 1.3.4.3.2.2 *************** *** 418,425 **** { float output = *in++ + fb1 * last + fb2 * prev; ! #ifdef __i386__ ! output += 1e-10; /* quantizing should be faster than PD_BIGORSMALL */ ! output -= 1e-10; /* only doing this every 8th sample should be ok */ ! #endif *out++ = ff1 * output + ff2 * last + ff3 * prev; prev = last; --- 418,423 ---- { float output = *in++ + fb1 * last + fb2 * prev; ! if (PD_BIGORSMALL(output)) ! output = 0; *out++ = ff1 * output + ff2 * last + ff3 * prev; prev = last; *************** *** 427,430 **** --- 425,430 ----
output = *in++ + fb1 * last + fb2 * prev; + if (PD_BIGORSMALL(output)) + output = 0; *out++ = ff1 * output + ff2 * last + ff3 * prev; prev = last;
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.7.4.17.2.2 retrieving revision 1.7.4.17.2.3 diff -C2 -d -r1.7.4.17.2.2 -r1.7.4.17.2.3 *** s_main.c 12 Jul 2005 15:11:11 -0000 1.7.4.17.2.2 --- s_main.c 13 Jul 2005 22:49:39 -0000 1.7.4.17.2.3 *************** *** 276,280 **** sys_extraflags = 0; /* } jsarlo */ ! #ifdef PD_DEBUG fprintf(stderr, "Pd: COMPILED FOR DEBUGGING\n"); #endif --- 276,280 ---- sys_extraflags = 0; /* } jsarlo */ ! #ifdef DEBUG fprintf(stderr, "Pd: COMPILED FOR DEBUGGING\n"); #endif
Index: m_sched.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v retrieving revision 1.5.4.35.2.2 retrieving revision 1.5.4.35.2.3 diff -C2 -d -r1.5.4.35.2.2 -r1.5.4.35.2.3 *** m_sched.c 12 Jul 2005 22:05:24 -0000 1.5.4.35.2.2 --- m_sched.c 13 Jul 2005 22:49:39 -0000 1.5.4.35.2.3 *************** *** 118,130 **** else { ! t_clock * before = 0; ! do { - before = x2; x2 = x2->c_next; ! assert(x2); } ! while (x2->c_next != x); ! before->c_next = x->c_next; } } --- 118,127 ---- else { ! while (x2->c_next != x) { x2 = x2->c_next; ! assert(x2->c_next); } ! x2->c_next = x->c_next; } } *************** *** 489,497 **** void sys_initmidiqueue( void);
- /* sys_idlehook is a hook the user can fill in to grab idle time. Return - nonzero if you actually used the time; otherwise we're really really idle and - will now sleep. */ - int (*sys_idlehook)(void); - int m_scheduler(void) { --- 486,489 ----
Index: d_soundfile.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v retrieving revision 1.4.4.11.2.1 retrieving revision 1.4.4.11.2.2 diff -C2 -d -r1.4.4.11.2.1 -r1.4.4.11.2.2 *** d_soundfile.c 12 Jul 2005 15:11:06 -0000 1.4.4.11.2.1 --- d_soundfile.c 13 Jul 2005 22:49:39 -0000 1.4.4.11.2.2 *************** *** 905,909 **** #ifdef THREADED_SF #include <sched.h> ! #ifdef _POSIX_MEMLOCK #include <sys/mman.h> #endif /* _POSIX_MEMLOCK */ --- 905,909 ---- #ifdef THREADED_SF #include <sched.h> ! #if (_POSIX_MEMLOCK - 0) >= 200112L #include <sys/mman.h> #endif /* _POSIX_MEMLOCK */ *************** *** 1076,1080 **** pthread_attr_init(&sf_attr);
- #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING sf_param.sched_priority=sched_get_priority_min(SCHED_OTHER); pthread_attr_setschedparam(&sf_attr,&sf_param); --- 1076,1079 ---- *************** *** 1094,1099 **** #endif /* UNIX */
- #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ - //start thread status = pthread_create(&sf_thread_id, &sf_attr, --- 1093,1096 ---- *************** *** 1297,1301 **** #endif ! #ifdef _POSIX_MEMLOCK munlockall(); #endif --- 1294,1298 ---- #endif ! #if (_POSIX_MEMLOCK - 0) >= 200112L munlockall(); #endif *************** *** 1416,1420 **** if (fd >= 0) close (fd); ! #ifdef _POSIX_MEMLOCK mlockall(MCL_FUTURE); #endif --- 1413,1417 ---- if (fd >= 0) close (fd); ! #if (_POSIX_MEMLOCK - 0) >= 200112L mlockall(MCL_FUTURE); #endif *************** *** 1666,1670 **** elemsize = template_findbyname(x->x_array.a_templatesym)->t_n * sizeof(t_word);
! #ifdef _POSIX_MEMLOCK munlockall(); #endif --- 1663,1667 ---- elemsize = template_findbyname(x->x_array.a_templatesym)->t_n * sizeof(t_word);
! #if (_POSIX_MEMLOCK - 0) >= 200112L munlockall(); #endif *************** *** 1685,1689 **** { pd_error(x, "array resize failed: out of memory"); ! #ifdef _POSIX_MEMLOCK mlockall(MCL_FUTURE); #endif --- 1682,1686 ---- { pd_error(x, "array resize failed: out of memory"); ! #if (_POSIX_MEMLOCK - 0) >= 200112L mlockall(MCL_FUTURE); #endif *************** *** 1715,1719 ****
freealignedbytes (vec, was * elemsize); ! #ifdef _POSIX_MEMLOCK mlockall(MCL_FUTURE); #endif --- 1712,1716 ----
freealignedbytes (vec, was * elemsize); ! #if (_POSIX_MEMLOCK - 0) >= 200112L mlockall(MCL_FUTURE); #endif *************** *** 1778,1782 ****
/* allocating memory */ ! #ifdef _POSIX_MEMLOCK munlockall(); #endif --- 1775,1779 ----
/* allocating memory */ ! #if (_POSIX_MEMLOCK - 0) >= 200112L munlockall(); #endif *************** *** 1786,1790 **** { pd_error(x, "array resize failed: out of memory"); ! #ifdef _POSIX_MEMLOCK mlockall(MCL_FUTURE); #endif --- 1783,1787 ---- { pd_error(x, "array resize failed: out of memory"); ! #if (_POSIX_MEMLOCK - 0) >= 200112L mlockall(MCL_FUTURE); #endif *************** *** 1819,1823 ****
freealignedbytes (vec, size * elemsize); ! #ifdef _POSIX_MEMLOCK mlockall(MCL_FUTURE); #endif --- 1816,1820 ----
freealignedbytes (vec, size * elemsize); ! #if (_POSIX_MEMLOCK - 0) >= 200112L mlockall(MCL_FUTURE); #endif
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.5.4.10.2.2 retrieving revision 1.5.4.10.2.3 diff -C2 -d -r1.5.4.10.2.2 -r1.5.4.10.2.3 *** s_inter.c 12 Jul 2005 15:11:11 -0000 1.5.4.10.2.2 --- s_inter.c 13 Jul 2005 22:49:39 -0000 1.5.4.10.2.3 *************** *** 289,297 **** #if defined(__linux) || defined(__APPLE__)
! #if defined(_POSIX_PRIORITY_SCHEDULING) || defined(_POSIX_MEMLOCK) #include <sched.h> #endif
! #ifdef _POSIX_MEMLOCK #include <sys/resource.h> #endif --- 289,297 ---- #if defined(__linux) || defined(__APPLE__)
! #if (_POSIX_PRIORITY_SCHEDULING - 0) >= 200112L || (_POSIX_MEMLOCK - 0) >= 200112L #include <sched.h> #endif
! #if (_POSIX_MEMLOCK - 0) >= 200112L #include <sys/resource.h> #endif *************** *** 299,303 **** void sys_set_priority(int higher) { ! #ifdef _POSIX_PRIORITY_SCHEDULING struct sched_param par; int p1 ,p2, p3; --- 299,303 ---- void sys_set_priority(int higher) { ! #if (_POSIX_PRIORITY_SCHEDULING - 0) >= 200112L struct sched_param par; int p1 ,p2, p3; *************** *** 314,318 **** #endif
! #ifdef _POSIX_MEMLOCK /* tb: force memlock to physical memory { */ struct rlimit mlock_limit; --- 314,318 ---- #endif
! #if (_POSIX_MEMLOCK - 0) >= 200112L /* tb: force memlock to physical memory { */ struct rlimit mlock_limit; *************** *** 336,340 **** #ifdef IRIX /* hack by olaf.matthes@gmx.de at 2003/09/21 */
! #if defined(_POSIX_PRIORITY_SCHEDULING) || defined(_POSIX_MEMLOCK) #include <sched.h> #endif --- 336,340 ---- #ifdef IRIX /* hack by olaf.matthes@gmx.de at 2003/09/21 */
! #if (_POSIX_PRIORITY_SCHEDULING - 0) >= 200112L || (_POSIX_MEMLOCK - 0) >= 200112L #include <sched.h> #endif *************** *** 342,346 **** void sys_set_priority(int higher) { ! #ifdef _POSIX_PRIORITY_SCHEDULING struct sched_param par; /* Bearing the table found in 'man realtime' in mind, I found it a */ --- 342,346 ---- void sys_set_priority(int higher) { ! #if (_POSIX_PRIORITY_SCHEDULING - 0) >= 200112L struct sched_param par; /* Bearing the table found in 'man realtime' in mind, I found it a */ *************** *** 355,359 **** #endif
! #ifdef _POSIX_MEMLOCK if (mlockall(MCL_FUTURE) != -1) fprintf(stderr, "memory locking enabled.\n"); --- 355,359 ---- #endif
! #if (_POSIX_MEMLOCK - 0) >= 200112L if (mlockall(MCL_FUTURE) != -1) fprintf(stderr, "memory locking enabled.\n");
Index: SConscript =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/SConscript,v retrieving revision 1.1.4.9 retrieving revision 1.1.4.10 diff -C2 -d -r1.1.4.9 -r1.1.4.10 *** SConscript 12 Jul 2005 21:54:33 -0000 1.1.4.9 --- SConscript 13 Jul 2005 22:49:39 -0000 1.1.4.10 *************** *** 271,286 **** oss_sources = Split("s_audio_oss.c")
! pa_linux_sources = Split(""" ! ../portaudio/pa_linux_alsa/pa_linux_alsa.c ! ../portaudio/pa_unix/pa_unix_util.c ../portaudio/pa_unix/pa_unix_hostapis.c ../portaudio/pa_unix_oss/pa_unix_oss.c""")
! linux_defs = Split("UNISTD UNIX USEAPI_OSS PA_LITTLE_ENDIAN PA_USE_ALSA PA_USE_OSS") linux_defs.append('INSTALL_PREFIX=\"%s\"' % pdenv['prefix'])
linux_libs = []
! midi_sources = Split("s_midi_alsa.c s_midi_oss.c") linux_sources = pa_sources + pa_common_sources + pa_linux_sources + oss_sources + midi_sources --- 271,284 ---- oss_sources = Split("s_audio_oss.c")
! pa_linux_sources = Split("""../portaudio/pa_unix/pa_unix_util.c ../portaudio/pa_unix/pa_unix_hostapis.c ../portaudio/pa_unix_oss/pa_unix_oss.c""")
! linux_defs = Split("UNISTD UNIX USEAPI_OSS PA_LITTLE_ENDIAN PA_USE_OSS") linux_defs.append('INSTALL_PREFIX=\"%s\"' % pdenv['prefix'])
linux_libs = []
! midi_sources = Split("s_midi_oss.c") linux_sources = pa_sources + pa_common_sources + pa_linux_sources + oss_sources + midi_sources *************** *** 288,296 **** if not pdenv['nosimd']: linux_sources.append(simd_sse_gcc_sources) ! if alsa: linux_sources.append(alsa_sources) ! linux_defs.append("USEAPI_ALSA") linux_libs.append('asound') if jack: --- 286,296 ---- if not pdenv['nosimd']: linux_sources.append(simd_sse_gcc_sources) ! if alsa: linux_sources.append(alsa_sources) ! pa_linux_sources.append('../portaudio/pa_linux_alsa/pa_linux_alsa.c') ! linux_defs.append("USEAPI_ALSA PA_USE_ALSA") linux_libs.append('asound') + linux_sources.append(['s_midi_alsa.c']) if jack: *************** *** 358,361 **** --- 358,362 ----
if pdenv['debug']: + pdenv.Append(CPPDEFINES=Split("DEBUG")) if ['msvc'] in pdenv['TOOLS']: pass # how to switch on debugging on msvc? *************** *** 363,370 **** flags += " -g" else: if ['msvc'] in pdenv['TOOLS']: pass # how to switch on optimizing on msvc? else: ! flags += " -O3 -fprefetch-loop-arrays"
if pdenv.Dictionary().has_key('optimize'): --- 364,372 ---- flags += " -g" else: + pdenv.Append(CPPDEFINES=Split("NDEBUG")) if ['msvc'] in pdenv['TOOLS']: pass # how to switch on optimizing on msvc? else: ! flags += " -O3"
if pdenv.Dictionary().has_key('optimize'): *************** *** 380,384 **** if not pdenv['nosimd']: if pdenv['PLATFORM'] != 'darwin': ! flags += " -mfpmath=sse -mmmx -msse -msse2" else: flags += " -faltivec -maltivec" --- 382,386 ---- if not pdenv['nosimd']: if pdenv['PLATFORM'] != 'darwin': ! flags += " -mfpmath=sse -mmmx -msse -msse2 -fprefetch-loop-arrays" else: flags += " -faltivec -maltivec" *************** *** 397,401 **** pdsend = pdenv.Program('../bin/pdsend', "u_pdsend.c") pdreceive = pdenv.Program('../bin/pdreceive', "u_pdreceive.c") !
###################################################################### --- 399,403 ---- pdsend = pdenv.Program('../bin/pdsend', "u_pdsend.c") pdreceive = pdenv.Program('../bin/pdreceive', "u_pdreceive.c") ! pdtk = pdenv.InstallAs('../bin/pd.tk', 'src/u_main.tk')
###################################################################### *************** *** 425,429 **** Default(pdwatchdog, pdsend, pdreceive, pdgui, pd)
!
Return("pdwatchdog pdsend pdreceive pdgui pd pdlib") --- 427,431 ---- Default(pdwatchdog, pdsend, pdreceive, pdgui, pd)
! Export("pdenv")
Return("pdwatchdog pdsend pdreceive pdgui pd pdlib")