mirror of
https://gitlab.freedesktop.org/xorg/proto/xorgproto.git
synced 2025-12-20 07:00:11 +01:00
XKB: Mark key name arrays as not NUL-terminated strings
They are fixed length (4 characters), and don't need NUL-terminators. This makes gcc stop warning when they're not NUL-terminated, and instead warn if they are passed to functions expecting NUL-terminated strings. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
50671520ef
commit
21e05da99c
2 changed files with 8 additions and 6 deletions
|
|
@ -28,6 +28,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#define _XKBPROTO_H_
|
#define _XKBPROTO_H_
|
||||||
|
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
|
#include <X11/Xfuncproto.h>
|
||||||
#include <X11/extensions/XKB.h>
|
#include <X11/extensions/XKB.h>
|
||||||
|
|
||||||
#define Window CARD32
|
#define Window CARD32
|
||||||
|
|
@ -675,7 +676,7 @@ typedef struct _xkbRowWireDesc {
|
||||||
#define sz_xkbRowWireDesc 8
|
#define sz_xkbRowWireDesc 8
|
||||||
|
|
||||||
typedef struct _xkbKeyWireDesc {
|
typedef struct _xkbKeyWireDesc {
|
||||||
CARD8 name[XkbKeyNameLength];
|
CARD8 name[XkbKeyNameLength] _X_NONSTRING;
|
||||||
INT16 gap;
|
INT16 gap;
|
||||||
CARD8 shapeNdx;
|
CARD8 shapeNdx;
|
||||||
CARD8 colorNdx;
|
CARD8 colorNdx;
|
||||||
|
|
@ -698,8 +699,8 @@ typedef struct _xkbOverlayRowWireDesc {
|
||||||
#define sz_xkbOverlayRowWireDesc 4
|
#define sz_xkbOverlayRowWireDesc 4
|
||||||
|
|
||||||
typedef struct _xkbOverlayKeyWireDesc {
|
typedef struct _xkbOverlayKeyWireDesc {
|
||||||
CARD8 over[XkbKeyNameLength];
|
CARD8 over[XkbKeyNameLength] _X_NONSTRING;
|
||||||
CARD8 under[XkbKeyNameLength];
|
CARD8 under[XkbKeyNameLength] _X_NONSTRING;
|
||||||
} xkbOverlayKeyWireDesc;
|
} xkbOverlayKeyWireDesc;
|
||||||
#define sz_xkbOverlayKeyWireDesc 8
|
#define sz_xkbOverlayKeyWireDesc 8
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef _XKBSTR_H_
|
#ifndef _XKBSTR_H_
|
||||||
#define _XKBSTR_H_
|
#define _XKBSTR_H_
|
||||||
|
|
||||||
|
#include <X11/Xfuncproto.h>
|
||||||
#include <X11/extensions/XKB.h>
|
#include <X11/extensions/XKB.h>
|
||||||
|
|
||||||
#define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f))
|
#define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f))
|
||||||
|
|
@ -401,12 +402,12 @@ typedef struct _XkbIndicatorRec {
|
||||||
} XkbIndicatorRec,*XkbIndicatorPtr;
|
} XkbIndicatorRec,*XkbIndicatorPtr;
|
||||||
|
|
||||||
typedef struct _XkbKeyNameRec {
|
typedef struct _XkbKeyNameRec {
|
||||||
char name[XkbKeyNameLength];
|
char name[XkbKeyNameLength] _X_NONSTRING;
|
||||||
} XkbKeyNameRec,*XkbKeyNamePtr;
|
} XkbKeyNameRec,*XkbKeyNamePtr;
|
||||||
|
|
||||||
typedef struct _XkbKeyAliasRec {
|
typedef struct _XkbKeyAliasRec {
|
||||||
char real[XkbKeyNameLength];
|
char real[XkbKeyNameLength] _X_NONSTRING;
|
||||||
char alias[XkbKeyNameLength];
|
char alias[XkbKeyNameLength] _X_NONSTRING;
|
||||||
} XkbKeyAliasRec,*XkbKeyAliasPtr;
|
} XkbKeyAliasRec,*XkbKeyAliasPtr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue