Commit 31b539dd authored by Cheng Sun's avatar Cheng Sun Committed by Jean-Baptiste Kempf

Clean up integer type name checks (e.g. uint16_t) with typedefs

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent cbad6e1a
......@@ -382,11 +382,7 @@ void EventObj::unhook_manager( void *userdata )
/*****************************************************************************
* VlcPlugin constructor and destructor
*****************************************************************************/
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
#else
VlcPlugin::VlcPlugin( NPP instance, uint16_t mode ) :
#endif
VlcPlugin::VlcPlugin( NPP instance, NPuint16_t mode ) :
i_npmode(mode),
b_stream(0),
b_autoplay(1),
......
......@@ -94,6 +94,16 @@
#include "control/nporuntime.h"
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
typedef uint16 NPuint16_t;
typedef int16 NPint16_t;
typedef int32 NPint32_t;
#else
typedef uint16_t NPuint16_t;
typedef int16_t NPint16_t;
typedef int32_t NPint32_t;
#endif
typedef struct {
#if defined(XP_UNIX)
pthread_mutex_t mutex;
......@@ -198,11 +208,7 @@ HMODULE DllGetModule();
class VlcPlugin
{
public:
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
VlcPlugin( NPP, uint16 );
#else
VlcPlugin( NPP, uint16_t );
#endif
VlcPlugin( NPP, NPuint16_t );
virtual ~VlcPlugin();
NPError init(int argc, char* const argn[], char* const argv[]);
......@@ -254,11 +260,7 @@ public:
vlc_toolbar_clicked_t getToolbarButtonClicked( int i_xpos, int i_ypos );
#endif
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
uint16 i_npmode; /* either NP_EMBED or NP_FULL */
#else
uint16_t i_npmode; /* either NP_EMBED or NP_FULL */
#endif
NPuint16_t i_npmode; /* either NP_EMBED or NP_FULL */
/* plugin properties */
int b_stream;
......
......@@ -278,11 +278,7 @@ void NPP_Shutdown( void )
}
NPError NPP_New( NPMIMEType pluginType, NPP instance,
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
uint16 mode, int16 argc,
#else
uint16_t mode, int16_t argc,
#endif
NPuint16_t mode, NPint16_t argc,
char* argn[], char* argv[], NPSavedData* saved )
{
NPError status;
......@@ -553,11 +549,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
}
NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
NPBool seekable, uint16 *stype )
#else
NPBool seekable, uint16_t *stype )
#endif
NPBool seekable, NPuint16_t *stype )
{
if( NULL == instance )
{
......@@ -586,23 +578,14 @@ NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
return NPERR_GENERIC_ERROR;
}
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
int32 NPP_WriteReady( NPP instance, NPStream *stream )
#else
int32_t NPP_WriteReady( NPP instance, NPStream *stream )
#endif
NPint32_t NPP_WriteReady( NPP instance, NPStream *stream )
{
/* TODO */
return 8*1024;
}
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
int32 NPP_Write( NPP instance, NPStream *stream, int32 offset,
int32 len, void *buffer )
#else
int32_t NPP_Write( NPP instance, NPStream *stream, int32_t offset,
int32_t len, void *buffer )
#endif
NPint32_t NPP_Write( NPP instance, NPStream *stream, NPint32_t offset,
NPint32_t len, void *buffer )
{
/* TODO */
return len;
......
......@@ -28,6 +28,8 @@
# include "config.h"
#endif
#include "vlcplugin.h"
NPP_GET_MIME_CONST char * NPP_GetMIMEDescription( void );
NPError NPP_Initialize( void );
......@@ -37,13 +39,9 @@ jref NPP_GetJavaClass( void );
#endif
void NPP_Shutdown( void );
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
char* argn[], char* argv[], NPSavedData* saved );
#else
NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc,
char* argn[], char* argv[], NPSavedData* saved );
#endif
NPError NPP_New( NPMIMEType pluginType, NPP instance, NPuint16_t mode,
NPint16_t argc, char* argn[], char* argv[],
NPSavedData* saved );
NPError NPP_Destroy( NPP instance, NPSavedData** save );
......@@ -53,34 +51,20 @@ NPError NPP_SetValue( NPP instance, NPNVariable variable, void *value );
NPError NPP_SetWindow( NPP instance, NPWindow* window );
NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
NPBool seekable, uint16 *stype );
#else
NPBool seekable, uint16_t *stype );
#endif
NPBool seekable, NPuint16_t *stype );
NPError NPP_DestroyStream( NPP instance, NPStream *stream, NPError reason );
void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname );
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
int32 NPP_WriteReady( NPP instance, NPStream *stream );
int32 NPP_Write( NPP instance, NPStream *stream, int32 offset,
int32 len, void *buffer );
#else
int32_t NPP_WriteReady( NPP instance, NPStream *stream );
int32_t NPP_Write( NPP instance, NPStream *stream, int32_t offset,
int32_t len, void *buffer );
#endif
NPint32_t NPP_WriteReady( NPP instance, NPStream *stream );
NPint32_t NPP_Write( NPP instance, NPStream *stream, NPint32_t offset,
NPint32_t len, void *buffer );
void NPP_URLNotify( NPP instance, const char* url,
NPReason reason, void* notifyData );
void NPP_Print( NPP instance, NPPrint* printInfo );
#ifdef XP_MACOSX
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
int16 NPP_HandleEvent( NPP instance, void * event );
#else
int16_t NPP_HandleEvent( NPP instance, void * event );
#endif
NPint16_t NPP_HandleEvent( NPP instance, void * event );
#endif
static char mimetype[] =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment