Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Unable to cast
Forum Updated to NodeBB v4.3 + New Features

Unable to cast

Scheduled Pinned Locked Moved Solved C++ Gurus
3 Posts 2 Posters 545 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by mrdebug
    #1

    Hi, can you suggest me how to cast in "new style" the following line of code ((const uint8_t**)pAVFrame->data)?

    Ret= swr_convert(pSwrContext, static_cast<uint8_t**>(&buffer), pAVFrame->nb_samples, (const uint8_t**)pAVFrame->data, pAVFrame->nb_samples);
    

    int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count);
    pAVFrame->data is uint8_t *data[AV_NUM_DATA_POINTERS];

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #2
      Ret= swr_convert(pSwrContext, static_cast<uint8_t**>(&buffer), pAVFrame->nb_samples, const_cast<const uint8_t**>(pAVFrame->data), pAVFrame->nb_samples);
      

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      1 Reply Last reply
      0
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by
        #3

        I too very much dislike c++ style casts... too fracking wordy to use them in places like

        uint8_t c{ 0x43 };
        cout << static_cast<int>(c);
        // would be shorter and just as obvious when done as
        cout << (int)c;
        

        I light my way forward with the fires of all the bridges I've burned behind me.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved