64bit OpenGL constants literals need to use proper type suffixes

NEW
Unassigned

Status

()

5 years ago
5 years ago

People

(Reporter: bjacob, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Just spotted this flying over my terminal while building B2G:

/hack/mozilla-central/gfx/gl/SharedSurfaceGL.cpp:378: warning: integer constant is too large for 'long' type

The code is

bool
SharedSurface_GLTexture::WaitSync()
{
    MutexAutoLock lock(mMutex);
    if (!mSync) {
        // We must have used glFinish instead of glFenceSync.
        return true;
    }

    MOZ_ASSERT(mConsGL, "Did you forget to call a deferred `SetConsumerGL()`?");
    mConsGL->MakeCurrent();
    MOZ_ASSERT(mConsGL->IsExtensionSupported(GLContext::ARB_sync));

    mConsGL->fWaitSync(mSync,
                       0,
                       LOCAL_GL_TIMEOUT_IGNORED);  // <-- ### here ###
    mConsGL->fDeleteSync(mSync);
    mSync = 0;

    return true;
}

It looks like this could mean that the timeout value we pass to WaitSync isn't the one we intend to!
(Reporter)

Updated

5 years ago
Summary: integer type mismatch could make glWaitSync receive a different timeout value than intended → 64bit OpenGL constants literals need to use proper type suffixes
(Reporter)

Comment 1

5 years ago
Created attachment 8339664 [details] [diff] [review]
The glass is also half 0xFFFFFFFFFFFFFFFFull

It's not so bad after all.
Attachment #8339664 - Flags: review?(jgilbert)
Comment on attachment 8339664 [details] [diff] [review]
The glass is also half 0xFFFFFFFFFFFFFFFFull

Review of attachment 8339664 [details] [diff] [review]:
-----------------------------------------------------------------

Hah.
Attachment #8339664 - Flags: review?(jgilbert) → review+
You need to log in before you can comment on or make changes to this bug.