A bunch of plugin SDK build fixes. b=471759 r=josh sr=jst

This commit is contained in:
Walter Meinl 2009-01-13 12:14:40 -05:00
Родитель 470ccb709b
Коммит 898d498f1d
4 изменённых файлов: 47 добавлений и 47 удалений

Просмотреть файл

@ -80,7 +80,7 @@ NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void
NPError rv = NPERR_NO_ERROR; NPError rv = NPERR_NO_ERROR;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
rv = CallNPN_GetURLNotifyProc(NPNFuncs.geturlnotify, instance, url, target, notifyData); rv = (*NPNFuncs.geturlnotify) (instance, url, target, notifyData);
else else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR; rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
@ -89,32 +89,32 @@ NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void
NPError NPN_GetURL(NPP instance, const char *url, const char *target) NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{ {
NPError rv = CallNPN_GetURLProc(NPNFuncs.geturl, instance, url, target); NPError rv = (*NPNFuncs.geturl) (instance, url, target);
return rv; return rv;
} }
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData) NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData)
{ {
int navMinorVers = NPNFuncs.version & 0xFF; int navMinorVers = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR; NPError rv = NPERR_NO_ERROR;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
rv = CallNPN_PostURLNotifyProc(NPNFuncs.posturlnotify, instance, url, window, len, buf, file, notifyData); rv = (*NPNFuncs.posturlnotify) (instance, url, window, len, buf, file, notifyData);
else else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR; rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv; return rv;
} }
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file) NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file)
{ {
NPError rv = CallNPN_PostURLProc(NPNFuncs.posturl, instance, url, window, len, buf, file); NPError rv = (*NPNFuncs.posturl) (instance, url, window, len, buf, file);
return rv; return rv;
} }
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
{ {
NPError rv = CallNPN_RequestReadProc(NPNFuncs.requestread, stream, rangeList); NPError rv = (*NPNFuncs.requestread) (stream, rangeList);
return rv; return rv;
} }
@ -125,20 +125,20 @@ NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStrea
NPError rv = NPERR_NO_ERROR; NPError rv = NPERR_NO_ERROR;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = CallNPN_NewStreamProc(NPNFuncs.newstream, instance, type, target, stream); rv = (*NPNFuncs.newstream) (instance, type, target, stream);
else else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR; rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv; return rv;
} }
int32 NPN_Write(NPP instance, NPStream *stream, int32 len, void *buffer) int32_t NPN_Write(NPP instance, NPStream *stream, int32_t len, void *buffer)
{ {
int navMinorVersion = NPNFuncs.version & 0xFF; int navMinorVersion = NPNFuncs.version & 0xFF;
int32 rv = 0; int32_t rv = 0;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = CallNPN_WriteProc(NPNFuncs.write, instance, stream, len, buffer); rv = (*NPNFuncs.write) (instance, stream, len, buffer);
else else
rv = -1; rv = -1;
@ -151,7 +151,7 @@ NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
NPError rv = NPERR_NO_ERROR; NPError rv = NPERR_NO_ERROR;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT )
rv = CallNPN_DestroyStreamProc(NPNFuncs.destroystream, instance, stream, reason); rv = (*NPNFuncs.destroystream) (instance, stream, reason);
else else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR; rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
@ -160,62 +160,62 @@ NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
void NPN_Status(NPP instance, const char *message) void NPN_Status(NPP instance, const char *message)
{ {
CallNPN_StatusProc(NPNFuncs.status, instance, message); (*NPNFuncs.status) (instance, message);
} }
const char* NPN_UserAgent(NPP instance) const char* NPN_UserAgent(NPP instance)
{ {
const char * rv = NULL; const char * rv = NULL;
rv = CallNPN_UserAgentProc(NPNFuncs.uagent, instance); rv = (*NPNFuncs.uagent) (instance);
return rv; return rv;
} }
void* NPN_MemAlloc(uint32 size) void* NPN_MemAlloc(uint32_t size)
{ {
void * rv = NULL; void * rv = NULL;
rv = CallNPN_MemAllocProc(NPNFuncs.memalloc, size); rv = (*NPNFuncs.memalloc) (size);
return rv; return rv;
} }
void NPN_MemFree(void* ptr) void NPN_MemFree(void* ptr)
{ {
CallNPN_MemFreeProc(NPNFuncs.memfree, ptr); (*NPNFuncs.memfree) (ptr);
} }
uint32 NPN_MemFlush(uint32 size) uint32_t NPN_MemFlush(uint32_t size)
{ {
uint32 rv = CallNPN_MemFlushProc(NPNFuncs.memflush, size); uint32_t rv = (*NPNFuncs.memflush) (size);
return rv; return rv;
} }
void NPN_ReloadPlugins(NPBool reloadPages) void NPN_ReloadPlugins(NPBool reloadPages)
{ {
CallNPN_ReloadPluginsProc(NPNFuncs.reloadplugins, reloadPages); (*NPNFuncs.reloadplugins) (reloadPages);
} }
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value) NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{ {
NPError rv = CallNPN_GetValueProc(NPNFuncs.getvalue, instance, variable, value); NPError rv = (*NPNFuncs.getvalue) (instance, variable, value);
return rv; return rv;
} }
NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value) NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
{ {
NPError rv = CallNPN_SetValueProc(NPNFuncs.setvalue, instance, variable, value); NPError rv = (*NPNFuncs.setvalue) (instance, variable, value);
return rv; return rv;
} }
void NPN_InvalidateRect(NPP instance, NPRect *invalidRect) void NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
{ {
CallNPN_InvalidateRectProc(NPNFuncs.invalidaterect, instance, invalidRect); (*NPNFuncs.invalidaterect) (instance, invalidRect);
} }
void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
{ {
CallNPN_InvalidateRegionProc(NPNFuncs.invalidateregion, instance, invalidRegion); (*NPNFuncs.invalidateregion) (instance, invalidRegion);
} }
void NPN_ForceRedraw(NPP instance) void NPN_ForceRedraw(NPP instance)
{ {
CallNPN_ForceRedrawProc(NPNFuncs.forceredraw, instance); (*NPNFuncs.forceredraw) (instance);
} }

