[vlc-commits] [Git][videolan/libvlcpp][master] Replace remaining NULL with nullptr

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Wed Nov 3 08:35:04 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / libvlcpp


Commits:
b0e7d093 by Hugo Beauzée-Luyssen at 2021-11-03T08:31:43+00:00
Replace remaining NULL with nullptr

- - - - -


5 changed files:

- test/main.cpp
- vlcpp/Instance.hpp
- vlcpp/Internal.hpp
- vlcpp/Media.hpp
- vlcpp/MediaPlayer.hpp


Changes:

=====================================
test/main.cpp
=====================================
@@ -61,7 +61,7 @@ int main(int ac, char** av)
     mp.setVideoCallbacks([imgBuffer](void** pBuffer) -> void* {
         std::cout << "Lock" << std::endl;
         *pBuffer = imgBuffer;
-        return NULL;
+        return nullptr;
     }, [](void*, void*const*) {
         std::cout << "unlock" << std::endl;
     }, nullptr);


=====================================
vlcpp/Instance.hpp
=====================================
@@ -90,7 +90,7 @@ public:
      * LibVLC, just like VLC media player does. The list of valid arguments
      * depends on the LibVLC version, the operating system and platform, and
      * set of available LibVLC plugins. Invalid or unsupported arguments will
-     * cause the function to fail (i.e. return NULL). Also, some arguments
+     * cause the function to fail (i.e. return nullptr). Also, some arguments
      * may alter the behaviour or otherwise interfere with other LibVLC
      * functions.
      *
@@ -101,7 +101,7 @@ public:
      *
      * \param argc  the number of arguments (should be 0)
      *
-     * \param argv  list of arguments (should be NULL)
+     * \param argv  list of arguments (should be nullptr)
      */
     Instance(int argc, const char *const * argv)
         : Internal{ libvlc_new( argc, argv ), libvlc_release }
@@ -306,7 +306,7 @@ public:
             return {};
         libvlc_module_description_t* p = ptr.get();
         std::vector<ModuleDescription> res;
-        while ( p != NULL )
+        while ( p != nullptr )
         {
             res.emplace_back( p );
             p = p->p_next;
@@ -328,7 +328,7 @@ public:
             return {};
         libvlc_module_description_t* p = ptr.get();
         std::vector<ModuleDescription> res;
-        while ( p != NULL )
+        while ( p != nullptr )
         {
             res.emplace_back( p );
             p = p->p_next;
@@ -350,7 +350,7 @@ public:
         std::vector<AudioOutputDescription> res;
 
         libvlc_audio_output_t* p = result.get();
-        while ( p != NULL )
+        while ( p != nullptr )
         {
             res.emplace_back( p );
             p = p->p_next;
@@ -364,7 +364,7 @@ public:
      * \see Audio::outputDeviceSet() .
      *
      * \note Not all audio outputs support this. In particular, an empty
-     * (NULL) list of devices does imply that the specified audio output does
+     * (nullptr) list of devices does imply that the specified audio output does
      * not work.
      *
      * \note The list might not be exhaustive.
@@ -407,7 +407,7 @@ public:
      *
      *You can interact with this dialog by using the postLogin method on dialog to post an answer or the dismiss method to cancel this dialog.
      *
-     *\note to receive this callack, CancelCb should not be NULL.
+     *\note to receive this callack, CancelCb should not be nullptr.
      *\param dialog used to interact with the dialog
      *\param title title of the dialog
      *\param text text of the dialog
@@ -421,8 +421,7 @@ public:
      * You can interact with this dialog by using the postAction method on dialog
      * to post an answer or dismiss method to cancel this dialog.
      *
-     * \note to receive this callack, CancelCb should not be
-     * NULL.
+     * \note to receive this callack, CancelCb should not be nullptr.
      *
      * \param dialog used to interact with the dialog
      * \param title title of the diaog


=====================================
vlcpp/Internal.hpp
=====================================
@@ -68,7 +68,7 @@ class Internal
         Internal( InternalPtr obj, Releaser releaser )
         {
             if ( obj == nullptr )
-                throw std::runtime_error("Wrapping a NULL instance");
+                throw std::runtime_error("Wrapping a nullptr instance");
             m_obj.reset( obj, releaser );
         }
 


=====================================
vlcpp/Media.hpp
=====================================
@@ -421,7 +421,7 @@ public:
     /**
      * Read the meta of the media.
      *
-     * If the media has not yet been parsed this will return NULL.
+     * If the media has not yet been parsed this will return an empty string.
      *
      * This methods automatically calls parseAsync() , so after
      * calling it you may receive a libvlc_MediaMetaChanged event. If you


=====================================
vlcpp/MediaPlayer.hpp
=====================================
@@ -129,8 +129,8 @@ public:
     /**
      * Get the media used by the media_player.
      *
-     * \return the media associated with p_mi, or NULL if no media is
-     * associated
+     * \return the media associated with p_mi, or a nullptr shared_ptr if no
+     * media is associated
      */
     MediaPtr media()
     {
@@ -853,7 +853,7 @@ public:
         std::vector<AudioOutputDeviceDescription> res;
         std::unique_ptr<libvlc_audio_output_device_t, decltype(&libvlc_audio_output_device_list_release)>
                 devicesPtr( devices, libvlc_audio_output_device_list_release);
-        for ( auto* p = devices; p != NULL; p = p->p_next )
+        for ( auto* p = devices; p != nullptr; p = p->p_next )
             res.emplace_back( p );
         return res;
     }
@@ -1637,13 +1637,13 @@ public:
     void setDeinterlace(DeinterlaceState state, const std::string& mode)
     {
         libvlc_video_set_deinterlace(*this, static_cast<int>( state ),
-                                     mode.empty() ? NULL : mode.c_str());
+                                     mode.empty() ? nullptr: mode.c_str());
     }
 #else
     void setDeinterlace(const std::string& mode)
     {
         libvlc_video_set_deinterlace(*this,
-                                     mode.empty() ? NULL : mode.c_str());
+                                     mode.empty() ? nullptr : mode.c_str());
     }
 #endif
 



View it on GitLab: https://code.videolan.org/videolan/libvlcpp/-/commit/b0e7d093a89eae248ff17cf80e0fd8feb92089c0

-- 
View it on GitLab: https://code.videolan.org/videolan/libvlcpp/-/commit/b0e7d093a89eae248ff17cf80e0fd8feb92089c0
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list