Welcome to our community

Be a part of something great, join today!

  • Hey all, just changed over the backend after 15 years I figured time to give it a bit of an update, its probably gonna be a bit weird for most of you and i am sure there is a few bugs to work out but it should kinda work the same as before... hopefully :)

REDLINK SDK v6.41.5 Released

Joined
Aug 22, 2011
Messages
1,172
Reaction score
0
Points
0
REDLINK SDK v6.41.x is a minor update to REDLINK SDK v6.40.x, adding support for WiFi static IP addresses introduced in camera firmware 6.3.17 and minor bug fixes.


REDLINK SDK V6.41.5 CHANGES


Added parameters:
RCP_PARAM_WIFI_NETMASK
RCP_PARAM_WIFI_GATEWAY
RCP_PARAM_WIFI_DHCP_ENABLE
RCP_PARAM_AUDIO_CH1_MODE_STATUS
RCP_PARAM_AUDIO_CH2_MODE_STATUS


Always check https://www.red.com/developers for the most up to date version of the SDK.
 
REDLINK SDK - Solving Compile Warnings : Analysis : c_list.c : (from Xcode)

1) Function : _c_list_export_normal_string()

Existing code:
c_list_num_t cur_int;
Suggested change : size_t cur_int;
Reason : "cur_int = cur;" compile warning due to implicit casting. Changing to 'size_t' causes warning to vanish.

Complimentary change: (due to above change)
Existing code: snprintf(buff, sizeof(buff), "%d", cur_int);
Suggested change : snprintf(buff, sizeof(buff), "%zu", cur_int);


2) Function : _c_list_export_min_max_step_string()

Existing code:
c_list_num_t cur_int;
Suggested change : size_t cur_int;
Reason : "cur_int = cur;" compile warning due to implicit casting. Changing to 'size_t' causes warning to vanish.

Complimentary change: (due to above change)
Existing code: snprintf(buff, sizeof(buff), "%d", cur_int);
Suggested change : snprintf(buff, sizeof(buff), "%zu", cur_int);


AJ
 
REDLINK SDK - Solving Compile Warnings : Analysis : rcp_api_hw_cap.c : (from Xcode)

Function : _rcp_process_hw_cap_packet()

Existing code:
+) const unsigned long data = strtoul <- 64 bit
+) if (con->hw_cap_data[ii] != data) <- 32 bit
+) con->hw_cap_data[ii] = data; <- 32 bit

Issue : Implicit cast (ie data could be larger than 32bits).

Solution : If the intention is to remain within 32 bits:
+) if (con->hw_cap_data[ii] != (uint32_t) data)
+) con->hw_cap_data[ii] = (uint32_t) data; <- 32 bit


AJ
 
REDLINK SDK - Solving Compile Warnings : Analysis : rcp_api_process.c : (from Xcode)

Function : _rcp_process_packet()

Existing code: cur = _rcp_get_id_from_cur_msg(packet->pParam, strlen(packet->pParam));

Issue : Implicit conversion (unsigned long -> unsigned int)

Solution : cur = _rcp_get_id_from_cur_msg(packet->pParam, (unsigned int) strlen(packet->pParam));

AJ
 
REDLINK SDK - Solving Compile Warnings : Analysis : c_list.c : (from Xcode)

1) Function : _c_list_export_normal_string()

Existing code:
c_list_num_t cur_int;
Suggested change : size_t cur_int;
Reason : "cur_int = cur;" compile warning due to implicit casting. Changing to 'size_t' causes warning to vanish.

Complimentary change: (due to above change)
Existing code: snprintf(buff, sizeof(buff), "%d", cur_int);
Suggested change : snprintf(buff, sizeof(buff), "%zu", cur_int);


2) Function : _c_list_export_min_max_step_string()

Existing code:
c_list_num_t cur_int;
Suggested change : size_t cur_int;
Reason : "cur_int = cur;" compile warning due to implicit casting. Changing to 'size_t' causes warning to vanish.

Complimentary change: (due to above change)
Existing code: snprintf(buff, sizeof(buff), "%d", cur_int);
Suggested change : snprintf(buff, sizeof(buff), "%zu", cur_int);


AJ

I don't like your proposed changes:
- changing cur_int to size_t breaks our use of -1 to signify there is no selected item (in the case of an empty list)
- the format specifier %zu is a C99 addition and not support by all compilers

I am currently looking at a cleaner more portable fix to the warning. In the meantime, if you can't live with a warning, simply use:
cur_int = (c_list_num_t) cur;
 
REDLINK SDK - Solving Compile Warnings : Analysis : rcp_api_hw_cap.c : (from Xcode)

Function : _rcp_process_hw_cap_packet()

Existing code:
+) const unsigned long data = strtoul <- 64 bit
+) if (con->hw_cap_data[ii] != data) <- 32 bit
+) con->hw_cap_data[ii] = data; <- 32 bit

Issue : Implicit cast (ie data could be larger than 32bits).

Solution : If the intention is to remain within 32 bits:
+) if (con->hw_cap_data[ii] != (uint32_t) data)
+) con->hw_cap_data[ii] = (uint32_t) data; <- 32 bit


AJ

I went with a different fix:

const uint32_t data = (uint32_t) strtoul ...

The data sent by the camera is guaranteed to by 32bits per argument.
 
REDLINK SDK - Solving Compile Warnings : Analysis : rcp_api_process.c : (from Xcode)

Function : _rcp_process_packet()

Existing code: cur = _rcp_get_id_from_cur_msg(packet->pParam, strlen(packet->pParam));

Issue : Implicit conversion (unsigned long -> unsigned int)

Solution : cur = _rcp_get_id_from_cur_msg(packet->pParam, (unsigned int) strlen(packet->pParam));

AJ

I agree with your fix.

I'd prefer if gperf allow me to change the type of the 'len' parameter to size_t, but the standard implementation does not. I like the non-standard "--size-type" option that apple added to gperf.
 
Back
Top