Просмотреть файл

@ -50,7 +50,7 @@ static char szTarget[] = LOGGER_DEFAULT_TARGET;
// here the plugin creates a plugin instance object which // here the plugin creates a plugin instance object which
// will be associated with this newly created NPP instance and // will be associated with this newly created NPP instance and
// will do all the necessary job // will do all the necessary job
NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved) NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
{ {
DWORD dwTickEnter = XP_GetTickCount(); DWORD dwTickEnter = XP_GetTickCount();
NPError ret = NPERR_NO_ERROR; NPError ret = NPERR_NO_ERROR;
@ -203,7 +203,7 @@ Return:
return ret; return ret;
} }
NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype) NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype)
{ {
DWORD dwTickEnter = XP_GetTickCount(); DWORD dwTickEnter = XP_GetTickCount();
CPluginBase * pPlugin = NULL; CPluginBase * pPlugin = NULL;
@ -227,11 +227,11 @@ Return:
return ret; return ret;
} }
int32 NPP_WriteReady (NPP instance, NPStream *stream) int32_t NPP_WriteReady (NPP instance, NPStream *stream)
{ {
DWORD dwTickEnter = XP_GetTickCount(); DWORD dwTickEnter = XP_GetTickCount();
CPluginBase * pPlugin = NULL; CPluginBase * pPlugin = NULL;
int32 ret = 0x0FFFFFFF; int32_t ret = 0x0FFFFFFF;
if(!instance) { if(!instance) {
ret = 0L; ret = 0L;
@ -247,11 +247,11 @@ Return:
return ret; return ret;
} }
int32 NPP_Write (NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer) int32_t NPP_Write (NPP instance, NPStream *stream, int32_t offset, int32_t len, void *buffer)
{ {
DWORD dwTickEnter = XP_GetTickCount(); DWORD dwTickEnter = XP_GetTickCount();
CPluginBase * pPlugin = NULL; CPluginBase * pPlugin = NULL;
int32 ret = len; int32_t ret = len;
if(!instance) if(!instance)
goto Return; goto Return;
@ -400,11 +400,11 @@ Return:
return ret; return ret;
} }
int16 NPP_HandleEvent(NPP instance, void* event) int16_t NPP_HandleEvent(NPP instance, void* event)
{ {
DWORD dwTickEnter = XP_GetTickCount(); DWORD dwTickEnter = XP_GetTickCount();
CPluginBase * pPlugin = NULL; CPluginBase * pPlugin = NULL;
int16 ret = (int16)TRUE; int16_t ret = (int16_t)TRUE;
if(!instance) if(!instance)
goto Return; goto Return;
@ -428,7 +428,7 @@ Return:
#ifdef XP_MAC #ifdef XP_MAC
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved) NPError Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
{ {
EnterCodeResource(); EnterCodeResource();
NPError rv = NPP_New(pluginType, instance, mode, argc, argn, argv, saved); NPError rv = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
@ -452,7 +452,7 @@ NPError Private_SetWindow(NPP instance, NPWindow* window)
return rv; return rv;
} }
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype) NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype)
{ {
EnterCodeResource(); EnterCodeResource();
NPError rv = NPP_NewStream(instance, type, stream, seekable, stype); NPError rv = NPP_NewStream(instance, type, stream, seekable, stype);
@ -460,18 +460,18 @@ NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBoo
return rv; return rv;
} }
int32 Private_WriteReady(NPP instance, NPStream* stream) int32_t Private_WriteReady(NPP instance, NPStream* stream)
{ {
EnterCodeResource(); EnterCodeResource();
int32 rv = NPP_WriteReady(instance, stream); int32_t rv = NPP_WriteReady(instance, stream);
ExitCodeResource(); ExitCodeResource();
return rv; return rv;
} }
int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer) int32_t Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer)
{ {
EnterCodeResource(); EnterCodeResource();
int32 rv = NPP_Write(instance, stream, offset, len, buffer); int32_t rv = NPP_Write(instance, stream, offset, len, buffer);
ExitCodeResource(); ExitCodeResource();
return rv; return rv;
} }
@ -492,10 +492,10 @@ NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
return rv; return rv;
} }
int16 Private_HandleEvent(NPP instance, void* event) int16_t Private_HandleEvent(NPP instance, void* event)
{ {
EnterCodeResource(); EnterCodeResource();
int16 rv = NPP_HandleEvent(instance, event); int16_t rv = NPP_HandleEvent(instance, event);
ExitCodeResource(); ExitCodeResource();
return rv; return rv;
} }

