Closed Bug 518894 Opened 16 years ago Closed 16 years ago

build warning: "WebGLContextGL.cpp:2968: warning: unused variable ‘argPixelsLen’"

Categories

(Core :: Graphics: Canvas2D, defect)

x86
Linux
defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

References

()

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

The patch checked in for bug 513156 introduced this warning when building WebGLContextGL.cpp: > /mozilla/content/canvas/src/WebGLContextGL.cpp: In member function ‘virtual nsresult mozilla::WebGLContext::TexImage2D()’: > /mozilla/content/canvas/src/WebGLContextGL.cpp:2968: warning: unused variable ‘argPixelsLen’ There are multiple places in the file where a variable with this name is declared -- most of these variables are used, but the particular instance mentioned in the build-warning is indeed unused. Attached patch removes the declaration of this unused variable.
Attachment #402886 - Flags: review?(vladimir)
For context, here's the entire block that contains the declared-but-unused variable (argPixelsLen), from MXR: 2966 if (js.argc == 3) { 2967 JSObject *argPixelsObj; 2968 jsuint argPixelsLen; 2969 if (!::JS_ConvertArguments(js.ctx, js.argc, js.argv, "uuo", 2970 &argTarget, &argLevel, 2971 &argPixelsObj) || 2972 !argPixelsObj) 2973 { 2974 return ErrorMessage("texImage2D: argument error"); 2975 return NS_ERROR_DOM_SYNTAX_ERR; 2976 } 2977 nsCOMPtr<nsIDOMHTMLElement> imgElt; 2978 nsresult rv; 2979 rv = nsContentUtils::XPConnect()->WrapJS(js.ctx, argPixelsObj, NS_GET_IID(nsIDOMHTMLElement), getter_AddRefs(imgElt)); 2980 2981 nsRefPtr<gfxImageSurface> isurf; 2982 2983 rv = TexImageElementBase(imgElt, getter_AddRefs(isurf)); 2984 2985 if (NS_FAILED(rv)) 2986 return ErrorMessage("texImage2D: failed to get image for element"); 2987 2988 MakeContextCurrent(); 2989 2990 gl->fTexImage2D (argTarget, argLevel, LOCAL_GL_RGBA, isurf->Width(), isurf->Height(), 0, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, isurf->Data()); 2991 2992 } else if (js.argc == 9) { http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLContextGL.cpp?mark=2966-2992#2996
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee: nobody → dholbert
Whiteboard: [build_warning]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: