[vlc-commits] Replace a magic number by a #define

Ludovic Fauvet git at videolan.org
Thu Jan 3 17:21:55 CET 2013


npapi-vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Thu Jan  3 16:14:00 2013 +0100| [0648e6f45ccb9966785b32d73cff2ec1063fbbf2] | committer: Ludovic Fauvet

Replace a magic number by a #define

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=0648e6f45ccb9966785b32d73cff2ec1063fbbf2
---

 npapi/vlcplugin_base.cpp |    4 ++--
 npapi/vlcplugin_base.h   |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index 569a0ee..6be0dba 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -93,7 +93,7 @@ void VlcPluginBase::event_callback(const libvlc_event_t* event,
 NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
 {
     /* prepare VLC command line */
-    const char *ppsz_argv[32];
+    const char *ppsz_argv[MAX_PARAMS];
     int ppsz_argc = 0;
 
 #ifndef NDEBUG
@@ -138,7 +138,7 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
     bool b_autoloop = false;
 
     /* parse plugin arguments */
-    for( int i = 0; (i < argc) && (ppsz_argc < 32); i++ )
+    for( int i = 0; (i < argc) && (ppsz_argc < MAX_PARAMS); i++ )
     {
        /* fprintf(stderr, "argn=%s, argv=%s\n", argn[i], argv[i]); */
 
diff --git a/npapi/vlcplugin_base.h b/npapi/vlcplugin_base.h
index 78933a2..b42b30d 100644
--- a/npapi/vlcplugin_base.h
+++ b/npapi/vlcplugin_base.h
@@ -40,6 +40,8 @@
 #include "../common/vlc_player_options.h"
 #include "../common/vlc_player.h"
 
+#define MAX_PARAMS 32
+
 typedef enum vlc_toolbar_clicked_e {
     clicked_Unknown = 0,
     clicked_Play,



More information about the vlc-commits mailing list