Skip to content

Commit

Permalink
added explicite (uint16_t) casts inside tu_htole16()
Browse files Browse the repository at this point in the history
  • Loading branch information
heikokue committed Mar 3, 2024
1 parent 20046cc commit cef62c0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/class/cdc/cdc_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,8 @@ static bool acm_set_line_coding(cdch_interface_t * p_cdc, tuh_xfer_cb_t complete
},
.bRequest = CDC_REQUEST_SET_LINE_CODING,
.wValue = 0,
.wIndex = tu_htole16(p_cdc->bInterfaceNumber),
.wLength = tu_htole16(sizeof(cdc_line_coding_t))
.wIndex = tu_htole16((uint16_t) p_cdc->bInterfaceNumber),
.wLength = tu_htole16((uint16_t) sizeof(cdc_line_coding_t))
};

// use usbh enum buf to hold line coding since user line_coding variable does not live long enough
Expand Down Expand Up @@ -1612,7 +1612,7 @@ static bool cp210x_set_request(cdch_interface_t * p_cdc, uint8_t command, uint16
},
.bRequest = command,
.wValue = tu_htole16(value),
.wIndex = tu_htole16(p_cdc->bInterfaceNumber),
.wIndex = tu_htole16((uint16_t) p_cdc->bInterfaceNumber),
.wLength = tu_htole16(length)
};

Expand Down Expand Up @@ -1852,9 +1852,9 @@ static bool ch34x_set_request(cdch_interface_t * p_cdc, uint8_t direction, uint8
.direction = direction & 0x01u
},
.bRequest = request,
.wValue = tu_htole16 (value),
.wIndex = tu_htole16 (index),
.wLength = tu_htole16 (length)
.wValue = tu_htole16(value),
.wIndex = tu_htole16(index),
.wLength = tu_htole16(length)
};

// use usbh enum buf since application variable does not live long enough
Expand Down Expand Up @@ -2232,9 +2232,9 @@ static bool pl2303_set_request(cdch_interface_t * p_cdc, uint8_t request, uint8_
tusb_control_request_t const request_setup = {
.bmRequestType = requesttype,
.bRequest = request,
.wValue = tu_htole16 (value),
.wIndex = tu_htole16 (index),
.wLength = tu_htole16 (length)
.wValue = tu_htole16(value),
.wIndex = tu_htole16(index),
.wLength = tu_htole16(length)
};

// use usbh enum buf since application variable does not live long enough
Expand Down

0 comments on commit cef62c0

Please sign in to comment.