mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Fixed compiler bugs/warnings
This commit is contained in:
parent
bda16166bb
commit
b881d71f5b
@ -190,7 +190,7 @@ nsNode* nsBTree::Remove(nsNode& aNode){
|
||||
if(node2!=node3)
|
||||
(*node3)==(*node2);
|
||||
|
||||
if(node2->mColor=nsNode::eBlack)
|
||||
if(node2->mColor == nsNode::eBlack)
|
||||
ReBalance(*node1);
|
||||
|
||||
delete node2;
|
||||
|
@ -279,4 +279,5 @@ protected:
|
||||
nsNode* mRoot;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -321,12 +321,13 @@ nsBTree& nsRBTree::ReBalance(nsNode& aNode){
|
||||
node2=node1->mParent->mRight;
|
||||
}
|
||||
|
||||
if((node2->mLeft->mColor=nsNode::eBlack) && (node2->mRight->mColor=nsNode::eBlack)) {
|
||||
if((node2->mLeft->mColor == nsNode::eBlack) &&
|
||||
(node2->mRight->mColor == nsNode::eBlack)) {
|
||||
node2->mColor=nsNode::eRed;
|
||||
node1=node1->mParent;
|
||||
}
|
||||
else {
|
||||
if(node2->mRight->mColor=nsNode::eBlack) {
|
||||
if(node2->mRight->mColor == nsNode::eBlack) {
|
||||
node2->mLeft->mColor=nsNode::eBlack;
|
||||
node2->mColor=nsNode::eRed;
|
||||
ShiftRight(*node2);
|
||||
@ -349,12 +350,13 @@ nsBTree& nsRBTree::ReBalance(nsNode& aNode){
|
||||
node2=node1->mParent->mLeft;
|
||||
}
|
||||
|
||||
if((node2->mRight->mColor=nsNode::eBlack) && (node2->mLeft->mColor=nsNode::eBlack)) {
|
||||
if((node2->mRight->mColor == nsNode::eBlack) &&
|
||||
(node2->mLeft->mColor == nsNode::eBlack)) {
|
||||
node2->mColor=nsNode::eRed;
|
||||
node1=node1->mParent;
|
||||
}
|
||||
else {
|
||||
if(node2->mLeft->mColor=nsNode::eBlack){
|
||||
if(node2->mLeft->mColor == nsNode::eBlack){
|
||||
node2->mRight->mColor=nsNode::eBlack;
|
||||
node2->mColor=nsNode::eRed;
|
||||
ShiftLeft(*node2);
|
||||
|
@ -220,4 +220,4 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -530,15 +530,15 @@ float nsString::ToFloat(PRInt32* aErrorCode) const
|
||||
{
|
||||
char buf[40];
|
||||
if (mLength > sizeof(buf)-1) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return 0.0f;
|
||||
}
|
||||
char* cp = ToCString(buf, sizeof(buf));
|
||||
float f = (float) PR_strtod(cp, &cp);
|
||||
if (*cp != 0) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
*aErrorCode = NS_OK;
|
||||
*aErrorCode = (PRInt32) NS_OK;
|
||||
return f;
|
||||
}
|
||||
|
||||
@ -562,7 +562,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
cp++;
|
||||
}
|
||||
if (cp == end) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -572,7 +572,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
sign = *cp++;
|
||||
}
|
||||
if (cp == end) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
while (cp < end) {
|
||||
PRUnichar ch = *cp++;
|
||||
if ((ch < '0') || (ch > '9')) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
break;
|
||||
}
|
||||
rv = rv * 10 + (ch - '0');
|
||||
|
@ -214,7 +214,7 @@ void nsTransform2D :: Concatenate(nsTransform2D *newxform)
|
||||
void nsTransform2D :: PreConcatenate(nsTransform2D *newxform)
|
||||
{
|
||||
float temp00, temp01, temp10, temp11, temp20, temp21;
|
||||
float new00, new01, new10, new11, new20, new21;
|
||||
float new00, new01, new10, new11;
|
||||
|
||||
//this is totally unoptimized MMP
|
||||
|
||||
@ -229,8 +229,6 @@ void nsTransform2D :: PreConcatenate(nsTransform2D *newxform)
|
||||
new01 = newxform->m01;
|
||||
new10 = newxform->m10;
|
||||
new11 = newxform->m11;
|
||||
new20 = newxform->m20;
|
||||
new21 = newxform->m21;
|
||||
|
||||
m00 = temp00 * new00 + temp01 * new10; // + temp02 * new20 == 0
|
||||
m01 = temp00 * new01 + temp01 * new11; // + temp02 * new21 == 0
|
||||
|
@ -109,5 +109,5 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return rv;
|
||||
}
|
||||
|
@ -529,8 +529,6 @@ PRBool CNavDTD::CanContainIndirect(PRInt32 aParent,PRInt32 aChild) const {
|
||||
}
|
||||
break;
|
||||
|
||||
result=PR_TRUE; break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -503,8 +503,6 @@ PRBool COtherDTD::CanContainIndirect(PRInt32 aParent,PRInt32 aChild) const {
|
||||
}
|
||||
break;
|
||||
|
||||
result=PR_TRUE; break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -529,8 +529,6 @@ PRBool CNavDTD::CanContainIndirect(PRInt32 aParent,PRInt32 aChild) const {
|
||||
}
|
||||
break;
|
||||
|
||||
result=PR_TRUE; break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -503,8 +503,6 @@ PRBool COtherDTD::CanContainIndirect(PRInt32 aParent,PRInt32 aChild) const {
|
||||
}
|
||||
break;
|
||||
|
||||
result=PR_TRUE; break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -530,15 +530,15 @@ float nsString::ToFloat(PRInt32* aErrorCode) const
|
||||
{
|
||||
char buf[40];
|
||||
if (mLength > sizeof(buf)-1) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return 0.0f;
|
||||
}
|
||||
char* cp = ToCString(buf, sizeof(buf));
|
||||
float f = (float) PR_strtod(cp, &cp);
|
||||
if (*cp != 0) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
*aErrorCode = NS_OK;
|
||||
*aErrorCode = (PRInt32) NS_OK;
|
||||
return f;
|
||||
}
|
||||
|
||||
@ -562,7 +562,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
cp++;
|
||||
}
|
||||
if (cp == end) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -572,7 +572,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
sign = *cp++;
|
||||
}
|
||||
if (cp == end) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
while (cp < end) {
|
||||
PRUnichar ch = *cp++;
|
||||
if ((ch < '0') || (ch > '9')) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
break;
|
||||
}
|
||||
rv = rv * 10 + (ch - '0');
|
||||
|
@ -422,4 +422,4 @@ void nsScrollingView :: ComputeScrollArea(nsIView *aView, nsRect &aRect,
|
||||
nsIView *view = aView->GetChild(cnt);
|
||||
ComputeScrollArea(view, aRect, aOffX, aOffY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ nsNode* nsBTree::Remove(nsNode& aNode){
|
||||
if(node2!=node3)
|
||||
(*node3)==(*node2);
|
||||
|
||||
if(node2->mColor=nsNode::eBlack)
|
||||
if(node2->mColor == nsNode::eBlack)
|
||||
ReBalance(*node1);
|
||||
|
||||
delete node2;
|
||||
|
@ -279,4 +279,5 @@ protected:
|
||||
nsNode* mRoot;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -321,12 +321,13 @@ nsBTree& nsRBTree::ReBalance(nsNode& aNode){
|
||||
node2=node1->mParent->mRight;
|
||||
}
|
||||
|
||||
if((node2->mLeft->mColor=nsNode::eBlack) && (node2->mRight->mColor=nsNode::eBlack)) {
|
||||
if((node2->mLeft->mColor == nsNode::eBlack) &&
|
||||
(node2->mRight->mColor == nsNode::eBlack)) {
|
||||
node2->mColor=nsNode::eRed;
|
||||
node1=node1->mParent;
|
||||
}
|
||||
else {
|
||||
if(node2->mRight->mColor=nsNode::eBlack) {
|
||||
if(node2->mRight->mColor == nsNode::eBlack) {
|
||||
node2->mLeft->mColor=nsNode::eBlack;
|
||||
node2->mColor=nsNode::eRed;
|
||||
ShiftRight(*node2);
|
||||
@ -349,12 +350,13 @@ nsBTree& nsRBTree::ReBalance(nsNode& aNode){
|
||||
node2=node1->mParent->mLeft;
|
||||
}
|
||||
|
||||
if((node2->mRight->mColor=nsNode::eBlack) && (node2->mLeft->mColor=nsNode::eBlack)) {
|
||||
if((node2->mRight->mColor == nsNode::eBlack) &&
|
||||
(node2->mLeft->mColor == nsNode::eBlack)) {
|
||||
node2->mColor=nsNode::eRed;
|
||||
node1=node1->mParent;
|
||||
}
|
||||
else {
|
||||
if(node2->mLeft->mColor=nsNode::eBlack){
|
||||
if(node2->mLeft->mColor == nsNode::eBlack){
|
||||
node2->mRight->mColor=nsNode::eBlack;
|
||||
node2->mColor=nsNode::eRed;
|
||||
ShiftLeft(*node2);
|
||||
|
@ -220,4 +220,4 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -530,15 +530,15 @@ float nsString::ToFloat(PRInt32* aErrorCode) const
|
||||
{
|
||||
char buf[40];
|
||||
if (mLength > sizeof(buf)-1) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return 0.0f;
|
||||
}
|
||||
char* cp = ToCString(buf, sizeof(buf));
|
||||
float f = (float) PR_strtod(cp, &cp);
|
||||
if (*cp != 0) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
*aErrorCode = NS_OK;
|
||||
*aErrorCode = (PRInt32) NS_OK;
|
||||
return f;
|
||||
}
|
||||
|
||||
@ -562,7 +562,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
cp++;
|
||||
}
|
||||
if (cp == end) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -572,7 +572,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
sign = *cp++;
|
||||
}
|
||||
if (cp == end) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
while (cp < end) {
|
||||
PRUnichar ch = *cp++;
|
||||
if ((ch < '0') || (ch > '9')) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
break;
|
||||
}
|
||||
rv = rv * 10 + (ch - '0');
|
||||
|
@ -530,15 +530,15 @@ float nsString::ToFloat(PRInt32* aErrorCode) const
|
||||
{
|
||||
char buf[40];
|
||||
if (mLength > sizeof(buf)-1) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return 0.0f;
|
||||
}
|
||||
char* cp = ToCString(buf, sizeof(buf));
|
||||
float f = (float) PR_strtod(cp, &cp);
|
||||
if (*cp != 0) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
*aErrorCode = NS_OK;
|
||||
*aErrorCode = (PRInt32) NS_OK;
|
||||
return f;
|
||||
}
|
||||
|
||||
@ -562,7 +562,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
cp++;
|
||||
}
|
||||
if (cp == end) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -572,7 +572,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
sign = *cp++;
|
||||
}
|
||||
if (cp == end) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode) const {
|
||||
while (cp < end) {
|
||||
PRUnichar ch = *cp++;
|
||||
if ((ch < '0') || (ch > '9')) {
|
||||
*aErrorCode = NS_ERROR_ILLEGAL_VALUE;
|
||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||
break;
|
||||
}
|
||||
rv = rv * 10 + (ch - '0');
|
||||
|
Loading…
Reference in New Issue
Block a user