Code-style consistency improvement:

Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
erwincoumans
2018-09-23 14:17:31 -07:00
parent b73b05e9fb
commit ab8f16961e
1773 changed files with 1081087 additions and 474249 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -35,98 +35,100 @@ in this Software without prior written authorization from The Open Group.
#ifndef _XSHM_SERVER_
typedef unsigned long ShmSeg;
typedef struct {
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came frome a SendEvent request */
Display *display; /* Display the event was read from */
Drawable drawable; /* drawable of request */
int major_code; /* ShmReqCode */
int minor_code; /* X_ShmPutImage */
ShmSeg shmseg; /* the ShmSeg used in the request */
unsigned long offset; /* the offset into ShmSeg used in the request */
typedef struct
{
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came frome a SendEvent request */
Display* display; /* Display the event was read from */
Drawable drawable; /* drawable of request */
int major_code; /* ShmReqCode */
int minor_code; /* X_ShmPutImage */
ShmSeg shmseg; /* the ShmSeg used in the request */
unsigned long offset; /* the offset into ShmSeg used in the request */
} XShmCompletionEvent;
typedef struct {
ShmSeg shmseg; /* resource id */
int shmid; /* kernel id */
char *shmaddr; /* address in client */
Bool readOnly; /* how the server should attach it */
typedef struct
{
ShmSeg shmseg; /* resource id */
int shmid; /* kernel id */
char* shmaddr; /* address in client */
Bool readOnly; /* how the server should attach it */
} XShmSegmentInfo;
_XFUNCPROTOBEGIN
Bool XShmQueryExtension(
Display* /* dpy */
Display* /* dpy */
);
int XShmGetEventBase(
Display* /* dpy */
Display* /* dpy */
);
Bool XShmQueryVersion(
Display* /* dpy */,
int* /* majorVersion */,
int* /* minorVersion */,
Bool* /* sharedPixmaps */
Display* /* dpy */,
int* /* majorVersion */,
int* /* minorVersion */,
Bool* /* sharedPixmaps */
);
int XShmPixmapFormat(
Display* /* dpy */
Display* /* dpy */
);
Bool XShmAttach(
Display* /* dpy */,
XShmSegmentInfo* /* shminfo */
Display* /* dpy */,
XShmSegmentInfo* /* shminfo */
);
Bool XShmDetach(
Display* /* dpy */,
XShmSegmentInfo* /* shminfo */
Display* /* dpy */,
XShmSegmentInfo* /* shminfo */
);
Bool XShmPutImage(
Display* /* dpy */,
Drawable /* d */,
GC /* gc */,
XImage* /* image */,
int /* src_x */,
int /* src_y */,
int /* dst_x */,
int /* dst_y */,
unsigned int /* src_width */,
unsigned int /* src_height */,
Bool /* send_event */
Display* /* dpy */,
Drawable /* d */,
GC /* gc */,
XImage* /* image */,
int /* src_x */,
int /* src_y */,
int /* dst_x */,
int /* dst_y */,
unsigned int /* src_width */,
unsigned int /* src_height */,
Bool /* send_event */
);
Bool XShmGetImage(
Display* /* dpy */,
Drawable /* d */,
XImage* /* image */,
int /* x */,
int /* y */,
unsigned long /* plane_mask */
Display* /* dpy */,
Drawable /* d */,
XImage* /* image */,
int /* x */,
int /* y */,
unsigned long /* plane_mask */
);
XImage *XShmCreateImage(
Display* /* dpy */,
Visual* /* visual */,
unsigned int /* depth */,
int /* format */,
char* /* data */,
XShmSegmentInfo* /* shminfo */,
unsigned int /* width */,
unsigned int /* height */
XImage* XShmCreateImage(
Display* /* dpy */,
Visual* /* visual */,
unsigned int /* depth */,
int /* format */,
char* /* data */,
XShmSegmentInfo* /* shminfo */,
unsigned int /* width */,
unsigned int /* height */
);
Pixmap XShmCreatePixmap(
Display* /* dpy */,
Drawable /* d */,
char* /* data */,
XShmSegmentInfo* /* shminfo */,
unsigned int /* width */,
unsigned int /* height */,
unsigned int /* depth */
Display* /* dpy */,
Drawable /* d */,
char* /* data */,
XShmSegmentInfo* /* shminfo */,
unsigned int /* width */,
unsigned int /* height */,
unsigned int /* depth */
);
_XFUNCPROTOEND

View File

@@ -30,19 +30,19 @@ in this Software without prior written authorization from The Open Group.
_XFUNCPROTOBEGIN
typedef int (*XextErrorHandler) (
Display * /* dpy */,
_Xconst char* /* ext_name */,
_Xconst char* /* reason */
typedef int (*XextErrorHandler)(
Display* /* dpy */,
_Xconst char* /* ext_name */,
_Xconst char* /* reason */
);
extern XextErrorHandler XSetExtensionErrorHandler(
XextErrorHandler /* handler */
XextErrorHandler /* handler */
);
extern int XMissingExtension(
Display* /* dpy */,
_Xconst char* /* ext_name */
Display* /* dpy */,
_Xconst char* /* ext_name */
);
_XFUNCPROTOEND

View File

@@ -41,108 +41,117 @@ in this Software without prior written authorization from The Open Group.
* public. We also have to per-display info in a separate block since it isn't
* stored directly in the Display structure.
*/
typedef struct _XExtDisplayInfo {
struct _XExtDisplayInfo *next; /* keep a linked list */
Display *display; /* which display this is */
XExtCodes *codes; /* the extension protocol codes */
XPointer data; /* extra data for extension to use */
typedef struct _XExtDisplayInfo
{
struct _XExtDisplayInfo* next; /* keep a linked list */
Display* display; /* which display this is */
XExtCodes* codes; /* the extension protocol codes */
XPointer data; /* extra data for extension to use */
} XExtDisplayInfo;
typedef struct _XExtensionInfo {
XExtDisplayInfo *head; /* start of list */
XExtDisplayInfo *cur; /* most recently used */
int ndisplays; /* number of displays */
typedef struct _XExtensionInfo
{
XExtDisplayInfo* head; /* start of list */
XExtDisplayInfo* cur; /* most recently used */
int ndisplays; /* number of displays */
} XExtensionInfo;
typedef struct _XExtensionHooks {
int (*create_gc)(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
);
int (*copy_gc)(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
);
int (*flush_gc)(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
);
int (*free_gc)(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
);
int (*create_font)(
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
);
int (*free_font)(
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
);
int (*close_display)(
Display* /* display */,
XExtCodes* /* codes */
);
Bool (*wire_to_event)(
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
);
Status (*event_to_wire)(
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
);
int (*error)(
Display* /* display */,
xError* /* err */,
XExtCodes* /* codes */,
int* /* ret_code */
);
char *(*error_string)(
Display* /* display */,
int /* code */,
XExtCodes* /* codes */,
char* /* buffer */,
int /* nbytes */
);
typedef struct _XExtensionHooks
{
int (*create_gc)(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
);
int (*copy_gc)(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
);
int (*flush_gc)(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
);
int (*free_gc)(
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
);
int (*create_font)(
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
);
int (*free_font)(
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
);
int (*close_display)(
Display* /* display */,
XExtCodes* /* codes */
);
Bool (*wire_to_event)(
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
);
Status (*event_to_wire)(
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
);
int (*error)(
Display* /* display */,
xError* /* err */,
XExtCodes* /* codes */,
int* /* ret_code */
);
char* (*error_string)(
Display* /* display */,
int /* code */,
XExtCodes* /* codes */,
char* /* buffer */,
int /* nbytes */
);
} XExtensionHooks;
extern XExtensionInfo *XextCreateExtension(
void
);
extern XExtensionInfo* XextCreateExtension(
void);
extern void XextDestroyExtension(
XExtensionInfo* /* info */
XExtensionInfo* /* info */
);
extern XExtDisplayInfo *XextAddDisplay(
XExtensionInfo* /* extinfo */,
Display* /* dpy */,
_Xconst char* /* ext_name */,
XExtensionHooks* /* hooks */,
int /* nevents */,
XPointer /* data */
extern XExtDisplayInfo* XextAddDisplay(
XExtensionInfo* /* extinfo */,
Display* /* dpy */,
_Xconst char* /* ext_name */,
XExtensionHooks* /* hooks */,
int /* nevents */,
XPointer /* data */
);
extern int XextRemoveDisplay(
XExtensionInfo* /* extinfo */,
Display* /* dpy */
XExtensionInfo* /* extinfo */,
Display* /* dpy */
);
extern XExtDisplayInfo *XextFindDisplay(
XExtensionInfo* /* extinfo */,
Display* /* dpy */
extern XExtDisplayInfo* XextFindDisplay(
XExtensionInfo* /* extinfo */,
Display* /* dpy */
);
#define XextHasExtension(i) ((i) && ((i)->codes))
#define XextCheckExtension(dpy,i,name,val) \
if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return val; }
#define XextSimpleCheckExtension(dpy,i,name) \
if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return; }
#define XextCheckExtension(dpy, i, name, val) \
if (!XextHasExtension(i)) \
{ \
XMissingExtension(dpy, name); \
return val; \
}
#define XextSimpleCheckExtension(dpy, i, name) \
if (!XextHasExtension(i)) \
{ \
XMissingExtension(dpy, name); \
return; \
}
/*
* helper macros to generate code that is common to all extensions; caller
@@ -150,41 +159,45 @@ extern XExtDisplayInfo *XextFindDisplay(
* could be a utility function, but have to stack 6 unused arguments for
* something that is called many, many times would be bad.
*/
#define XEXT_GENERATE_FIND_DISPLAY(proc,extinfo,extname,hooks,nev,data) \
XExtDisplayInfo *proc (Display *dpy) \
{ \
XExtDisplayInfo *dpyinfo; \
if (!extinfo) { if (!(extinfo = XextCreateExtension())) return NULL; } \
if (!(dpyinfo = XextFindDisplay (extinfo, dpy))) \
dpyinfo = XextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \
return dpyinfo; \
}
#define XEXT_GENERATE_FIND_DISPLAY(proc, extinfo, extname, hooks, nev, data) \
XExtDisplayInfo* proc(Display* dpy) \
{ \
XExtDisplayInfo* dpyinfo; \
if (!extinfo) \
{ \
if (!(extinfo = XextCreateExtension())) return NULL; \
} \
if (!(dpyinfo = XextFindDisplay(extinfo, dpy))) \
dpyinfo = XextAddDisplay(extinfo, dpy, extname, hooks, nev, data); \
return dpyinfo; \
}
#define XEXT_FIND_DISPLAY_PROTO(proc) \
XExtDisplayInfo *proc(Display *dpy)
XExtDisplayInfo* proc(Display* dpy)
#define XEXT_GENERATE_CLOSE_DISPLAY(proc,extinfo) \
int proc (Display *dpy, XExtCodes *codes) \
{ \
return XextRemoveDisplay (extinfo, dpy); \
}
#define XEXT_GENERATE_CLOSE_DISPLAY(proc, extinfo) \
int proc(Display* dpy, XExtCodes* codes) \
{ \
return XextRemoveDisplay(extinfo, dpy); \
}
#define XEXT_CLOSE_DISPLAY_PROTO(proc) \
int proc(Display *dpy, XExtCodes *codes)
int proc(Display* dpy, XExtCodes* codes)
#define XEXT_GENERATE_ERROR_STRING(proc,extname,nerr,errl) \
char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \
{ \
code -= codes->first_error; \
if (code >= 0 && code < nerr) { \
char tmp[256]; \
sprintf (tmp, "%s.%d", extname, code); \
XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
return buf; \
} \
return (char *)0; \
}
#define XEXT_GENERATE_ERROR_STRING(proc, extname, nerr, errl) \
char* proc(Display* dpy, int code, XExtCodes* codes, char* buf, int n) \
{ \
code -= codes->first_error; \
if (code >= 0 && code < nerr) \
{ \
char tmp[256]; \
sprintf(tmp, "%s.%d", extname, code); \
XGetErrorDatabaseText(dpy, "XProtoError", tmp, errl[code], buf, n); \
return buf; \
} \
return (char*)0; \
}
#define XEXT_ERROR_STRING_PROTO(proc) \
char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n)
char* proc(Display* dpy, int code, XExtCodes* codes, char* buf, int n)
#endif

View File

@@ -33,116 +33,117 @@ in this Software without prior written authorization from The Open Group.
#ifndef _SHAPE_SERVER_
#include <X11/Xutil.h>
typedef struct {
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came frome a SendEvent request */
Display *display; /* Display the event was read from */
Window window; /* window of event */
int kind; /* ShapeBounding or ShapeClip */
int x, y; /* extents of new region */
unsigned width, height;
Time time; /* server timestamp when region changed */
Bool shaped; /* true if the region exists */
typedef struct
{
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came frome a SendEvent request */
Display* display; /* Display the event was read from */
Window window; /* window of event */
int kind; /* ShapeBounding or ShapeClip */
int x, y; /* extents of new region */
unsigned width, height;
Time time; /* server timestamp when region changed */
Bool shaped; /* true if the region exists */
} XShapeEvent;
_XFUNCPROTOBEGIN
extern Bool XShapeQueryExtension (
Display* /* display */,
int* /* event_base */,
int* /* error_base */
extern Bool XShapeQueryExtension(
Display* /* display */,
int* /* event_base */,
int* /* error_base */
);
extern Status XShapeQueryVersion (
Display* /* display */,
int* /* major_version */,
int* /* minor_version */
extern Status XShapeQueryVersion(
Display* /* display */,
int* /* major_version */,
int* /* minor_version */
);
extern void XShapeCombineRegion (
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */,
Region /* region */,
int /* op */
extern void XShapeCombineRegion(
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */,
Region /* region */,
int /* op */
);
extern void XShapeCombineRectangles (
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */,
XRectangle* /* rectangles */,
int /* n_rects */,
int /* op */,
int /* ordering */
extern void XShapeCombineRectangles(
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */,
XRectangle* /* rectangles */,
int /* n_rects */,
int /* op */,
int /* ordering */
);
extern void XShapeCombineMask (
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */,
Pixmap /* src */,
int /* op */
extern void XShapeCombineMask(
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */,
Pixmap /* src */,
int /* op */
);
extern void XShapeCombineShape (
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */,
Window /* src */,
int /* src_kind */,
int /* op */
extern void XShapeCombineShape(
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */,
Window /* src */,
int /* src_kind */,
int /* op */
);
extern void XShapeOffsetShape (
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */
extern void XShapeOffsetShape(
Display* /* display */,
Window /* dest */,
int /* dest_kind */,
int /* x_off */,
int /* y_off */
);
extern Status XShapeQueryExtents (
Display* /* display */,
Window /* window */,
Bool* /* bounding_shaped */,
int* /* x_bounding */,
int* /* y_bounding */,
unsigned int* /* w_bounding */,
unsigned int* /* h_bounding */,
Bool* /* clip_shaped */,
int* /* x_clip */,
int* /* y_clip */,
unsigned int* /* w_clip */,
unsigned int* /* h_clip */
extern Status XShapeQueryExtents(
Display* /* display */,
Window /* window */,
Bool* /* bounding_shaped */,
int* /* x_bounding */,
int* /* y_bounding */,
unsigned int* /* w_bounding */,
unsigned int* /* h_bounding */,
Bool* /* clip_shaped */,
int* /* x_clip */,
int* /* y_clip */,
unsigned int* /* w_clip */,
unsigned int* /* h_clip */
);
extern void XShapeSelectInput (
Display* /* display */,
Window /* window */,
unsigned long /* mask */
extern void XShapeSelectInput(
Display* /* display */,
Window /* window */,
unsigned long /* mask */
);
extern unsigned long XShapeInputSelected (
Display* /* display */,
Window /* window */
extern unsigned long XShapeInputSelected(
Display* /* display */,
Window /* window */
);
extern XRectangle *XShapeGetRectangles (
Display* /* display */,
Window /* window */,
int /* kind */,
int* /* count */,
int* /* ordering */
extern XRectangle* XShapeGetRectangles(
Display* /* display */,
Window /* window */,
int /* kind */,
int* /* count */,
int* /* ordering */
);
_XFUNCPROTOEND

View File

@@ -34,22 +34,22 @@ in this Software without prior written authorization from The Open Group.
#define SHAPENAME "SHAPE"
#define SHAPE_MAJOR_VERSION 1 /* current version numbers */
#define SHAPE_MINOR_VERSION 1
#define SHAPE_MAJOR_VERSION 1 /* current version numbers */
#define SHAPE_MINOR_VERSION 1
#define ShapeSet 0
#define ShapeUnion 1
#define ShapeIntersect 2
#define ShapeSubtract 3
#define ShapeInvert 4
#define ShapeSet 0
#define ShapeUnion 1
#define ShapeIntersect 2
#define ShapeSubtract 3
#define ShapeInvert 4
#define ShapeBounding 0
#define ShapeClip 1
#define ShapeInput 2
#define ShapeBounding 0
#define ShapeClip 1
#define ShapeInput 2
#define ShapeNotifyMask (1L << 0)
#define ShapeNotify 0
#define ShapeNotifyMask (1L << 0)
#define ShapeNotify 0
#define ShapeNumberEvents (ShapeNotify + 1)
#define ShapeNumberEvents (ShapeNotify + 1)
#endif /* _SHAPECONST_H_ */

View File

@@ -31,14 +31,13 @@ in this Software without prior written authorization from The Open Group.
#define SHMNAME "MIT-SHM"
#define SHM_MAJOR_VERSION 1 /* current version numbers */
#define SHM_MINOR_VERSION 2
#define SHM_MAJOR_VERSION 1 /* current version numbers */
#define SHM_MINOR_VERSION 2
#define ShmCompletion 0
#define ShmNumberEvents (ShmCompletion + 1)
#define BadShmSeg 0
#define ShmNumberErrors (BadShmSeg + 1)
#define ShmCompletion 0
#define ShmNumberEvents (ShmCompletion + 1)
#define BadShmSeg 0
#define ShmNumberErrors (BadShmSeg + 1)
#endif /* _SHM_H_ */