Skip to content

Commit ef71bb2

Browse files
authored
Merge pull request #22 from trcwm/master
Fix OSX 16-bit/8-bit signed properties.
2 parents f24d105 + 570f4af commit ef71bb2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

mac/uvcctrl.mm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,10 @@
525525
switch(propertyInfo[propID].length)
526526
{
527527
case 2:
528-
*value &= 0xFFFF;
528+
*value = static_cast<int16_t>(*value);
529529
break;
530530
case 1:
531-
*value &= 0xFF;
531+
*value = static_cast<int8_t>(*value);
532532
break;
533533
default:
534534
break;
@@ -668,14 +668,14 @@
668668
switch(propertyInfo[propID].length)
669669
{
670670
case 2:
671-
*emin &= 0xFFFF;
672-
*emax &= 0xFFFF;
673-
*dValue &= 0xFFFF;
671+
*emin = static_cast<int16_t>(*emin);
672+
*emax = static_cast<int16_t>(*emax);
673+
*dValue = static_cast<int16_t>(*dValue);
674674
break;
675675
case 1:
676-
*emin &= 0xFF;
677-
*emax &= 0xFF;
678-
*dValue &= 0xFF;
676+
*emin = static_cast<int8_t>(*emin);
677+
*emax = static_cast<int8_t>(*emax);
678+
*dValue = static_cast<int8_t>(*dValue);
679679
break;
680680
default:
681681
break;

0 commit comments

Comments
 (0)