Closed Bug 573541 Opened 15 years ago Closed 15 years ago

More enums validation and fixes

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bjacob, Assigned: bjacob)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached patch Lots of enum fixes (obsolete) — Splinter Review
This patch fixes more enum-related issues. * Fix the last problematic pnames in GetParameter * validate the enums in various functions in which we still weren't doing that.
Attachment #452819 - Attachment is patch: true
Attachment #452819 - Attachment mime type: application/octet-stream → text/plain
Attachment #452819 - Flags: review?(vladimir)
Blocks: 487916
sorry, the previous patch was mistakenly removing a function, i forgot to do a "hg qref".
Attachment #452819 - Attachment is obsolete: true
Attachment #452846 - Flags: review?(vladimir)
Attachment #452819 - Flags: review?(vladimir)
Comment on attachment 452846 [details] [diff] [review] Lots of enum fixes This looks good, though I wonder if we should just define these in the header directly so that we can be pretty certain that they get inlined. Also, one style comment: >+ if(!ValidateTextureTargetEnum(target)) >+ return ErrorInvalidEnum("GenerateMipmap: invalid target"); Well ok, two style comments -- missing a space, just do a search for "if(" :-) >+NS_IMETHODIMP >+WebGLContext::StencilOp(WebGLenum sfail, WebGLenum dpfail, WebGLenum dppass) >+{ >+ if (!ValidateStencilOpEnum(sfail) >+ || !ValidateStencilOpEnum(dpfail) >+ || !ValidateStencilOpEnum(dppass)) >+ return ErrorInvalidEnum("StencilOp: invalid action enum"); This is quite weird indentation -- just 4-space indent everything like normal. I have no preference on || before or after the previous line, either's fine, but with a multiline if condition, the statement should always have { } around it.
Comment on attachment 452846 [details] [diff] [review] Lots of enum fixes argh, looks like I forgot to r+ this.. see above for comments, sorry!
Attachment #452846 - Flags: review?(vladimir) → review+
No worries, it's just that I've been lazy. Also, I'm looking at adding a pre-"hg qrefresh" hook checking for "if(" ;-)
Attachment #454050 - Flags: review+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee: nobody → bjacob
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: