Merge remote-tracking branch 'jeremyhu/master'
This commit is contained in:
commit
044a6ef2ff
|
@ -643,10 +643,10 @@ __glFloorLog2(GLuint val)
|
||||||
|
|
||||||
static void *opengl_framework_handle;
|
static void *opengl_framework_handle;
|
||||||
|
|
||||||
static glx_gpa_proc
|
static glx_func_ptr
|
||||||
get_proc_address(const char *sym)
|
get_proc_address(const char *sym)
|
||||||
{
|
{
|
||||||
return (glx_gpa_proc) dlsym(opengl_framework_handle, sym);
|
return (glx_func_ptr) dlsym(opengl_framework_handle, sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -70,6 +70,18 @@ xpbproxy_run(void);
|
||||||
static dispatch_queue_t eventTranslationQueue;
|
static dispatch_queue_t eventTranslationQueue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __has_feature
|
||||||
|
#define __has_feature(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CF_RETURNS_RETAINED
|
||||||
|
#if __has_feature(attribute_cf_returns_retained)
|
||||||
|
#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
|
||||||
|
#else
|
||||||
|
#define CF_RETURNS_RETAINED
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
extern Bool noTestExtensions;
|
extern Bool noTestExtensions;
|
||||||
extern Bool noRenderExtension;
|
extern Bool noRenderExtension;
|
||||||
extern BOOL serverRunning;
|
extern BOOL serverRunning;
|
||||||
|
@ -526,6 +538,7 @@ cfrelease(CFAllocatorRef a, const void *b)
|
||||||
CFRelease(b);
|
CFRelease(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CF_RETURNS_RETAINED
|
||||||
static CFMutableArrayRef
|
static CFMutableArrayRef
|
||||||
nsarray_to_cfarray(NSArray *in)
|
nsarray_to_cfarray(NSArray *in)
|
||||||
{
|
{
|
||||||
|
|
|
@ -934,7 +934,7 @@ extern char *bundle_id_prefix;
|
||||||
== NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
|
== NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) applicationWillTerminate:(NSNotification *)aNotification
|
- (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN
|
||||||
{
|
{
|
||||||
int remain;
|
int remain;
|
||||||
[X11App prefs_synchronize];
|
[X11App prefs_synchronize];
|
||||||
|
|
|
@ -378,6 +378,13 @@ ProcAppleWMSetWindowMenu(register ClientPtr client)
|
||||||
items = malloc(sizeof(char *) * nitems);
|
items = malloc(sizeof(char *) * nitems);
|
||||||
shortcuts = malloc(sizeof(char) * nitems);
|
shortcuts = malloc(sizeof(char) * nitems);
|
||||||
|
|
||||||
|
if (!items || !shortcuts) {
|
||||||
|
free(items);
|
||||||
|
free(shortcuts);
|
||||||
|
|
||||||
|
return BadAlloc;
|
||||||
|
}
|
||||||
|
|
||||||
max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq);
|
max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq);
|
||||||
bytes = (char *)&stuff[1];
|
bytes = (char *)&stuff[1];
|
||||||
|
|
||||||
|
@ -391,6 +398,15 @@ ProcAppleWMSetWindowMenu(register ClientPtr client)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if we bailed out of the above loop due to a request that was too long */
|
||||||
|
if (j < nitems) {
|
||||||
|
free(items);
|
||||||
|
free(shortcuts);
|
||||||
|
|
||||||
|
return BadRequest;
|
||||||
|
}
|
||||||
|
|
||||||
X11ApplicationSetWindowMenu(nitems, items, shortcuts);
|
X11ApplicationSetWindowMenu(nitems, items, shortcuts);
|
||||||
free(items);
|
free(items);
|
||||||
free(shortcuts);
|
free(shortcuts);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _DARWIN_FB_H
|
#ifndef _DARWIN_FB_H
|
||||||
#define _DARWIN_DB_H
|
#define _DARWIN_FB_H
|
||||||
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
|
||||||
|
|
|
@ -353,6 +353,10 @@ main(int argc, char **argv, char **envp)
|
||||||
newenvp = (string_array_t)calloc((1 + envpc), sizeof(string_t));
|
newenvp = (string_array_t)calloc((1 + envpc), sizeof(string_t));
|
||||||
|
|
||||||
if (!newargv || !newenvp) {
|
if (!newargv || !newenvp) {
|
||||||
|
/* Silence the clang static analyzer */
|
||||||
|
free(newargv);
|
||||||
|
free(newenvp);
|
||||||
|
|
||||||
asl_log(aslc, NULL, ASL_LEVEL_ERR,
|
asl_log(aslc, NULL, ASL_LEVEL_ERR,
|
||||||
"Xquartz: Memory allocation failure");
|
"Xquartz: Memory allocation failure");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
@ -109,11 +109,14 @@ Bool
|
||||||
QuartzAddScreen(int index,
|
QuartzAddScreen(int index,
|
||||||
ScreenPtr pScreen)
|
ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
// The clang static analyzer thinks we leak displayInfo here
|
||||||
|
#ifndef __clang_analyzer__
|
||||||
// allocate space for private per screen Quartz specific storage
|
// allocate space for private per screen Quartz specific storage
|
||||||
QuartzScreenPtr displayInfo = calloc(sizeof(QuartzScreenRec), 1);
|
QuartzScreenPtr displayInfo = calloc(sizeof(QuartzScreenRec), 1);
|
||||||
|
|
||||||
// QUARTZ_PRIV(pScreen) = displayInfo;
|
// QUARTZ_PRIV(pScreen) = displayInfo;
|
||||||
dixSetPrivate(&pScreen->devPrivates, quartzScreenKey, displayInfo);
|
dixSetPrivate(&pScreen->devPrivates, quartzScreenKey, displayInfo);
|
||||||
|
#endif /* __clang_analyzer__ */
|
||||||
|
|
||||||
// do Quartz mode specific initialization
|
// do Quartz mode specific initialization
|
||||||
return quartzProcs->AddScreen(index, pScreen);
|
return quartzProcs->AddScreen(index, pScreen);
|
||||||
|
|
|
@ -123,6 +123,10 @@ ProcAppleDRIQueryDirectRenderingCapable(register ClientPtr client)
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
|
if (stuff->screen >= screenInfo.numScreens) {
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!DRIQueryDirectRenderingCapable(screenInfo.screens[stuff->screen],
|
if (!DRIQueryDirectRenderingCapable(screenInfo.screens[stuff->screen],
|
||||||
&isCapable)) {
|
&isCapable)) {
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
@ -402,6 +406,7 @@ SProcAppleDRIQueryDirectRenderingCapable(register ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xAppleDRIQueryDirectRenderingCapableReq);
|
REQUEST(xAppleDRIQueryDirectRenderingCapableReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xAppleDRIQueryDirectRenderingCapableReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
return ProcAppleDRIQueryDirectRenderingCapable(client);
|
return ProcAppleDRIQueryDirectRenderingCapable(client);
|
||||||
}
|
}
|
||||||
|
@ -411,6 +416,7 @@ SProcAppleDRIAuthConnection(register ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xAppleDRIAuthConnectionReq);
|
REQUEST(xAppleDRIAuthConnectionReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
swapl(&stuff->magic);
|
swapl(&stuff->magic);
|
||||||
return ProcAppleDRIAuthConnection(client);
|
return ProcAppleDRIAuthConnection(client);
|
||||||
|
@ -421,6 +427,7 @@ SProcAppleDRICreateSurface(register ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xAppleDRICreateSurfaceReq);
|
REQUEST(xAppleDRICreateSurfaceReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
swapl(&stuff->client_id);
|
swapl(&stuff->client_id);
|
||||||
|
@ -432,6 +439,7 @@ SProcAppleDRIDestroySurface(register ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xAppleDRIDestroySurfaceReq);
|
REQUEST(xAppleDRIDestroySurfaceReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
return ProcAppleDRIDestroySurface(client);
|
return ProcAppleDRIDestroySurface(client);
|
||||||
|
@ -442,6 +450,7 @@ SProcAppleDRICreatePixmap(register ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xAppleDRICreatePixmapReq);
|
REQUEST(xAppleDRICreatePixmapReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xAppleDRICreatePixmapReq);
|
||||||
swapl(&stuff->screen);
|
swapl(&stuff->screen);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
return ProcAppleDRICreatePixmap(client);
|
return ProcAppleDRICreatePixmap(client);
|
||||||
|
@ -452,6 +461,7 @@ SProcAppleDRIDestroyPixmap(register ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xAppleDRIDestroyPixmapReq);
|
REQUEST(xAppleDRIDestroyPixmapReq);
|
||||||
swaps(&stuff->length);
|
swaps(&stuff->length);
|
||||||
|
REQUEST_SIZE_MATCH(xAppleDRIDestroyPixmapReq);
|
||||||
swapl(&stuff->drawable);
|
swapl(&stuff->drawable);
|
||||||
return ProcAppleDRIDestroyPixmap(client);
|
return ProcAppleDRIDestroyPixmap(client);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,34 +70,19 @@ X_PFX(hook_remove) (x_list * lst, x_hook_function * fun, void *data) {
|
||||||
|
|
||||||
X_EXTERN void
|
X_EXTERN void
|
||||||
X_PFX(hook_run) (x_list * lst, void *arg) {
|
X_PFX(hook_run) (x_list * lst, void *arg) {
|
||||||
x_list *node, *cell;
|
x_list *node;
|
||||||
x_hook_function **fun;
|
|
||||||
void **data;
|
|
||||||
int length, i;
|
|
||||||
|
|
||||||
if (!lst)
|
if (!lst)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
length = X_PFX(list_length) (lst);
|
for (node = lst; node != NULL; node = node->next) {
|
||||||
fun = malloc(sizeof(x_hook_function *) * length);
|
x_list *cell = node->data;
|
||||||
data = malloc(sizeof(void *) * length);
|
|
||||||
|
|
||||||
if (!fun || !data) {
|
x_hook_function *fun = CELL_FUN(cell);
|
||||||
FatalError("Failed to allocate memory in %s\n", __func__);
|
void *data = CELL_DATA(cell);
|
||||||
|
|
||||||
|
(*fun)(arg, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, node = lst; node != NULL; node = node->next, i++) {
|
|
||||||
cell = node->data;
|
|
||||||
fun[i] = CELL_FUN(cell);
|
|
||||||
data[i] = CELL_DATA(cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < length; i++) {
|
|
||||||
(*fun[i])(arg, data[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(fun);
|
|
||||||
free(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
X_EXTERN void
|
X_EXTERN void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user