Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20292
Modified Files: Tag: devel_0_39 s_file.c s_inter.c s_path.c Log Message: C++ support
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.5.4.10.2.9 retrieving revision 1.5.4.10.2.10 diff -C2 -d -r1.5.4.10.2.9 -r1.5.4.10.2.10 *** s_inter.c 8 Oct 2005 07:56:54 -0000 1.5.4.10.2.9 --- s_inter.c 28 Oct 2005 12:11:30 -0000 1.5.4.10.2.10 *************** *** 430,434 **** x->sr_socketreceivefn = socketreceivefn; x->sr_udp = udp; ! if (!(x->sr_inbuf = malloc(INBUFSIZE))) bug("t_socketreceiver");; return (x); } --- 430,434 ---- x->sr_socketreceivefn = socketreceivefn; x->sr_udp = udp; ! if (!(x->sr_inbuf = (char *)malloc(INBUFSIZE))) bug("t_socketreceiver");; return (x); } *************** *** 610,614 **** static void sys_trytogetmoreguibuf(int newsize) { ! char *newbuf = realloc(sys_guibuf, newsize); #if 0 static int sizewas; --- 610,614 ---- static void sys_trytogetmoreguibuf(int newsize) { ! char *newbuf = (char *)realloc(sys_guibuf, newsize); #if 0 static int sizewas; *************** *** 667,671 **** if (!sys_guibuf) { ! if (!(sys_guibuf = malloc(GUI_ALLOCCHUNK))) { fprintf(stderr, "Pd: couldn't allocate GUI buffer\n"); --- 667,671 ---- if (!sys_guibuf) { ! if (!(sys_guibuf = (char *)malloc(GUI_ALLOCCHUNK))) { fprintf(stderr, "Pd: couldn't allocate GUI buffer\n"); *************** *** 773,777 **** t_guiqueue *headwas = sys_guiqueuehead; sys_guiqueuehead = headwas->gq_next; ! (*headwas->gq_fn)(headwas->gq_client, headwas->gq_glist); t_freebytes(headwas, sizeof(*headwas)); if (sys_bytessincelastping >= wherestop) --- 773,777 ---- t_guiqueue *headwas = sys_guiqueuehead; sys_guiqueuehead = headwas->gq_next; ! (*headwas->gq_fn)((t_gobj *)headwas->gq_client, headwas->gq_glist); t_freebytes(headwas, sizeof(*headwas)); if (sys_bytessincelastping >= wherestop) *************** *** 823,827 **** gqnextptr = &gq->gq_next; } ! gq = t_getbytes(sizeof(*gq)); gq->gq_next = 0; gq->gq_client = client; --- 823,827 ---- gqnextptr = &gq->gq_next; } ! gq = (t_guiqueue *)t_getbytes(sizeof(*gq)); gq->gq_next = 0; gq->gq_client = client; *************** *** 952,956 **** if (sys_nogui) { ! sys_callback((void*)fake_initfromgui,0,0); } else if (sys_guisetportnumber) /* GUI exists and sent us a port number */ --- 952,956 ---- if (sys_nogui) { ! sys_callback((t_int(*)(t_int*))fake_initfromgui,0,0); } else if (sys_guisetportnumber) /* GUI exists and sent us a port number */ *************** *** 989,992 **** --- 989,998 ---- else /* default behavior: start up the GUI ourselves. */ { + #ifdef DESIRE + fprintf(stderr, + "PureData in DesireData mode does not currently support starting without\n" + "a -guiport option. Please start using the command 'wish desire.tk' instead.\n"); + exit(1); + #else #ifdef MSW char scriptbuf[MAXPDSTRING+30], wishbuf[MAXPDSTRING+30], portbuf[80]; *************** *** 1178,1181 **** --- 1184,1188 ---- ; #endif /* MSW */ + #endif /* DESIRE */ }
*************** *** 1363,1367 **** pthread_attr_setschedpolicy(&w_attr, SCHED_FIFO); /* use rt scheduling */ ! status = pthread_create(&watchdog_id, &w_attr, (void*) watchdog_thread, NULL); }
--- 1370,1375 ---- pthread_attr_setschedpolicy(&w_attr, SCHED_FIFO); /* use rt scheduling */ ! status = pthread_create(&watchdog_id, &w_attr, (void*(*)(void*)) watchdog_thread, NULL); ! return status; /* what is this function supposed to return anyway? it tried returning void though declared as int */ }
*************** *** 1411,1415 **** timeout.tv_nsec = now.tv_usec * 1000; ! sys_callback((void*)watchdog_callback, 0, 0); status = pthread_cond_timedwait(&watchdog_cond, &watchdog_mutex, &timeout); --- 1419,1423 ---- timeout.tv_nsec = now.tv_usec * 1000; ! sys_callback((t_int(*)(t_int*))watchdog_callback, 0, 0); status = pthread_cond_timedwait(&watchdog_cond, &watchdog_mutex, &timeout);
Index: s_file.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_file.c,v retrieving revision 1.2.4.8.2.4 retrieving revision 1.2.4.8.2.5 diff -C2 -d -r1.2.4.8.2.4 -r1.2.4.8.2.5 *** s_file.c 24 Sep 2005 06:11:45 -0000 1.2.4.8.2.4 --- s_file.c 28 Oct 2005 12:11:30 -0000 1.2.4.8.2.5 *************** *** 63,67 **** } lseek(fd, 0, 0); ! if (!(sys_prefbuf = malloc(length + 2))) { error("couldn't allocate memory for preferences buffer"); --- 63,67 ---- } lseek(fd, 0, 0); ! if (!(sys_prefbuf = (char *)malloc(length + 2))) { error("couldn't allocate memory for preferences buffer");
Index: s_path.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_path.c,v retrieving revision 1.3.4.6.2.1 retrieving revision 1.3.4.6.2.2 diff -C2 -d -r1.3.4.6.2.1 -r1.3.4.6.2.2 *** s_path.c 16 Oct 2005 10:46:40 -0000 1.3.4.6.2.1 --- s_path.c 28 Oct 2005 12:11:30 -0000 1.3.4.6.2.2 *************** *** 406,410 **** { buf[1000] = 0; ! if (!(rcargv[i] = malloc(strlen(buf) + 1))) goto cleanup; strcpy(rcargv[i], buf); --- 406,410 ---- { buf[1000] = 0; ! if (!(rcargv[i] = (char *)malloc(strlen(buf) + 1))) goto cleanup; strcpy(rcargv[i], buf); *************** *** 498,502 **** if (!c || isspace(c)) { ! char *foo = malloc(i - beginstring + 1); if (!foo) return; --- 498,502 ---- if (!c || isspace(c)) { ! char *foo = (char *)malloc(i - beginstring + 1); if (!foo) return;