Merge pull request #82 from fmeerkoetter/clang_cleanup

Cleanup warnings reported by clang
This commit is contained in:
Andreas Öman 2012-04-01 13:32:22 -07:00
commit acf35abca2
4 changed files with 3 additions and 5 deletions

View file

@ -469,7 +469,7 @@ cwc_send_msg(cwc_t *cwc, const uint8_t *msg, size_t len, int sid, int enq)
buf[4] = sid >> 8;
buf[5] = sid;
if((len = des_encrypt(buf, len, cwc)) < 0) {
if((len = des_encrypt(buf, len, cwc)) <= 0) {
free(buf);
free(cm);
return -1;

View file

@ -184,7 +184,7 @@ got_pat(const uint8_t *ptr, size_t len, void *opaque)
len -= 8;
ptr += 8;
if(len < 0)
if(len <= 0)
return;
pthread_mutex_lock(&global_lock);

View file

@ -142,8 +142,6 @@ ts_extract_pcr(service_t *t, elementary_stream_t *st, const uint8_t *tsb,
pcr |= (uint64_t)tsb[9] << 1;
pcr |= ((uint64_t)tsb[10] >> 7) & 0x01;
pcr = pcr;
if(pcrp != NULL)
*pcrp = pcr;

View file

@ -400,7 +400,7 @@ extern void scopedunlock(pthread_mutex_t **mtxp);
#define scopedlock(mtx) \
pthread_mutex_t *scopedlock ## __LINE__ \
__attribute__((cleanup(scopedunlock))) = mtx; \
pthread_mutex_lock(mtx);
pthread_mutex_lock(scopedlock ## __LINE__);
#define scopedgloballock() scopedlock(&global_lock)