Update of /cvsroot/pure-data/externals/io/hidio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13268
Modified Files: hidio.c hidio.h Log Message: fixed the bug that made it crash in Max/MSP on OS X
Index: hidio.c =================================================================== RCS file: /cvsroot/pure-data/externals/io/hidio/hidio.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** hidio.c 8 Dec 2006 11:28:25 -0000 1.12 --- hidio.c 21 Dec 2006 18:40:59 -0000 1.13 *************** *** 430,433 **** --- 430,434 ---- { // debug_print(LOG_DEBUG,"hidio_child_read"); + t_hid_element *current_element; unsigned int i; #ifdef PD *************** *** 437,441 **** clock_getftime(&right_now); #endif /* PD */ - t_hid_element *current_element; if(right_now > last_execute_time[x->x_device_number]) --- 438,441 ---- *************** *** 941,944 **** --- 941,945 ---- ps_range = gensym("range");
+ generate_type_symbols(); generate_event_symbols();
Index: hidio.h =================================================================== RCS file: /cvsroot/pure-data/externals/io/hidio/hidio.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** hidio.h 8 Dec 2006 11:28:25 -0000 1.10 --- hidio.h 21 Dec 2006 18:40:59 -0000 1.11 *************** *** 35,38 **** --- 35,40 ---- typedef void t_outlet; typedef void t_clock; + #define getbytes(s) malloc(s) + #define freebytes(p, s) free(p) #define MAXPDSTRING 512 #define pd_error(x, b) error(b) *************** *** 181,209 **** * platform */ ! t_int hidio_open_device(t_hidio *x, short device_number); ! t_int hidio_close_device(t_hidio *x); ! void hidio_build_device_list(void); ! void hidio_get_events(t_hidio *x); ! void hidio_doprint(t_hidio* x); /* print info to the console */ ! void hidio_platform_specific_info(t_hidio* x); /* device info on the status outlet */ ! void hidio_platform_specific_free(t_hidio *x); ! short get_device_number_by_id(unsigned short vendor_id, unsigned short product_id); /* TODO: this function should probably accept the single unsigned for the combined usage_page and usage, instead of two separate variables */ ! short get_device_number_from_usage(short device_number, unsigned short usage_page, unsigned short usage);
/* cross-platform force feedback functions */ ! t_int hidio_ff_autocenter(t_hidio *x, t_float value); ! t_int hidio_ff_gain(t_hidio *x, t_float value); ! t_int hidio_ff_motors(t_hidio *x, t_float value); ! t_int hidio_ff_continue(t_hidio *x); ! t_int hidio_ff_pause(t_hidio *x); ! t_int hidio_ff_reset(t_hidio *x); ! t_int hidio_ff_stopall(t_hidio *x);
// these are just for testing... ! t_int hidio_ff_fftest (t_hidio *x, t_float value); ! void hidio_ff_print(t_hidio *x);
/*============================================================================== --- 183,211 ---- * platform */ ! extern t_int hidio_open_device(t_hidio *x, short device_number); ! extern t_int hidio_close_device(t_hidio *x); ! extern void hidio_build_device_list(void); ! extern void hidio_get_events(t_hidio *x); ! extern void hidio_doprint(t_hidio* x); /* print info to the console */ ! extern void hidio_platform_specific_info(t_hidio* x); /* device info on the status outlet */ ! extern void hidio_platform_specific_free(t_hidio *x); ! extern short get_device_number_by_id(unsigned short vendor_id, unsigned short product_id); /* TODO: this function should probably accept the single unsigned for the combined usage_page and usage, instead of two separate variables */ ! extern short get_device_number_from_usage(short device_number, unsigned short usage_page, unsigned short usage);
/* cross-platform force feedback functions */ ! extern t_int hidio_ff_autocenter(t_hidio *x, t_float value); ! extern t_int hidio_ff_gain(t_hidio *x, t_float value); ! extern t_int hidio_ff_motors(t_hidio *x, t_float value); ! extern t_int hidio_ff_continue(t_hidio *x); ! extern t_int hidio_ff_pause(t_hidio *x); ! extern t_int hidio_ff_reset(t_hidio *x); ! extern t_int hidio_ff_stopall(t_hidio *x);
// these are just for testing... ! extern t_int hidio_ff_fftest (t_hidio *x, t_float value); ! extern void hidio_ff_print(t_hidio *x);
/*============================================================================== *************** *** 234,239 **** extern t_symbol *relative_symbols[RELATIVE_ARRAY_MAX];
! void generate_event_symbols(); ! void generate_type_symbols();
--- 236,241 ---- extern t_symbol *relative_symbols[RELATIVE_ARRAY_MAX];
! extern void generate_event_symbols(); ! extern void generate_type_symbols();