Просмотреть файл

@ -41,7 +41,7 @@
#include "plugbase.h" #include "plugbase.h"
#include "action.h" #include "action.h"
#include "log.h" #include "log.h"
#include "logFile.h" #include "logfile.h"
class CLogger class CLogger
{ {

Просмотреть файл

@ -50,7 +50,7 @@
#include <stdio.h> #include <stdio.h>
#include "npapi.h" #include "npapi.h"
#include "npupp.h" #include "npfunctions.h"
#define XP_HFILE HFILE #define XP_HFILE HFILE
@ -75,7 +75,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include "npapi.h" #include "npapi.h"
#include "npupp.h" #include "npfunctions.h"
#define XP_HFILE FILE* #define XP_HFILE FILE*
@ -97,7 +97,7 @@
#include <ctype.h> /* isprint() */ #include <ctype.h> /* isprint() */
#include "npapi.h" #include "npapi.h"
#include "npupp.h" #include "npfunctions.h"
#define XP_HFILE FILE* #define XP_HFILE FILE*
@ -129,7 +129,7 @@
#include "npapi.h" #include "npapi.h"
// The Mixed Mode procInfos defined in npupp.h assume Think C- // The Mixed Mode procInfos defined in npfunctions.h assume Think C-
// style calling conventions. These conventions are used by // style calling conventions. These conventions are used by
// Metrowerks with the exception of pointer return types, which // Metrowerks with the exception of pointer return types, which
// in Metrowerks 68K are returned in A0, instead of the standard // in Metrowerks 68K are returned in A0, instead of the standard
@ -144,7 +144,7 @@
#endif #endif
#endif #endif
#include "npupp.h" #include "npfunctions.h"
#ifdef __MWERKS__ #ifdef __MWERKS__
#ifndef powerc #ifndef powerc