зеркало из https://github.com/mozilla/gecko-dev.git
Warning suppression, plus getting date files into mac build
This commit is contained in:
Родитель
97ca0a7b85
Коммит
d8870e67af
|
@ -219,7 +219,7 @@ void JSObject::defineTempVariable(Context *cx, Reference *&readRef, Reference *&
|
|||
char buf[32];
|
||||
sprintf(buf, "%%tempvar%%_%d", tempVarCount++);
|
||||
const String &name = cx->mWorld.identifiers[buf];
|
||||
/* Property *prop = */defineVariable(cx, name, (NamespaceList *)NULL, Object_Type);
|
||||
/* Property *prop = */defineVariable(cx, name, (NamespaceList *)NULL, type);
|
||||
readRef = new NameReference(name, Read, Object_Type, 0);
|
||||
writeRef = new NameReference(name, Write, Object_Type, 0);
|
||||
}
|
||||
|
@ -1669,7 +1669,7 @@ static JSValue Object_forin(Context *cx, const JSValue& thisValue, JSValue * /*a
|
|||
return JSValue(iteratorObject);
|
||||
}
|
||||
|
||||
static JSValue Object_next(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 /*argc*/)
|
||||
static JSValue Object_next(Context *cx, const JSValue& /*thisValue*/, JSValue *argv, uint32 /*argc*/)
|
||||
{
|
||||
JSValue iteratorValue = argv[0];
|
||||
ASSERT(iteratorValue.isObject());
|
||||
|
@ -1688,7 +1688,7 @@ static JSValue Object_next(Context *cx, const JSValue& thisValue, JSValue *argv,
|
|||
|
||||
}
|
||||
|
||||
static JSValue Object_done(Context *, const JSValue& thisValue, JSValue * /*argv*/, uint32 /*argc*/)
|
||||
static JSValue Object_done(Context *, const JSValue& /*thisValue*/, JSValue * /*argv*/, uint32 /*argc*/)
|
||||
{
|
||||
return kUndefinedValue;
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ static const double two31 = 2147483648.0;
|
|||
type_tag,
|
||||
boolean_tag,
|
||||
string_tag,
|
||||
null_tag,
|
||||
null_tag
|
||||
} Tag;
|
||||
Tag tag;
|
||||
|
||||
|
@ -740,10 +740,9 @@ XXX ...couldn't get this to work...
|
|||
return mUnaryOperators[which]; // XXX Umm, aren't these also getting inherited?
|
||||
}
|
||||
|
||||
void setDefaultConstructor(Context *cx, JSFunction *f)
|
||||
void setDefaultConstructor(Context * /*cx*/, JSFunction *f)
|
||||
{
|
||||
mDefaultConstructor = f;
|
||||
// defineConstructor(cx, *mClassName, NULL, f); // XXX attr?
|
||||
}
|
||||
|
||||
void addMethod(Context *cx, const String &name, AttributeStmtNode *attr, JSFunction *f);
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "parser.h"
|
||||
#include "numerics.h"
|
||||
|
@ -434,11 +435,11 @@ static float64 date_parseString(const String &s)
|
|||
int min = -1;
|
||||
int sec = -1;
|
||||
int c = -1;
|
||||
int i = 0;
|
||||
uint32 i = 0;
|
||||
int n = -1;
|
||||
float64 tzoffset = -1; /* was an int, overflowed on win16!!! */
|
||||
int prevc = 0;
|
||||
int limit = 0;
|
||||
uint32 limit = 0;
|
||||
bool seenplusminus = false;
|
||||
|
||||
limit = s.length();
|
||||
|
@ -536,7 +537,7 @@ static float64 date_parseString(const String &s)
|
|||
} else if (c == '/' || c == ':' || c == '+' || c == '-') {
|
||||
prevc = c;
|
||||
} else {
|
||||
int st = i - 1;
|
||||
uint32 st = i - 1;
|
||||
int k;
|
||||
while (i < limit) {
|
||||
c = s[i];
|
||||
|
@ -709,7 +710,7 @@ static const char* months[] =
|
|||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
static JSValue Date_toGMTString(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_toGMTString(Context *cx, const JSValue& thisValue, JSValue * /*argv*/, uint32 /*argc*/)
|
||||
{
|
||||
StringFormatter buf;
|
||||
float64 *date = Date_getProlog(cx, thisValue);
|
||||
|
@ -763,15 +764,15 @@ static void new_explode(float64 timeval, PRMJTime *split, bool findEquivalent)
|
|||
adjustedYear = (int16)year;
|
||||
}
|
||||
|
||||
split->tm_usec = (int32) msFromTime(timeval) * 1000;
|
||||
split->tm_sec = (int8) SecFromTime(timeval);
|
||||
split->tm_min = (int8) MinFromTime(timeval);
|
||||
split->tm_hour = (int8) HourFromTime(timeval);
|
||||
split->tm_mday = (int8) DateFromTime(timeval);
|
||||
split->tm_mon = (int8) MonthFromTime(timeval);
|
||||
split->tm_wday = (int8) WeekDay(timeval);
|
||||
split->tm_year = (int16) adjustedYear;
|
||||
split->tm_yday = (int16) DayWithinYear(timeval, year);
|
||||
split->tm_usec = (uint32) msFromTime(timeval) * 1000;
|
||||
split->tm_sec = (uint8) SecFromTime(timeval);
|
||||
split->tm_min = (uint8) MinFromTime(timeval);
|
||||
split->tm_hour = (uint8) HourFromTime(timeval);
|
||||
split->tm_mday = (uint8) DateFromTime(timeval);
|
||||
split->tm_mon = (uint8) MonthFromTime(timeval);
|
||||
split->tm_wday = (uint8) WeekDay(timeval);
|
||||
split->tm_year = (uint16) adjustedYear;
|
||||
split->tm_yday = (uint16) DayWithinYear(timeval, year);
|
||||
|
||||
/* not sure how this affects things, but it doesn't seem
|
||||
to matter. */
|
||||
|
@ -784,7 +785,7 @@ typedef enum formatspec {
|
|||
|
||||
|
||||
/* helper function */
|
||||
static JSValue Date_format(Context *cx, float64 date, formatspec format)
|
||||
static JSValue Date_format(Context * /*cx*/, float64 date, formatspec format)
|
||||
{
|
||||
StringFormatter outf;
|
||||
char tzbuf[100];
|
||||
|
@ -886,7 +887,7 @@ static JSValue Date_format(Context *cx, float64 date, formatspec format)
|
|||
return JSValue(new String(outf.getString()));
|
||||
}
|
||||
|
||||
static JSValue Date_toLocaleHelper(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc, char *format)
|
||||
static JSValue Date_toLocaleHelper(Context *cx, const JSValue& thisValue, JSValue * /*argv*/, uint32 /*argc*/, char *format)
|
||||
{
|
||||
StringFormatter outf;
|
||||
char buf[100];
|
||||
|
@ -897,7 +898,7 @@ static JSValue Date_toLocaleHelper(Context *cx, const JSValue& thisValue, JSValu
|
|||
if (!JSDOUBLE_IS_FINITE(*date)) {
|
||||
outf << js_NaN_date_str;
|
||||
} else {
|
||||
int32 result_len;
|
||||
uint32 result_len;
|
||||
float64 local = LocalTime(*date);
|
||||
new_explode(local, &split, false);
|
||||
|
||||
|
@ -1169,7 +1170,7 @@ static JSValue Date_getUTCMilliseconds(Context *cx, const JSValue& thisValue, JS
|
|||
}
|
||||
|
||||
|
||||
static JSValue Date_setTime(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setTime(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 /*argc*/)
|
||||
{
|
||||
float64 *date = Date_getProlog(cx, thisValue);
|
||||
float64 result = argv[0].toNumber(cx).f64;
|
||||
|
@ -1177,7 +1178,7 @@ static JSValue Date_setTime(Context *cx, const JSValue& thisValue, JSValue *argv
|
|||
return JSValue(*date);
|
||||
}
|
||||
|
||||
static JSValue Date_setYear(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setYear(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 /*argc*/)
|
||||
{
|
||||
float64 t;
|
||||
float64 year;
|
||||
|
@ -1211,79 +1212,79 @@ static JSValue Date_setYear(Context *cx, const JSValue& thisValue, JSValue *argv
|
|||
return JSValue(*date);
|
||||
}
|
||||
|
||||
JSValue Date_setFullYear(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setFullYear(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 3, true);
|
||||
}
|
||||
|
||||
JSValue Date_setUTCFullYear(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setUTCFullYear(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 3, false);
|
||||
}
|
||||
|
||||
JSValue Date_setMonth(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setMonth(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 2, true);
|
||||
}
|
||||
|
||||
JSValue Date_setUTCMonth(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setUTCMonth(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 2, false);
|
||||
}
|
||||
|
||||
JSValue Date_setDate(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setDate(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 1, true);
|
||||
}
|
||||
|
||||
JSValue Date_setUTCDate(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setUTCDate(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 1, false);
|
||||
}
|
||||
|
||||
JSValue Date_setHours(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setHours(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 4, true);
|
||||
}
|
||||
|
||||
JSValue Date_setUTCHours(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setUTCHours(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 4, false);
|
||||
}
|
||||
|
||||
JSValue Date_setMinutes(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setMinutes(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 3, true);
|
||||
}
|
||||
|
||||
JSValue Date_setUTCMinutes(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setUTCMinutes(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 3, false);
|
||||
}
|
||||
|
||||
JSValue Date_setSeconds(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setSeconds(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 2, true);
|
||||
}
|
||||
|
||||
JSValue Date_setUTCSeconds(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setUTCSeconds(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 2, true);
|
||||
}
|
||||
|
||||
JSValue Date_setMilliseconds(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setMilliseconds(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 1, true);
|
||||
}
|
||||
|
||||
JSValue Date_setUTCMilliseconds(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_setUTCMilliseconds(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
return Date_makeTime(cx, thisValue, argv, argc, 1, true);
|
||||
}
|
||||
|
||||
// SpiderMonkey has a 'hinted' version:
|
||||
#if JS_HAS_VALUEOF_HINT
|
||||
JSValue Date_valueOf(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
static JSValue Date_valueOf(Context *cx, const JSValue& thisValue, JSValue *argv, uint32 argc)
|
||||
{
|
||||
/* If called directly with no arguments, convert to a time number. */
|
||||
if (argc == 0)
|
||||
|
|
|
@ -56,9 +56,9 @@ static int64 ll_zero = JSLL_INIT( 0x00000000,0x00000000 );
|
|||
static int64 ll_maxint = JSLL_INIT( 0x7fffffff, 0xffffffff );
|
||||
static int64 ll_minint = JSLL_INIT( 0x80000000, 0x00000000 );
|
||||
|
||||
int64 JSLL_Zero(void) { return ll_zero; }
|
||||
int64 JSLL_MaxInt(void) { return ll_maxint; }
|
||||
int64 JSLL_MinInt(void) { return ll_minint; }
|
||||
static int64 JSLL_Zero(void) { return ll_zero; }
|
||||
static int64 JSLL_MaxInt(void) { return ll_maxint; }
|
||||
static int64 JSLL_MinInt(void) { return ll_minint; }
|
||||
//
|
||||
//
|
||||
|
||||
|
@ -151,12 +151,12 @@ static void MacintoshInitializeTime(void)
|
|||
static void MyReadLocation(MachineLocation * loc)
|
||||
{
|
||||
static MachineLocation storedLoc; /* InsideMac, OSUtilities, page 4-20 */
|
||||
static JSBool didReadLocation = JS_FALSE;
|
||||
static bool didReadLocation = false;
|
||||
if (!didReadLocation)
|
||||
{
|
||||
MacintoshInitializeTime();
|
||||
ReadLocation(&storedLoc);
|
||||
didReadLocation = JS_TRUE;
|
||||
didReadLocation = true;
|
||||
}
|
||||
*loc = storedLoc;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче