Commit abbf65fc authored by Filip Roséen's avatar Filip Roséen Committed by Rémi Denis-Courmont

vlc_fingerprinter: use size_t for index argument in callback

It does not make sense for the passed index to be negative, nor is the
current diagnostic related to comparision of different signedness very
nice to look at.

This fixes both issues by changing the argument to size_t, making sure
that the values passed are suitable for interaction with
vlc_array-related functions.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 9d1575cf
......@@ -77,7 +77,7 @@ struct fingerprinter_thread_t
void ( *pf_enqueue ) ( struct fingerprinter_thread_t *f, fingerprint_request_t *r );
fingerprint_request_t * ( *pf_getresults ) ( struct fingerprinter_thread_t *f );
void ( *pf_apply ) ( fingerprint_request_t *, int i_resultid );
void ( *pf_apply ) ( fingerprint_request_t *, size_t i_resultid );
};
typedef struct fingerprinter_thread_t fingerprinter_thread_t;
......
......@@ -46,7 +46,7 @@ fingerprint_request_t * Chromaprint::fetchResults()
return p_fingerprinter->pf_getresults( p_fingerprinter );
}
void Chromaprint::apply( fingerprint_request_t *p_r, int i_id )
void Chromaprint::apply( fingerprint_request_t *p_r, size_t i_id )
{
p_fingerprinter->pf_apply( p_r, i_id );
}
......
......@@ -40,7 +40,7 @@ public:
static int results_available( vlc_object_t *p_this, const char *,
vlc_value_t, vlc_value_t newval, void *param );
fingerprint_request_t * fetchResults();
void apply( fingerprint_request_t *, int i_id );
void apply( fingerprint_request_t *, size_t i_id );
static bool isSupported( QString uri );
signals:
......
......@@ -114,7 +114,7 @@ static fingerprint_request_t * GetResult( fingerprinter_thread_t *f )
return r;
}
static void ApplyResult( fingerprint_request_t *p_r, int i_resultid )
static void ApplyResult( fingerprint_request_t *p_r, size_t i_resultid )
{
if ( i_resultid >= vlc_array_count( & p_r->results.metas_array ) ) return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment