зеркало из https://github.com/mozilla/pjs.git
fix uninitialize variable and fix various signed/unsigned warnings
This commit is contained in:
Родитель
bd99bf6b76
Коммит
5310ca898f
|
@ -299,7 +299,7 @@ XPCConvert::NativeData2JS(JSContext* cx, jsval* d, const void* s,
|
|||
else
|
||||
{
|
||||
// we need to build a wrapper
|
||||
nsXPCWrappedNative* wrapper;
|
||||
nsXPCWrappedNative* wrapper=NULL;
|
||||
XPCContext* xpcc;
|
||||
if(!iid || !(xpcc = nsXPConnect::GetContext(cx)) ||
|
||||
!(wrapper = nsXPCWrappedNative::GetNewOrUsedWrapper(xpcc,
|
||||
|
@ -397,7 +397,7 @@ XPCConvert::JSData2Native(JSContext* cx, void* d, jsval s,
|
|||
break;
|
||||
case nsXPTType::T_CHAR :
|
||||
{
|
||||
char* bytes;
|
||||
char* bytes=NULL;
|
||||
JSString* str;
|
||||
|
||||
if(!(str = JS_ValueToString(cx, s))||
|
||||
|
@ -411,7 +411,7 @@ XPCConvert::JSData2Native(JSContext* cx, void* d, jsval s,
|
|||
}
|
||||
case nsXPTType::T_WCHAR :
|
||||
{
|
||||
jschar* chars;
|
||||
jschar* chars=NULL;
|
||||
JSString* str;
|
||||
if(!(str = JS_ValueToString(cx, s))||
|
||||
!(chars = JS_GetStringChars(str)))
|
||||
|
@ -439,7 +439,7 @@ XPCConvert::JSData2Native(JSContext* cx, void* d, jsval s,
|
|||
case nsXPTType::T_IID:
|
||||
{
|
||||
JSObject* obj;
|
||||
const nsID* pid;
|
||||
const nsID* pid=NULL;
|
||||
if(!JSVAL_IS_OBJECT(s) ||
|
||||
(!(obj = JSVAL_TO_OBJECT(s))) ||
|
||||
(!(pid = xpc_JSObjectToID(cx, obj))))
|
||||
|
@ -469,7 +469,7 @@ XPCConvert::JSData2Native(JSContext* cx, void* d, jsval s,
|
|||
|
||||
case nsXPTType::T_CHAR_STR:
|
||||
{
|
||||
char* bytes;
|
||||
char* bytes=NULL;
|
||||
JSString* str;
|
||||
|
||||
if(!(str = JS_ValueToString(cx, s))||
|
||||
|
@ -496,7 +496,7 @@ XPCConvert::JSData2Native(JSContext* cx, void* d, jsval s,
|
|||
|
||||
case nsXPTType::T_WCHAR_STR:
|
||||
{
|
||||
jschar* chars;
|
||||
jschar* chars=NULL;
|
||||
JSString* str;
|
||||
|
||||
if(!(str = JS_ValueToString(cx, s))||
|
||||
|
|
|
@ -107,7 +107,7 @@ static JSClass nsID_class = {
|
|||
JS_STATIC_DLL_CALLBACK(JSBool)
|
||||
nsID_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
IDData* data;
|
||||
IDData* data=NULL;
|
||||
|
||||
if(!JS_InstanceOf(cx, obj, &nsID_class, NULL) ||
|
||||
!(data = (IDData*) JS_GetPrivate(cx, obj)))
|
||||
|
@ -120,8 +120,8 @@ JS_STATIC_DLL_CALLBACK(JSBool)
|
|||
nsID_equals(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
JSObject *obj2;
|
||||
IDData* data1;
|
||||
IDData* data2;
|
||||
IDData* data1=NULL;
|
||||
IDData* data2=NULL;
|
||||
|
||||
if(!JS_InstanceOf(cx, obj, &nsID_class, NULL) ||
|
||||
!argc || !JSVAL_IS_OBJECT(argv[0]) ||
|
||||
|
@ -207,7 +207,7 @@ xpc_NewIDObject(JSContext *cx, const nsID& aID)
|
|||
const nsID*
|
||||
xpc_JSObjectToID(JSContext *cx, JSObject* obj)
|
||||
{
|
||||
IDData* data;
|
||||
IDData* data=NULL;
|
||||
|
||||
if(!cx || !obj ||
|
||||
!JS_InstanceOf(cx, obj, &nsID_class, NULL) ||
|
||||
|
|
|
@ -122,7 +122,7 @@ public:
|
|||
JSBool Init(JSObject* aGlobalObj = NULL);
|
||||
void DebugDump(int depth);
|
||||
|
||||
~XPCContext();
|
||||
virtual ~XPCContext();
|
||||
private:
|
||||
XPCContext(); // no implementation
|
||||
XPCContext(JSContext* aJSContext,
|
||||
|
|
|
@ -266,9 +266,9 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16 methodIndex,
|
|||
jsval argsBuffer[ARGS_BUFFER_COUNT];
|
||||
jsval* argv = NULL;
|
||||
uint8 i;
|
||||
uint8 argc;
|
||||
uint8 argc=0;
|
||||
jsval result;
|
||||
uint8 paramCount;
|
||||
uint8 paramCount=0;
|
||||
nsresult retval = NS_ERROR_FAILURE;
|
||||
JSErrorReporter older;
|
||||
JSBool success;
|
||||
|
|
|
@ -275,7 +275,7 @@ static JSBool
|
|||
isConstructorID(JSContext *cx, jsid id)
|
||||
{
|
||||
jsval idval;
|
||||
const char *property_name;
|
||||
const char *property_name=NULL;
|
||||
// XXX this could be improved by cacheing the hashed id for "constructor"
|
||||
if (JS_IdToValue(cx, id, &idval) && JSVAL_IS_STRING(idval) &&
|
||||
(property_name = JS_GetStringBytes(JSVAL_TO_STRING(idval))) != NULL) {
|
||||
|
|
|
@ -77,7 +77,7 @@ class InterfaceInfoManagerImpl : public nsIInterfaceInfoManager
|
|||
|
||||
public:
|
||||
InterfaceInfoManagerImpl();
|
||||
~InterfaceInfoManagerImpl();
|
||||
virtual ~InterfaceInfoManagerImpl();
|
||||
|
||||
static InterfaceInfoManagerImpl* GetInterfaceInfoManager();
|
||||
static nsIAllocator* GetAllocator(InterfaceInfoManagerImpl* iim = NULL);
|
||||
|
@ -371,7 +371,7 @@ InterfaceInfoManagerImpl::BuildInterfaceForEntry(uint16 i)
|
|||
NS_IMETHODIMP
|
||||
InterfaceInfoManagerImpl::GetInfoForIID(const nsIID* iid, nsIInterfaceInfo** info)
|
||||
{
|
||||
for(int i = 0; i < ENTRY_COUNT;i++)
|
||||
for(unsigned int i = 0; i < ENTRY_COUNT;i++)
|
||||
{
|
||||
XPTInterfaceDirectoryEntry* entry = &InterfaceDirectoryEntryTable[i];
|
||||
if(iid->Equals(entry->iid))
|
||||
|
@ -390,7 +390,7 @@ InterfaceInfoManagerImpl::GetInfoForIID(const nsIID* iid, nsIInterfaceInfo** inf
|
|||
NS_IMETHODIMP
|
||||
InterfaceInfoManagerImpl::GetInfoForName(const char* name, nsIInterfaceInfo** info)
|
||||
{
|
||||
for(int i = 0; i < ENTRY_COUNT;i++)
|
||||
for(unsigned int i = 0; i < ENTRY_COUNT;i++)
|
||||
{
|
||||
XPTInterfaceDirectoryEntry* entry = &InterfaceDirectoryEntryTable[i];
|
||||
if(!strcmp(name, entry->name))
|
||||
|
@ -409,7 +409,7 @@ InterfaceInfoManagerImpl::GetInfoForName(const char* name, nsIInterfaceInfo** in
|
|||
NS_IMETHODIMP
|
||||
InterfaceInfoManagerImpl::GetIIDForName(const char* name, nsIID** iid)
|
||||
{
|
||||
for(int i = 0; i < ENTRY_COUNT;i++)
|
||||
for(unsigned int i = 0; i < ENTRY_COUNT;i++)
|
||||
{
|
||||
XPTInterfaceDirectoryEntry* entry = &InterfaceDirectoryEntryTable[i];
|
||||
if(!strcmp(name, entry->name))
|
||||
|
@ -429,7 +429,7 @@ InterfaceInfoManagerImpl::GetIIDForName(const char* name, nsIID** iid)
|
|||
NS_IMETHODIMP
|
||||
InterfaceInfoManagerImpl::GetNameForIID(const nsIID* iid, char** name)
|
||||
{
|
||||
for(int i = 0; i < ENTRY_COUNT;i++)
|
||||
for(unsigned int i = 0; i < ENTRY_COUNT;i++)
|
||||
{
|
||||
XPTInterfaceDirectoryEntry* entry = &InterfaceDirectoryEntryTable[i];
|
||||
if(iid->Equals(entry->iid))
|
||||
|
|
Загрузка…
Ссылка в новой задаче