Non-volatile access to volatile object is UB.

development
Lev Serebryakov 2017-02-14 17:05:16 +03:00 committed by hayati ayguen
parent 037d192d76
commit cb5b953d25
1 changed files with 2 additions and 2 deletions

View File

@ -192,7 +192,7 @@ struct rtlsdr_dev {
rtlsdr_read_async_cb_t cb;
void *cb_ctx;
volatile enum rtlsdr_async_status async_status;
volatile int async_cancel;
int async_cancel;
int use_zerocopy;
/* rtl demod context */
uint32_t rate; /* Hz */
@ -3539,7 +3539,7 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev, rtlsdr_read_async_cb_t cb, void *ctx,
while (RTLSDR_INACTIVE != dev->async_status) {
r = libusb_handle_events_timeout_completed(dev->ctx, &tv,
(int *)&dev->async_cancel);
&dev->async_cancel);
if (r < 0) {
/*fprintf(stderr, "handle_events returned: %d\n", r);*/
if (r == LIBUSB_ERROR_INTERRUPTED) /* stray signal */