Mercurial > hg > audiodb
comparison index.cpp @ 473:b2fd8113d8bc api-inversion
const declarations for some API arguments.
This should make it slightly clearer whose responsibility (the user's)
it is to manage the memory pointed to by the corresponding arguments.
Suggested by Chris Cannam.
author | mas01cr |
---|---|
date | Tue, 06 Jan 2009 16:27:01 +0000 |
parents | 4dbd7917bf9e |
children |
comparison
equal
deleted
inserted
replaced
472:0f96ad351990 | 473:b2fd8113d8bc |
---|---|
514 | 514 |
515 /*********************** LSH retrieval ****************************/ | 515 /*********************** LSH retrieval ****************************/ |
516 | 516 |
517 | 517 |
518 // return true if indexed query performed else return false | 518 // return true if indexed query performed else return false |
519 int audiodb_index_init_query(adb_t *adb, adb_query_spec_t *spec, adb_qstate_internal_t *qstate, bool corep) { | 519 int audiodb_index_init_query(adb_t *adb, const adb_query_spec_t *spec, adb_qstate_internal_t *qstate, bool corep) { |
520 | 520 |
521 uint32_t sequence_length = spec->qid.sequence_length; | 521 uint32_t sequence_length = spec->qid.sequence_length; |
522 double radius = spec->refine.radius; | 522 double radius = spec->refine.radius; |
523 if(!(audiodb_index_exists(adb->path, radius, sequence_length))) | 523 if(!(audiodb_index_exists(adb->path, radius, sequence_length))) |
524 return false; | 524 return false; |
576 } | 576 } |
577 | 577 |
578 // return -1 on error | 578 // return -1 on error |
579 // return 0: if index does not exist | 579 // return 0: if index does not exist |
580 // return nqv: if index exists | 580 // return nqv: if index exists |
581 int audiodb_index_query_loop(adb_t *adb, adb_query_spec_t *spec, adb_qstate_internal_t *qstate) { | 581 int audiodb_index_query_loop(adb_t *adb, const adb_query_spec_t *spec, adb_qstate_internal_t *qstate) { |
582 | 582 |
583 double *query = 0, *query_data = 0; | 583 double *query = 0, *query_data = 0; |
584 adb_qpointers_internal_t qpointers = {0}; | 584 adb_qpointers_internal_t qpointers = {0}; |
585 | 585 |
586 adb_qcallback_t callback_data; | 586 adb_qcallback_t callback_data; |