Merge pull request #8469 from hhromic/various-fixes

Fix C89 build and silence warnings
This commit is contained in:
Twinaphex 2019-03-14 17:39:18 +01:00 committed by GitHub
commit d415d4eb23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 7 deletions

View File

@ -287,7 +287,7 @@ static bool command_read_ram(const char *arg)
unsigned int alloc_size = 0;
unsigned int addr = -1;
if (sscanf(arg, "%x %d", &addr, &nbytes) != 2)
if (sscanf(arg, "%x %u", &addr, &nbytes) != 2)
return true;
alloc_size = 40 + nbytes * 3; /* We alloc more than needed, saving 20 bytes is not really relevant */
reply = (char*) malloc(alloc_size);

View File

@ -572,17 +572,17 @@ bool x11_alive(void *data)
case KeyRelease:
/* When you receive a key release and the next event is a key press
of the same key combination, then it's auto-repeat and the
of the same key combination, then it's auto-repeat and the
key wasn't actually released. */
if(XEventsQueued(g_x11_dpy, QueuedAfterReading))
{
XEvent next_event;
XPeekEvent(g_x11_dpy, &next_event);
if (next_event.type == KeyPress &&
if (next_event.type == KeyPress &&
next_event.xkey.time == event.xkey.time &&
next_event.xkey.keycode == event.xkey.keycode)
{
break; // Key wasn't actually released
break; /* Key wasn't actually released */
}
}
case KeyPress:

View File

@ -57,6 +57,7 @@ typedef struct
bool decorations;
} dispserv_x11_t;
#ifdef HAVE_XRANDR
static Display* x11_display_server_open_display(void)
{
Display *dpy = g_x11_dpy;
@ -72,7 +73,9 @@ static Display* x11_display_server_open_display(void)
return dpy;
}
#endif
#ifdef HAVE_XRANDR
static void x11_display_server_close_display(Display *dpy)
{
if (!dpy || x11_display_server_using_global_dpy || dpy == g_x11_dpy)
@ -80,6 +83,7 @@ static void x11_display_server_close_display(Display *dpy)
XCloseDisplay(dpy);
}
#endif
static void* x11_display_server_init(void)
{

View File

@ -226,11 +226,11 @@ extern "C" {
/* standard CD-ROM metadata */
#define CDROM_OLD_METADATA_TAG 0x43484344 /* 'CHCD' */
#define CDROM_TRACK_METADATA_TAG 0x43485452 /* 'CHTR' */
#define CDROM_TRACK_METADATA_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d"
#define CDROM_TRACK_METADATA_FORMAT "TRACK:%u TYPE:%s SUBTYPE:%s FRAMES:%u"
#define CDROM_TRACK_METADATA2_TAG 0x43485432 /* 'CHT2' */
#define CDROM_TRACK_METADATA2_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"
#define CDROM_TRACK_METADATA2_FORMAT "TRACK:%u TYPE:%s SUBTYPE:%s FRAMES:%u PREGAP:%u PGTYPE:%s PGSUB:%s POSTGAP:%u"
#define GDROM_TRACK_METADATA_TAG 0x43484744 /* 'CHTD' */
#define GDROM_TRACK_METADATA_FORMAT "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PAD:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"
#define GDROM_TRACK_METADATA_FORMAT "TRACK:%u TYPE:%s SUBTYPE:%s FRAMES:%u PAD:%u PREGAP:%u PGTYPE:%s PGSUB:%s POSTGAP:%u"
/* standard A/V metadata */
#define AV_METADATA_TAG 0x41564156 /* 'AVAV' */