Changeset 5335:dba934a2d1e0 in roaraudio for libroar
- Timestamp:
- 12/09/11 18:13:39 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/roardl.c
r5321 r5335 538 538 539 539 int roar_dl_appsched_trigger(struct roar_dl_lhandle * lhandle, enum roar_dl_appsched_trigger trigger) { 540 int (*func) (struct roar_dl_librarypara * para) = NULL; 540 541 int ret; 541 542 … … 553 554 #define _trig(lname,uname) \ 554 555 case ROAR_DL_APPSCHED_ ## uname : \ 555 if ( lhandle->lib->appsched->lname == NULL ) { \ 556 roar_err_set(ROAR_ERROR_NOENT); \ 557 return -1; \ 558 } \ 559 roar_dl_context_restore(lhandle); \ 560 ret = lhandle->lib->appsched->lname(lhandle->para); \ 561 roar_dl_context_store(lhandle); \ 562 return ret; \ 556 func = lhandle->lib->appsched->lname; \ 563 557 break; 564 558 _trig(init, INIT); 565 559 _trig(free, FREE); 566 560 _trig(update, UPDATE); 567 } 568 569 roar_err_set(ROAR_ERROR_BADRQC); 570 return -1; 561 _trig(tick, TICK); 562 _trig(wait, WAIT); 563 // use ifndef here so warnings of unhandled enum values will be shown in DEBUG mode. 564 #ifndef DEBUG 565 default: 566 roar_err_set(ROAR_ERROR_BADRQC); 567 return -1; 568 break; 569 #endif 570 } 571 572 if ( func == NULL ) { 573 roar_err_set(ROAR_ERROR_NOENT); 574 return -1; 575 } 576 577 roar_dl_context_restore(lhandle); 578 ret = func(lhandle->para); 579 roar_dl_context_store(lhandle); 580 return ret; 571 581 } 572 582
Note: See TracChangeset
for help on using the changeset viewer.