mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 726230: remove obsolete typedefs JSIntn, JSUIntn, r=luke
--HG-- extra : rebase_source : f7f84755fe86f10109cd7332583212b1aa1e719d
This commit is contained in:
parent
c8c68369b3
commit
6b38b9109e
@ -55,8 +55,8 @@ union JSVariant {
|
||||
nsString;
|
||||
int;
|
||||
double;
|
||||
bool; // We'd like to use JSBool here, but JSBool is really JSIntn,
|
||||
// and IPC::ParamTraits mistakes JSIntn for int.
|
||||
bool; // We'd like to use JSBool here, but IPC::ParamTraits would
|
||||
// treat JSBool as int.
|
||||
};
|
||||
|
||||
union OperationStatus {
|
||||
|
@ -46,6 +46,6 @@
|
||||
*/
|
||||
#include "jstypes.h"
|
||||
|
||||
typedef JSIntn intN;
|
||||
typedef JSUintn uintN;
|
||||
typedef int intN;
|
||||
typedef unsigned uintN;
|
||||
#endif /* jscompat_h___ */
|
||||
|
@ -580,7 +580,7 @@ static struct NumArgState* BuildArgArray( const char *fmt, va_list ap, int* rv,
|
||||
nas[ cn ].type = TYPE_UINT32;
|
||||
} else if (sizeof(void *) == sizeof(int64_t)) {
|
||||
nas[ cn ].type = TYPE_UINT64;
|
||||
} else if (sizeof(void *) == sizeof(JSIntn)) {
|
||||
} else if (sizeof(void *) == sizeof(int)) {
|
||||
nas[ cn ].type = TYPE_UINTN;
|
||||
} else {
|
||||
nas[ cn ].type = TYPE_UNKNOWN;
|
||||
@ -642,7 +642,7 @@ static struct NumArgState* BuildArgArray( const char *fmt, va_list ap, int* rv,
|
||||
case TYPE_INT16:
|
||||
case TYPE_UINT16:
|
||||
case TYPE_INTN:
|
||||
case TYPE_UINTN: (void)va_arg( ap, JSIntn ); break;
|
||||
case TYPE_UINTN: (void)va_arg( ap, int ); break;
|
||||
|
||||
case TYPE_INT32: (void)va_arg( ap, int32_t ); break;
|
||||
|
||||
@ -656,7 +656,7 @@ static struct NumArgState* BuildArgArray( const char *fmt, va_list ap, int* rv,
|
||||
|
||||
case TYPE_WSTRING: (void)va_arg( ap, jschar* ); break;
|
||||
|
||||
case TYPE_INTSTR: (void)va_arg( ap, JSIntn* ); break;
|
||||
case TYPE_INTSTR: (void)va_arg( ap, int* ); break;
|
||||
|
||||
case TYPE_DOUBLE: (void)va_arg( ap, double ); break;
|
||||
|
||||
|
@ -98,7 +98,7 @@ extern JS_PUBLIC_API(char*) JS_sprintf_append(char *last, const char *fmt, ...);
|
||||
** data. The return value is a count of the number of characters fed to
|
||||
** the stuff function, or (uint32_t)-1 if an error occurs.
|
||||
*/
|
||||
typedef JSIntn (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);
|
||||
typedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);
|
||||
|
||||
extern JS_PUBLIC_API(uint32_t) JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...);
|
||||
|
||||
|
@ -219,19 +219,6 @@
|
||||
|
||||
JS_BEGIN_EXTERN_C
|
||||
|
||||
/************************************************************************
|
||||
** TYPES: JSUintn
|
||||
** JSIntn
|
||||
** DESCRIPTION:
|
||||
** The JSIntn types are most appropriate for automatic variables. They are
|
||||
** guaranteed to be at least 16 bits, though various architectures may
|
||||
** define them to be wider (e.g., 32 or even 64 bits). These types are
|
||||
** never valid for fields of a structure.
|
||||
************************************************************************/
|
||||
|
||||
typedef int JSIntn;
|
||||
typedef unsigned int JSUintn;
|
||||
|
||||
/************************************************************************
|
||||
** TYPES: JSBool
|
||||
** DESCRIPTION:
|
||||
@ -240,9 +227,9 @@ typedef unsigned int JSUintn;
|
||||
** 'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans
|
||||
** just as you would C int-valued conditions.
|
||||
************************************************************************/
|
||||
typedef JSIntn JSBool;
|
||||
#define JS_TRUE (JSIntn)1
|
||||
#define JS_FALSE (JSIntn)0
|
||||
typedef int JSBool;
|
||||
#define JS_TRUE (int)1
|
||||
#define JS_FALSE (int)0
|
||||
|
||||
/************************************************************************
|
||||
** TYPES: JSPackedBool
|
||||
|
@ -69,13 +69,42 @@ JS_PUBLIC_DATA(uint32_t) OOM_counter = 0;
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(void *) == sizeof(void (*)()));
|
||||
|
||||
/*
|
||||
* |JS_Assert| historically took |JSIntn ln| as its last argument. We've
|
||||
* boiled |JSIntn ln| down to simply |int ln| so that mfbt may declare the
|
||||
* function without depending on the |JSIntn| typedef, so we must manually
|
||||
* verify that the |JSIntn| typedef is consistent.
|
||||
*/
|
||||
JS_STATIC_ASSERT((tl::IsSameType<JSIntn, int>::result));
|
||||
static JS_NEVER_INLINE void
|
||||
CrashInJS()
|
||||
{
|
||||
/*
|
||||
* We write 123 here so that the machine code for this function is
|
||||
* unique. Otherwise the linker, trying to be smart, might use the
|
||||
* same code for CrashInJS and for some other function. That
|
||||
* messes up the signature in minidumps.
|
||||
*/
|
||||
|
||||
#if defined(WIN32)
|
||||
/*
|
||||
* We used to call DebugBreak() on Windows, but amazingly, it causes
|
||||
* the MSVS 2010 debugger not to be able to recover a call stack.
|
||||
*/
|
||||
*((volatile int *) NULL) = 123;
|
||||
exit(3);
|
||||
#elif defined(__APPLE__)
|
||||
/*
|
||||
* On Mac OS X, Breakpad ignores signals. Only real Mach exceptions are
|
||||
* trapped.
|
||||
*/
|
||||
*((volatile int *) NULL) = 123; /* To continue from here in GDB: "return" then "continue". */
|
||||
raise(SIGABRT); /* In case above statement gets nixed by the optimizer. */
|
||||
#else
|
||||
raise(SIGABRT); /* To continue from here in GDB: "signal 0". */
|
||||
#endif
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_Assert(const char *s, const char *file, int ln)
|
||||
{
|
||||
fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
|
||||
fflush(stderr);
|
||||
CrashInJS();
|
||||
}
|
||||
|
||||
#ifdef JS_BASIC_STATS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user