зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1707943 - Fix warnings and apply suggestions form static analysis, r=stransky
Some more small cleanups to stop the review bot from complaining in patches touching these files. Differential Revision: https://phabricator.services.mozilla.com/D113721
This commit is contained in:
Родитель
6d793a8c93
Коммит
10d2da5900
|
@ -413,7 +413,7 @@ gfxImageFormat gfxPlatformGtk::GetOffscreenFormat() {
|
|||
|
||||
void gfxPlatformGtk::FontsPrefsChanged(const char* aPref) {
|
||||
// only checking for generic substitions, pass other changes up
|
||||
if (strcmp(GFX_PREF_MAX_GENERIC_SUBSTITUTIONS, aPref)) {
|
||||
if (strcmp(GFX_PREF_MAX_GENERIC_SUBSTITUTIONS, aPref) != 0) {
|
||||
gfxPlatform::FontsPrefsChanged(aPref);
|
||||
return;
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ nsTArray<uint8_t> gfxPlatformGtk::GetPlatformCMSOutputProfileData() {
|
|||
}
|
||||
|
||||
// Format documented in "VESA E-EDID Implementation Guide"
|
||||
float gamma = (100 + retProperty[0x17]) / 100.0f;
|
||||
float gamma = (100 + (float)retProperty[0x17]) / 100.0f;
|
||||
|
||||
qcms_CIE_xyY whitePoint;
|
||||
whitePoint.x =
|
||||
|
@ -739,7 +739,7 @@ class GtkVsyncSource final : public VsyncSource {
|
|||
// until the parity of the counter value changes.
|
||||
unsigned int nextSync = syncCounter + 1;
|
||||
int status;
|
||||
if ((status = gl::sGLXLibrary.fWaitVideoSync(2, nextSync % 2,
|
||||
if ((status = gl::sGLXLibrary.fWaitVideoSync(2, (int)nextSync % 2,
|
||||
&syncCounter)) != 0) {
|
||||
gfxWarningOnce() << "glXWaitVideoSync returned " << status;
|
||||
useSoftware = true;
|
||||
|
@ -755,7 +755,7 @@ class GtkVsyncSource final : public VsyncSource {
|
|||
double remaining =
|
||||
(1000.f / 60.f) - (TimeStamp::Now() - lastVsync).ToMilliseconds();
|
||||
if (remaining > 0) {
|
||||
PlatformThread::Sleep(remaining);
|
||||
PlatformThread::Sleep((int)remaining);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ void GfxInfo::GetData() {
|
|||
|
||||
// only useful for Linux kernel version check for FGLRX driver.
|
||||
// assumes X client == X server, which is sad.
|
||||
struct utsname unameobj;
|
||||
struct utsname unameobj {};
|
||||
if (uname(&unameobj) >= 0) {
|
||||
mOS.Assign(unameobj.sysname);
|
||||
mOSRelease.Assign(unameobj.release);
|
||||
|
@ -338,7 +338,7 @@ void GfxInfo::GetData() {
|
|||
while (loc != kNotFound) {
|
||||
int isDefault = 0;
|
||||
nsCString line(screenInfo.get() + start, loc - start);
|
||||
ScreenInfo info;
|
||||
ScreenInfo info{};
|
||||
if (sscanf(line.get(), "%ux%u:%u", &info.mWidth, &info.mHeight,
|
||||
&isDefault) == 3) {
|
||||
info.mIsDefault = isDefault != 0;
|
||||
|
|
|
@ -569,8 +569,8 @@ struct wl_egl_window* moz_container_wayland_get_egl_window(
|
|||
if (!wl_container->eglwindow) {
|
||||
GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container));
|
||||
wl_container->eglwindow = wl_egl_window_create(
|
||||
wl_container->surface, round(gdk_window_get_width(window) * scale),
|
||||
round(gdk_window_get_height(window) * scale));
|
||||
wl_container->surface, (int)round(gdk_window_get_width(window) * scale),
|
||||
(int)round(gdk_window_get_height(window) * scale));
|
||||
|
||||
LOGWAYLAND(("%s [%p] created eglwindow %p\n", __FUNCTION__,
|
||||
(void*)container, (void*)wl_container->eglwindow));
|
||||
|
@ -579,7 +579,7 @@ struct wl_egl_window* moz_container_wayland_get_egl_window(
|
|||
}
|
||||
|
||||
gboolean moz_container_wayland_has_egl_window(MozContainer* container) {
|
||||
return container->wl_container.eglwindow ? true : false;
|
||||
return container->wl_container.eglwindow != nullptr;
|
||||
}
|
||||
|
||||
gboolean moz_container_wayland_surface_needs_clear(MozContainer* container) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче