Changes between Initial Version and Version 1 of Ticket #1992
- Timestamp:
- 01/30/11 08:26:40 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1992 – description
initial v1 2 2 see https://github.com/parrot/parrot/blob/master/src/nci_test.c#-115 , there are two define here. 3 3 4 5 {{{ 4 6 typedef void (*cb_C1_func)(const char*, void*); 5 7 PARROT_DYNEXT_EXPORT void nci_cb_C1(cb_C1_func, void*); 8 }}} 9 6 10 7 11 the callback is created by: 12 13 {{{ 8 14 cb_wrapped = new_callback cb, user_data, "vtU" 15 }}} 16 9 17 10 18 which means it's first parameter is external_data, and the two is user_data. that is, the callback function should be defined as this one: 19 20 {{{ 11 21 .sub _call_back 12 22 .param string external_data … … 19 29 print "\n" 20 30 .end 31 }}} 32 21 33 22 34 but actually in t/pmc/nci.t, it's defined as: 35 36 {{{ 23 37 .sub _call_back 24 38 .param pmc user_data … … 32 46 .end 33 47 48 }}} 49 34 50 35 51 according to t/pmc/nci.t it seems that no matter user_data is the first parameter or two, the callback sub must defined as: 52 53 {{{ 36 54 .sub _call_back 37 55 .param pmc user_data 38 56 .param string external_data 39 57 .end 58 }}} 59 40 60 41 61 then I took a look at PDD16, and it's said user_data should be defined in the second parameter: 42 62 63 64 {{{ 43 65 .sub _call_back 44 66 .param string external_data … … 46 68 .end 47 69 70 }}} 71 48 72 which is right.