Click here to go to the first RED TEAM post in this thread.   Thread: REDLINK SDK v6.41.5 Released

Reply to Thread
Results 1 to 9 of 9
  1.   Click here to go to the next RED TEAM post in this thread.
  #1 REDLINK SDK v6.41.5 Released 
    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.
    Reply With Quote  
     

  2. #2  
    Senior Member Antony Newman's Avatar
    Join Date
    Mar 2012
    Location
    London, UK.
    Posts
    1,561
    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
    Reply With Quote  
     

  3. #3  
    Senior Member Antony Newman's Avatar
    Join Date
    Mar 2012
    Location
    London, UK.
    Posts
    1,561
    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
    Reply With Quote  
     

  4. #4  
    Senior Member Antony Newman's Avatar
    Join Date
    Mar 2012
    Location
    London, UK.
    Posts
    1,561
    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
    Reply With Quote  
     

  5.   Click here to go to the next RED TEAM post in this thread.
  #5  
    Quote Originally Posted by Antony Newman View Post
    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;
    Reply With Quote  
     

  6.   Click here to go to the next RED TEAM post in this thread.
  #6  
    Quote Originally Posted by Antony Newman View Post
    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.
    Reply With Quote  
     

  7.   Click here to go to the next RED TEAM post in this thread.
  #7  
    Quote Originally Posted by Antony Newman View Post
    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.
    Reply With Quote  
     

  8. #8  
    Senior Member Antony Newman's Avatar
    Join Date
    Mar 2012
    Location
    London, UK.
    Posts
    1,561
    Thankyou Trent.

    AJ.
    Reply With Quote  
     

  9.   This is the last RED TEAM post in this thread.   #9  
    Quote Originally Posted by Antony Newman View Post
    Thankyou Trent.

    AJ.
    Thanks for the feedback. Sometimes oversights like the ones you pointed out can cause real issues.
    Reply With Quote  
     

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts