Fix a few -pedantic warnings
We're not enabling -pedantic by default, but a quick test brought up a few issues that we should fix.
This commit is contained in:
@@ -57,7 +57,7 @@ enum weston_option_type {
|
|||||||
WESTON_OPTION_INTEGER,
|
WESTON_OPTION_INTEGER,
|
||||||
WESTON_OPTION_UNSIGNED_INTEGER,
|
WESTON_OPTION_UNSIGNED_INTEGER,
|
||||||
WESTON_OPTION_STRING,
|
WESTON_OPTION_STRING,
|
||||||
WESTON_OPTION_BOOLEAN,
|
WESTON_OPTION_BOOLEAN
|
||||||
};
|
};
|
||||||
|
|
||||||
struct weston_option {
|
struct weston_option {
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ load_webp(FILE *fp)
|
|||||||
|
|
||||||
|
|
||||||
struct image_loader {
|
struct image_loader {
|
||||||
char header[4];
|
unsigned char header[4];
|
||||||
int header_size;
|
int header_size;
|
||||||
pixman_image_t *(*load)(FILE *fp);
|
pixman_image_t *(*load)(FILE *fp);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -992,14 +992,6 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
|
|||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
sysnum = udev_device_get_sysnum(device);
|
|
||||||
if (sysnum)
|
|
||||||
ec->drm.id = atoi(sysnum);
|
|
||||||
if (!sysnum || ec->drm.id < 0) {
|
|
||||||
fprintf(stderr, "cannot get device sysnum\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const EGLint config_attribs[] = {
|
static const EGLint config_attribs[] = {
|
||||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||||
EGL_RED_SIZE, 1,
|
EGL_RED_SIZE, 1,
|
||||||
@@ -1010,6 +1002,14 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
|
|||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sysnum = udev_device_get_sysnum(device);
|
||||||
|
if (sysnum)
|
||||||
|
ec->drm.id = atoi(sysnum);
|
||||||
|
if (!sysnum || ec->drm.id < 0) {
|
||||||
|
fprintf(stderr, "cannot get device sysnum\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
filename = udev_device_get_devnode(device);
|
filename = udev_device_get_devnode(device);
|
||||||
fd = open(filename, O_RDWR | O_CLOEXEC);
|
fd = open(filename, O_RDWR | O_CLOEXEC);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ struct wayland_compositor {
|
|||||||
struct weston_compositor base;
|
struct weston_compositor base;
|
||||||
|
|
||||||
struct wl_egl_pixmap *dummy_pixmap;
|
struct wl_egl_pixmap *dummy_pixmap;
|
||||||
EGLSurface dummy_egl_surface;;
|
EGLSurface dummy_egl_surface;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct wl_display *display;
|
struct wl_display *display;
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ extern "C" {
|
|||||||
enum backlight_type {
|
enum backlight_type {
|
||||||
BACKLIGHT_RAW,
|
BACKLIGHT_RAW,
|
||||||
BACKLIGHT_PLATFORM,
|
BACKLIGHT_PLATFORM,
|
||||||
BACKLIGHT_FIRMWARE,
|
BACKLIGHT_FIRMWARE
|
||||||
};
|
};
|
||||||
|
|
||||||
struct backlight {
|
struct backlight {
|
||||||
|
|||||||
+2
-3
@@ -440,8 +440,7 @@ ping_timeout_handler(void *data)
|
|||||||
static void
|
static void
|
||||||
ping_handler(struct weston_surface *surface, uint32_t serial)
|
ping_handler(struct weston_surface *surface, uint32_t serial)
|
||||||
{
|
{
|
||||||
struct shell_surface *shsurf;
|
struct shell_surface *shsurf = get_shell_surface(surface);
|
||||||
shsurf = get_shell_surface(surface);
|
|
||||||
struct wl_event_loop *loop;
|
struct wl_event_loop *loop;
|
||||||
int ping_timeout = 2500;
|
int ping_timeout = 2500;
|
||||||
|
|
||||||
@@ -2437,7 +2436,7 @@ switcher_key(struct wl_keyboard_grab *grab,
|
|||||||
} else if (key == KEY_TAB && state) {
|
} else if (key == KEY_TAB && state) {
|
||||||
switcher_next(switcher);
|
switcher_next(switcher);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
static const struct wl_keyboard_grab_interface switcher_grab = {
|
static const struct wl_keyboard_grab_interface switcher_grab = {
|
||||||
switcher_key
|
switcher_key
|
||||||
|
|||||||
@@ -796,9 +796,10 @@ weston_wm_send_data(struct weston_wm *wm, xcb_atom_t target, const char *mime_ty
|
|||||||
static void
|
static void
|
||||||
weston_wm_send_incr_chunk(struct weston_wm *wm)
|
weston_wm_send_incr_chunk(struct weston_wm *wm)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "property deleted\n");
|
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
|
fprintf(stderr, "property deleted\n");
|
||||||
|
|
||||||
wm->selection_property_set = 0;
|
wm->selection_property_set = 0;
|
||||||
if (wm->flush_property_on_delete) {
|
if (wm->flush_property_on_delete) {
|
||||||
fprintf(stderr, "setting new property, %zu bytes\n",
|
fprintf(stderr, "setting new property, %zu bytes\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user