Bug 494688 nsCanvasRenderingContext2D::CreateImageData warning: comparison between signed and unsigned
authortimeless@mozdev.org
Sat, 27 Jun 2009 18:42:51 -0700
changeset 29775 0d207c799c26
parent 29774 d72426c9be6b
child 29776 24deeefbd7e5
push id106
push userhsivonen@iki.fi
push dateSun, 28 Jun 2009 17:44:42 +0000
bugs494688
milestone1.9.2a1pre
Bug 494688 nsCanvasRenderingContext2D::CreateImageData warning: comparison between signed and unsigned r+sr=vlad
content/canvas/src/nsCanvasRenderingContext2D.cpp
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -3743,23 +3743,26 @@ nsCanvasRenderingContext2D::CreateImageD
     PRUint32 argc;
     jsval *argv = nsnull;
 
     ncc->GetArgc(&argc);
     ncc->GetArgvPtr(&argv);
 
     JSAutoRequest ar(ctx);
 
-    int32 w, h;
-    if (!JS_ConvertArguments (ctx, argc, argv, "jj", &w, &h))
+    int32 width, height;
+    if (!JS_ConvertArguments (ctx, argc, argv, "jj", &width, &height))
         return NS_ERROR_DOM_SYNTAX_ERR;
 
-    if (w <= 0 || h <= 0)
+    if (width <= 0 || height <= 0)
         return NS_ERROR_DOM_INDEX_SIZE_ERR;
 
+    PRUint32 w = (PRUint32) width;
+    PRUint32 h = (PRUint32) height;
+
     // check for overflow when calculating len
     PRUint32 len0 = w * h;
     if (len0 / w != (PRUint32) h)
         return NS_ERROR_DOM_INDEX_SIZE_ERR;
     PRUint32 len = len0 * 4;
     if (len / 4 != len0)
         return NS_ERROR_DOM_INDEX_SIZE_ERR;