Closed Bug 969632 Opened 10 years ago Closed 10 years ago

glDeleteFoo funcs should take `const GLint*` not `GLint*`

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: jgilbert, Assigned: jgilbert)

Details

Attachments

(2 files)

For some reason, our GLContext::fDeleteTextures and friends take `GLint*` instead of `const GLint*`, meaning that you'll see code like this in places:
class {
  GLContext* const mGL;
  const GLint mTex;

  void Foo() {
    GLint tex = mTex;
    mGL->fDeleteTextures(1, &tex);
    // OR
    mGL->fDeleteTextures(1, (GLint*)&tex);
    // Instead of
    mGL->fDeleteTextures(1, &tex); // "Can't convert `const GLint*` to `GLint*` without loosing qualifiers"
  }
};

Interestingly, GLContextSymbols has is already const-correct.
Attached patch patchSplinter Review
Attachment #8372584 - Flags: review?(bjacob)
Attachment #8372584 - Flags: review?(bjacob) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/6d7069935a34
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
(In reply to Jeff Gilbert [:jgilbert] from comment #0)
> For some reason, our GLContext::fDeleteTextures and friends take `GLint*`
> instead of `const GLint*`, meaning that you'll see code like this in places: ...

I don't see you removing those workarounds. How come?
Flags: needinfo?(jgilbert)
(In reply to :Ms2ger from comment #4)
> (In reply to Jeff Gilbert [:jgilbert] from comment #0)
> > For some reason, our GLContext::fDeleteTextures and friends take `GLint*`
> > instead of `const GLint*`, meaning that you'll see code like this in places: ...
> 
> I don't see you removing those workarounds. How come?

I didn't think to include that in this bug, for some reason. Thanks. Reopening to do this.
Status: RESOLVED → REOPENED
Flags: needinfo?(jgilbert)
Resolution: FIXED → ---
Attached patch patch 2Splinter Review
Attachment #8373626 - Flags: review?(bjacob)
Attachment #8372584 - Flags: checkin+
Attachment #8373626 - Flags: review?(bjacob) → review+
https://hg.mozilla.org/mozilla-central/rev/b135788f78ea
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: