Bug 902332 - Replace JS_{FALSE,TRUE} with {false,true} almost everywhere. r=luke,bz.
This commit is contained in:
@@ -569,7 +569,7 @@ static JSBool
|
||||
date_regionMatches(const char* s1, int s1off, const jschar* s2, int s2off,
|
||||
int count, int ignoreCase)
|
||||
{
|
||||
JSBool result = JS_FALSE;
|
||||
JSBool result = false;
|
||||
/* return true if matches, otherwise, false */
|
||||
|
||||
while (count > 0 && s1[s1off] && s2[s2off]) {
|
||||
@@ -587,7 +587,7 @@ date_regionMatches(const char* s1, int s1off, const jschar* s2, int s2off,
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
result = JS_TRUE;
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -615,11 +615,11 @@ date_msecFromArgs(JSContext *cx, CallArgs args, double *rval)
|
||||
if (loop < args.length()) {
|
||||
double d;
|
||||
if (!ToNumber(cx, args[loop], &d))
|
||||
return JS_FALSE;
|
||||
return false;
|
||||
/* return NaN if any arg is not finite */
|
||||
if (!IsFinite(d)) {
|
||||
*rval = js_NaN;
|
||||
return JS_TRUE;
|
||||
return true;
|
||||
}
|
||||
array[loop] = ToInteger(d);
|
||||
} else {
|
||||
@@ -638,7 +638,7 @@ date_msecFromArgs(JSContext *cx, CallArgs args, double *rval)
|
||||
msec_time = date_msecFromDate(array[0], array[1], array[2],
|
||||
array[3], array[4], array[5], array[6]);
|
||||
*rval = msec_time;
|
||||
return JS_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -719,7 +719,7 @@ ndigits(size_t n, size_t *result, const jschar *s, size_t* i, size_t limit)
|
||||
return ((*i - init) == n);
|
||||
|
||||
*i = init;
|
||||
return JS_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -803,7 +803,7 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo)
|
||||
size_t min = 0;
|
||||
size_t sec = 0;
|
||||
double frac = 0;
|
||||
bool isLocalTime = JS_FALSE;
|
||||
bool isLocalTime = false;
|
||||
size_t tzHour = 0;
|
||||
size_t tzMin = 0;
|
||||
|
||||
@@ -876,7 +876,7 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo)
|
||||
++i;
|
||||
NEED_NDIGITS(2, tzMin);
|
||||
} else {
|
||||
isLocalTime = JS_TRUE;
|
||||
isLocalTime = true;
|
||||
}
|
||||
|
||||
done:
|
||||
@@ -912,12 +912,12 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo)
|
||||
|
||||
*result = msec;
|
||||
|
||||
return JS_TRUE;
|
||||
return true;
|
||||
|
||||
syntax:
|
||||
/* syntax error */
|
||||
*result = 0;
|
||||
return JS_FALSE;
|
||||
return false;
|
||||
|
||||
#undef PEEK
|
||||
#undef NEED
|
||||
@@ -943,12 +943,12 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo)
|
||||
int n = -1;
|
||||
int tzoffset = -1;
|
||||
int prevc = 0;
|
||||
JSBool seenplusminus = JS_FALSE;
|
||||
JSBool seenplusminus = false;
|
||||
int temp;
|
||||
JSBool seenmonthname = JS_FALSE;
|
||||
JSBool seenmonthname = false;
|
||||
|
||||
if (date_parseISOString(str, result, dtInfo))
|
||||
return JS_TRUE;
|
||||
return true;
|
||||
|
||||
s = str->chars();
|
||||
limit = str->length();
|
||||
@@ -992,7 +992,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo)
|
||||
|
||||
if ((prevc == '+' || prevc == '-')/* && year>=0 */) {
|
||||
/* make ':' case below change tzoffset */
|
||||
seenplusminus = JS_TRUE;
|
||||
seenplusminus = true;
|
||||
|
||||
/* offset */
|
||||
if (n < 24)
|
||||
@@ -1084,7 +1084,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo)
|
||||
if (seenmonthname) {
|
||||
goto syntax;
|
||||
}
|
||||
seenmonthname = JS_TRUE;
|
||||
seenmonthname = true;
|
||||
temp = /*byte*/ (action - 2) + 1;
|
||||
|
||||
if (mon < 0) {
|
||||
@@ -1189,12 +1189,12 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo)
|
||||
}
|
||||
|
||||
*result = msec;
|
||||
return JS_TRUE;
|
||||
return true;
|
||||
|
||||
syntax:
|
||||
/* syntax error */
|
||||
*result = 0;
|
||||
return JS_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -2585,26 +2585,26 @@ date_format(JSContext *cx, double date, formatspec format, MutableHandleValue rv
|
||||
* characters. It's then likely in some other character
|
||||
* encoding, and we probably won't display it correctly.
|
||||
*/
|
||||
usetz = JS_TRUE;
|
||||
usetz = true;
|
||||
tzlen = strlen(tzbuf);
|
||||
if (tzlen > 100) {
|
||||
usetz = JS_FALSE;
|
||||
usetz = false;
|
||||
} else {
|
||||
for (i = 0; i < tzlen; i++) {
|
||||
jschar c = tzbuf[i];
|
||||
if (c > 127 ||
|
||||
!(isalpha(c) || isdigit(c) ||
|
||||
c == ' ' || c == '(' || c == ')')) {
|
||||
usetz = JS_FALSE;
|
||||
usetz = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Also reject it if it's not parenthesized or if it's '()'. */
|
||||
if (tzbuf[0] != '(' || tzbuf[1] == ')')
|
||||
usetz = JS_FALSE;
|
||||
usetz = false;
|
||||
} else
|
||||
usetz = JS_FALSE;
|
||||
usetz = false;
|
||||
|
||||
switch (format) {
|
||||
case FORMATSPEC_FULL:
|
||||
|
||||
Reference in New Issue
Block a user