Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11294
Modified Files: Tag: devel_0_39 s_inter.c Log Message: upgrading to 0.39-test2
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.5.4.10 retrieving revision 1.5.4.10.2.1 diff -C2 -d -r1.5.4.10 -r1.5.4.10.2.1 *** s_inter.c 14 May 2005 17:05:27 -0000 1.5.4.10 --- s_inter.c 22 May 2005 13:00:13 -0000 1.5.4.10.2.1 *************** *** 51,55 **** #define DEBUG_MESSDOWN 2 /* messages down from pd-gui to pd */
- /* T.Grill - make it a _little_ more adaptable... */ #ifndef PDBINDIR #define PDBINDIR "bin/" --- 51,54 ---- *************** *** 158,183 **** int i; t_fdpoll *fp; ! fd_set readset, writeset, exceptset;
timout.tv_sec = 0; timout.tv_usec = 0;
! FD_ZERO(&writeset); ! FD_ZERO(&readset); ! FD_ZERO(&exceptset); ! for (fp = sys_fdpoll, i = sys_nfdpoll; i--; fp++) ! FD_SET(fp->fdp_fd, &readset); ! select(sys_maxfd+1, &readset, &writeset, &exceptset, &timout); ! for (i = 0; i < sys_nfdpoll; i++) ! if (FD_ISSET(sys_fdpoll[i].fdp_fd, &readset)) { (*sys_fdpoll[i].fdp_fn)(sys_fdpoll[i].fdp_ptr, sys_fdpoll[i].fdp_fd); didsomething = 1; } ! return (didsomething); ! }
void sys_microsleep(int microsec) ! { /* tb: sleep granularity on "modern" operating systems is only 1ms??? --- 157,182 ---- int i; t_fdpoll *fp; ! fd_set readset, writeset, exceptset;
timout.tv_sec = 0; timout.tv_usec = 0;
! FD_ZERO(&writeset); ! FD_ZERO(&readset); ! FD_ZERO(&exceptset); ! for (fp = sys_fdpoll, i = sys_nfdpoll; i--; fp++) ! FD_SET(fp->fdp_fd, &readset); ! select(sys_maxfd+1, &readset, &writeset, &exceptset, &timout); ! for (i = 0; i < sys_nfdpoll; i++) ! if (FD_ISSET(sys_fdpoll[i].fdp_fd, &readset)) { (*sys_fdpoll[i].fdp_fn)(sys_fdpoll[i].fdp_ptr, sys_fdpoll[i].fdp_fd); didsomething = 1; } ! return (didsomething); ! }
void sys_microsleep(int microsec) ! { /* tb: sleep granularity on "modern" operating systems is only 1ms??? *************** *** 200,206 **** nanosleep(&rec, &rem); #else ! Sleep(microsec/1000); #endif ! /* a solution for lower timeslices might be a busysleep but this might block a low-prority thread and won't work for win9x --- 199,205 ---- nanosleep(&rec, &rem); #else ! Sleep(microsec/1000); #endif ! /* a solution for lower timeslices might be a busysleep but this might block a low-prority thread and won't work for win9x *************** *** 211,215 **** double end = sys_getrealtime() + (double)microsec * 1e-6; do ! { #ifdef MSW SwitchToThread(); --- 210,214 ---- double end = sys_getrealtime() + (double)microsec * 1e-6; do ! { #ifdef MSW SwitchToThread(); *************** *** 321,325 **** /* } tb */
! if (mlockall(MCL_FUTURE) != -1) fprintf(stderr, "memory locking enabled.\n"); #endif --- 320,324 ---- /* } tb */
! if (mlockall(MCL_FUTURE) != -1) fprintf(stderr, "memory locking enabled.\n"); #endif *************** *** 624,628 **** int bytestowrite = sys_guibuftail - sys_guibufhead; int written = 0; ! while (1) { int res = send(sys_guisock, --- 623,627 ---- int bytestowrite = sys_guibuftail - sys_guibufhead; int written = 0; ! while (1) { int res = send(sys_guisock, *************** *** 640,644 **** } } ! sys_guibufhead = sys_guibuftail = 0; } else --- 639,643 ---- } } ! sys_guibufhead = sys_guibuftail = 0; } else *************** *** 687,694 **** sys_guibufsize - sys_guibufhead, fmt, ap); va_end(ap); ! if (msglen2 != msglen) ! bug("sys_vgui"); ! if (msglen >= sys_guibufsize - sys_guibufhead) ! msglen = sys_guibufsize - sys_guibufhead; } if (sys_debuglevel & DEBUG_MESSUP) --- 686,693 ---- sys_guibufsize - sys_guibufhead, fmt, ap); va_end(ap); ! if (msglen2 != msglen) ! bug("sys_vgui"); ! if (msglen >= sys_guibufsize - sys_guibufhead) ! msglen = sys_guibufsize - sys_guibufhead; } if (sys_debuglevel & DEBUG_MESSUP) *************** *** 837,841 **** { gq->gq_next = gq2->gq_next; ! t_freebytes(gq2, sizeof(*gq)); break; } --- 836,840 ---- { gq->gq_next = gq2->gq_next; ! t_freebytes(gq2, sizeof(*gq2)); break; } *************** *** 1221,1228 **** fprintf(stderr, "Waiting for connection request... \n"); if (listen(xsock, 5) < 0) sys_sockerror("listen"); -
sys_guisock = accept(xsock, (struct sockaddr *) &server, ! (socklen_t *)&len); #ifdef OOPS close(xsock); --- 1220,1226 ---- fprintf(stderr, "Waiting for connection request... \n"); if (listen(xsock, 5) < 0) sys_sockerror("listen");
sys_guisock = accept(xsock, (struct sockaddr *) &server, ! (socklen_t *)&len); #ifdef OOPS close(xsock); *************** *** 1246,1250 **** sys_get_audio_apis(buf); sys_vgui("pdtk_pd_startup {%s} %s {%s}\n", pd_version, buf, ! sys_font); } return (0); --- 1244,1248 ---- sys_get_audio_apis(buf); sys_vgui("pdtk_pd_startup {%s} %s {%s}\n", pd_version, buf, ! sys_font); } return (0); *************** *** 1252,1257 **** }
- - /* T.Grill - import clean quit function */ extern void sys_exit(void);
--- 1250,1253 ----