[vlc-commits] More similarities between npmac and npunix

Jean-Baptiste Kempf git at videolan.org
Thu Apr 24 11:13:51 CEST 2014


npapi-vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Apr 24 11:13:09 2014 +0200| [2a5c6203b6c0a4da882370f1678f0dfd2ea0fde6] | committer: Jean-Baptiste Kempf

More similarities between npmac and npunix

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

 npapi/support/npmac.cpp  |   56 +++++++++++++++++++++++++---------------------
 npapi/support/npunix.cpp |   39 ++++++++++++++++----------------
 2 files changed, 51 insertions(+), 44 deletions(-)

diff --git a/npapi/support/npmac.cpp b/npapi/support/npmac.cpp
index 541af39..bd3def2 100644
--- a/npapi/support/npmac.cpp
+++ b/npapi/support/npmac.cpp
@@ -523,53 +523,49 @@ NPError
 NPError
 Private_Destroy(NPP instance, NPSavedData** save)
 {
-    NPError err;
-    err = NPP_Destroy(instance, save);
-
-    return err;
+    PLUGINDEBUGSTR("Destroy");
+    return NPP_Destroy(instance, save);
 }
 
 NPError
 Private_SetWindow(NPP instance, NPWindow* window)
 {
     NPError err;
+    PLUGINDEBUGSTR("SetWindow");
     err = NPP_SetWindow(instance, window);
-
     return err;
 }
 
 NPError
-Private_GetValue( NPP instance, NPPVariable variable, void *value)
+Private_GetValue(NPP instance, NPPVariable variable, void *r_value)
 {
-    NPError err;
-    err = NPP_GetValue(instance, variable, value);
-
-    return err;
+    PLUGINDEBUGSTR("GetValue");
+    return NPP_GetValue(instance, variable, r_value);
 }
 
 NPError
-Private_SetValue( NPP instance, NPNVariable variable, void *value)
+Private_SetValue(NPP instance, NPNVariable variable, void *r_value)
 {
-    NPError err;
-    err = NPP_SetValue(instance, variable, value);
-
-    return err;
+    PLUGINDEBUGSTR("SetValue");
+    return NPP_SetValue(instance, variable, r_value);
 }
 
 NPError
-Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype)
+Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
+            NPBool seekable, uint16_t* stype)
 {
     NPError err;
+    PLUGINDEBUGSTR("NewStream");
     err = NPP_NewStream(instance, type, stream, seekable, stype);
-
     return err;
 }
 
-int32_t Private_WriteReady(NPP instance, NPStream* stream)
+int32_t
+Private_WriteReady(NPP instance, NPStream* stream)
 {
     int32_t result;
+    PLUGINDEBUGSTR("WriteReady");
     result = NPP_WriteReady(instance, stream);
-
     return result;
 }
 
@@ -601,19 +597,29 @@ Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
     return err;
 }
 
-int16_t Private_HandleEvent(NPP instance, void* event)
+void
+Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
 {
-    int16_t result;
-    result = NPP_HandleEvent(instance, event);
-
-    return result;
+    PLUGINDEBUGSTR("URLNotify");
+    NPP_URLNotify(instance, url, reason, notifyData);
 }
 
-void Private_Print(NPP instance, NPPrint* platformPrint)
+void
+Private_Print(NPP instance, NPPrint* platformPrint)
 {
+    PLUGINDEBUGSTR("Print");
     NPP_Print(instance, platformPrint);
 }
 
+int16_t
+Private_HandleEvent(NPP instance, void* event)
+{
+    int16_t result;
+    PLUGINDEBUGSTR("HandleEvent");
+    result = NPP_HandleEvent(instance, event);
+    return result;
+}
+
 void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
 {
     NPP_URLNotify(instance, url, reason, notifyData);
diff --git a/npapi/support/npunix.cpp b/npapi/support/npunix.cpp
index 0963e83..b6d1989 100644
--- a/npapi/support/npunix.cpp
+++ b/npapi/support/npunix.cpp
@@ -522,7 +522,7 @@ Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
     PLUGINDEBUGSTR("New");
     gUserAgent = NPN_UserAgent(instance);
     ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
-    return ret; 
+    return ret;
 }
 
 NPError
@@ -542,6 +542,20 @@ Private_SetWindow(NPP instance, NPWindow* window)
 }
 
 NPError
+Private_GetValue(NPP instance, NPPVariable variable, void *r_value)
+{
+    PLUGINDEBUGSTR("GetValue");
+    return NPP_GetValue(instance, variable, r_value);
+}
+
+NPError
+Private_SetValue(NPP instance, NPNVariable variable, void *r_value)
+{
+    PLUGINDEBUGSTR("SetValue");
+    return NPP_SetValue(instance, variable, r_value);
+}
+
+NPError
 Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
             NPBool seekable, uint16_t* stype)
 {
@@ -554,7 +568,7 @@ Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
 int32_t
 Private_WriteReady(NPP instance, NPStream* stream)
 {
-    unsigned int result;
+    int32_t result;
     PLUGINDEBUGSTR("WriteReady");
     result = NPP_WriteReady(instance, stream);
     return result;
@@ -589,8 +603,7 @@ Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
 }
 
 void
-Private_URLNotify(NPP instance, const char* url,
-                NPReason reason, void* notifyData)
+Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
 {
     PLUGINDEBUGSTR("URLNotify");
     NPP_URLNotify(instance, url, reason, notifyData);
@@ -606,22 +619,10 @@ Private_Print(NPP instance, NPPrint* platformPrint)
 int16_t
 Private_HandleEvent(NPP instance, NPEvent *event)
 {
+    int16_t result;
     PLUGINDEBUGSTR("HandleEvent");
-    NPP_HandleEvent(instance, event);
-}
-
-NPError
-Private_GetValue(NPP instance, NPPVariable variable, void *r_value)
-{
-    PLUGINDEBUGSTR("GetValue");
-    return NPP_GetValue(instance, variable, r_value);
-}
-
-NPError
-Private_SetValue(NPP instance, NPNVariable variable, void *r_value)
-{
-    PLUGINDEBUGSTR("SetValue");
-    return NPP_SetValue(instance, variable, r_value);
+    result = NPP_HandleEvent(instance, event);
+    return result;
 }
 
 /*********************************************************************** 



More information about the vlc-commits mailing list