sync with OpenBSD -current

This commit is contained in:
purplerain 2025-01-10 01:40:29 +00:00
parent 4b49aefbb1
commit 1fd36b57f8
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
945 changed files with 81965 additions and 59988 deletions

View file

@ -50,16 +50,16 @@ ephyr_glamor_xv_stop_video(KdScreenInfo *screen, void *data, Bool cleanup)
static int
ephyr_glamor_xv_set_port_attribute(KdScreenInfo *screen,
Atom attribute, INT32 value, void *data)
Atom attribute, int value, void *data)
{
return glamor_xv_set_port_attribute(data, attribute, value);
return glamor_xv_set_port_attribute(data, attribute, (INT32)value);
}
static int
ephyr_glamor_xv_get_port_attribute(KdScreenInfo *screen,
Atom attribute, INT32 *value, void *data)
Atom attribute, int *value, void *data)
{
return glamor_xv_get_port_attribute(data, attribute, value);
return glamor_xv_get_port_attribute(data, attribute, (INT32 *)value);
}
static void

View file

@ -244,7 +244,7 @@ xf86SbusProbe(void)
* in the correct format for a SBUS bus id.
*/
Bool
static Bool
xf86ParseSbusBusString(const char *busID, int *fbNum)
{
/*
@ -316,7 +316,7 @@ xf86ParseSbusBusString(const char *busID, int *fbNum)
* Compare a BUS ID string with a SBUS bus id. Return TRUE if they match.
*/
Bool
static Bool
xf86CompareSbusBusString(const char *busID, int fbNum)
{
int iFbNum;
@ -333,7 +333,7 @@ xf86CompareSbusBusString(const char *busID, int fbNum)
* Check if the slot requested is free. If it is already in use, return FALSE.
*/
Bool
static Bool
xf86CheckSbusSlot(int fbNum)
{
int i;
@ -354,7 +354,7 @@ xf86CheckSbusSlot(int fbNum)
* Otherwise, claim the slot for the screen requesting it.
*/
int
static int
xf86ClaimSbusSlot(sbusDevicePtr psdp, DriverPtr drvp, GDevPtr dev, Bool active)
{
EntityPtr p = NULL;
@ -740,6 +740,7 @@ void
xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev)
{
char *promPath = NULL;
char *tmp;
sBus = (sbusDevicePtr) busData;
GDev->identifier = sBus->descr;
@ -748,10 +749,11 @@ xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev)
sparcPromClose();
}
if (promPath) {
XNFasprintf(&GDev->busID, "SBUS:%s", promPath);
XNFasprintf(&tmp, "SBUS:%s", promPath);
free(promPath);
}
else {
XNFasprintf(&GDev->busID, "SBUS:fb%d", sBus->fbNum);
XNFasprintf(&tmp, "SBUS:fb%d", sBus->fbNum);
}
GDev->busID = tmp;
}

View file

@ -1135,8 +1135,10 @@ handle_detailed_monset(struct detailed_monitor_section *det_mon, void *data)
p->Monitor->nHsync++;
}
else {
#ifdef SPAM_XORG_LOG
xf86DrvMsg(scrnIndex, X_INFO,
"Using hsync ranges from config file\n");
#endif
}
if (!p->have_vrefresh) {
@ -1150,8 +1152,10 @@ handle_detailed_monset(struct detailed_monitor_section *det_mon, void *data)
p->Monitor->nVrefresh++;
}
else {
#ifdef SPAM_XORG_LOG
xf86DrvMsg(scrnIndex, X_INFO,
"Using vrefresh ranges from config file\n");
#endif
}
clock = det_mon->section.ranges.max_clock * 1000;
@ -1198,6 +1202,7 @@ xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC)
xf86ForEachDetailedBlock(DDC, handle_detailed_monset, &p);
if (Modes) {
#ifdef SPAM_XORG_LOG
/* Print Modes */
xf86DrvMsg(scrnIndex, X_INFO, "Printing DDC gathered Modelines:\n");
@ -1206,7 +1211,7 @@ xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC)
xf86PrintModeline(scrnIndex, Mode);
Mode = Mode->next;
}
#endif
/* Do we still need ranges to be filled in? */
if (!Monitor->nHsync || !Monitor->nVrefresh)
DDCGuessRangesFromModes(scrnIndex, Monitor, Modes);

View file

@ -77,6 +77,8 @@ xf86parseDRISection(void)
break;
case COMMENT:
ptr->dri_comment = xf86addComment(ptr->dri_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
default:
Error(INVALID_KEYWORD_MSG, xf86tokenString());

View file

@ -106,6 +106,8 @@ xf86parseDeviceSection(void)
switch (token) {
case COMMENT:
ptr->dev_comment = xf86addComment(ptr->dev_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->dev_comment)) != STRING)

View file

@ -67,6 +67,8 @@ xf86parseExtensionsSection(void)
case COMMENT:
ptr->extensions_comment =
xf86addComment(ptr->extensions_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
default:
Error(INVALID_KEYWORD_MSG, xf86tokenString());

View file

@ -89,6 +89,8 @@ xf86parseFilesSection(void)
switch (token) {
case COMMENT:
ptr->file_comment = xf86addComment(ptr->file_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case FONTPATH:
if (xf86getSubToken(&(ptr->file_comment)) != STRING)

View file

@ -98,6 +98,8 @@ xf86parseFlagsSection(void)
switch (token) {
case COMMENT:
ptr->flg_comment = xf86addComment(ptr->flg_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
/*
* these old keywords are turned into standard generic options.
@ -436,18 +438,24 @@ xf86parseOption(XF86OptionPtr head)
if ((token = xf86getSubToken(&comment)) == STRING) {
option = xf86newOption(name, xf86_lex_val.str);
option->opt_comment = comment;
if ((token = xf86getToken(NULL)) == COMMENT)
if ((token = xf86getToken(NULL)) == COMMENT) {
option->opt_comment = xf86addComment(option->opt_comment, xf86_lex_val.str);
else
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
} else {
xf86unGetToken(token);
}
}
else {
option = xf86newOption(name, NULL);
option->opt_comment = comment;
if (token == COMMENT)
if (token == COMMENT) {
option->opt_comment = xf86addComment(option->opt_comment, xf86_lex_val.str);
else
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
} else {
xf86unGetToken(token);
}
}
old = NULL;

View file

@ -84,6 +84,8 @@ xf86parseInputSection(void)
switch (token) {
case COMMENT:
ptr->inp_comment = xf86addComment(ptr->inp_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->inp_comment)) != STRING)

View file

@ -191,6 +191,8 @@ xf86parseInputClassSection(void)
switch (token) {
case COMMENT:
ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->comment)) != STRING)

View file

@ -101,6 +101,8 @@ xf86parseLayoutSection(void)
switch (token) {
case COMMENT:
ptr->lay_comment = xf86addComment(ptr->lay_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->lay_comment)) != STRING)

View file

@ -95,6 +95,8 @@ xf86parseModuleSubSection(XF86LoadPtr head, char *name)
switch (token) {
case COMMENT:
ptr->load_comment = xf86addComment(ptr->load_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case OPTION:
ptr->load_opt = xf86parseOption(ptr->load_opt);
@ -126,6 +128,8 @@ xf86parseModuleSection(void)
switch (token) {
case COMMENT:
ptr->mod_comment = xf86addComment(ptr->mod_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case LOAD:
if (xf86getSubToken(&(ptr->mod_comment)) != STRING)
@ -230,10 +234,13 @@ xf86addNewLoadDirective(XF86LoadPtr head, const char *name, int type,
new->ignore = 0;
new->list.next = NULL;
if ((token = xf86getToken(NULL)) == COMMENT)
if ((token = xf86getToken(NULL)) == COMMENT) {
new->load_comment = xf86addComment(new->load_comment, xf86_lex_val.str);
else
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
} else {
xf86unGetToken(token);
}
return ((XF86LoadPtr) xf86addListItem((glp) head, (glp) new));
}

View file

@ -269,6 +269,8 @@ xf86parseVerboseMode(void)
switch (token) {
case COMMENT:
ptr->ml_comment = xf86addComment(ptr->ml_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case DOTCLOCK:
if ((token = xf86getSubToken(&(ptr->ml_comment))) != NUMBER)
@ -413,6 +415,8 @@ xf86parseMonitorSection(void)
switch (token) {
case COMMENT:
ptr->mon_comment = xf86addComment(ptr->mon_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->mon_comment)) != STRING)
@ -599,6 +603,8 @@ xf86parseModesSection(void)
switch (token) {
case COMMENT:
ptr->modes_comment = xf86addComment(ptr->modes_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->modes_comment)) != STRING)

View file

@ -102,6 +102,8 @@ xf86parseOutputClassSection(void)
switch (token) {
case COMMENT:
ptr->comment = xf86addComment(ptr->comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->comment)) != STRING)

View file

@ -104,6 +104,8 @@ xf86parsePointerSection(void)
switch (token) {
case COMMENT:
ptr->inp_comment = xf86addComment(ptr->inp_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case PROTOCOL:
if (xf86getSubToken(&(ptr->inp_comment)) != STRING)

View file

@ -119,6 +119,8 @@ xf86parseDisplaySubSection(void)
switch (token) {
case COMMENT:
ptr->disp_comment = xf86addComment(ptr->disp_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case VIEWPORT:
if (xf86getSubToken(&(ptr->disp_comment)) != NUMBER)
@ -256,6 +258,8 @@ xf86parseScreenSection(void)
switch (token) {
case COMMENT:
ptr->scrn_comment = xf86addComment(ptr->scrn_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)

View file

@ -98,6 +98,8 @@ xf86parseVendorSubSection(void)
switch (token) {
case COMMENT:
ptr->vs_comment = xf86addComment(ptr->vs_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->vs_comment)))
@ -151,6 +153,8 @@ xf86parseVendorSection(void)
switch (token) {
case COMMENT:
ptr->vnd_comment = xf86addComment(ptr->vnd_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->vnd_comment)) != STRING)

View file

@ -97,6 +97,8 @@ xf86parseVideoPortSubSection(void)
switch (token) {
case COMMENT:
ptr->vp_comment = xf86addComment(ptr->vp_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->vp_comment)) != STRING)
@ -154,6 +156,8 @@ xf86parseVideoAdaptorSection(void)
switch (token) {
case COMMENT:
ptr->va_comment = xf86addComment(ptr->va_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case IDENTIFIER:
if (xf86getSubToken(&(ptr->va_comment)) != STRING)

View file

@ -100,6 +100,8 @@ xf86readConfigFile(void)
switch (token) {
case COMMENT:
ptr->conf_comment = xf86addComment(ptr->conf_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
case SECTION:
if (xf86getSubToken(&(ptr->conf_comment)) != STRING) {

View file

@ -332,10 +332,10 @@ xf86getToken(const xf86ConfigSymTabRec * tab)
}
while ((c != '\n') && (c != '\r') && (c != '\0'));
configRBuf[i] = '\0';
/* XXX no private copy.
/* XXX private copy.
* Use xf86addComment when setting a comment.
*/
xf86_lex_val.str = configRBuf;
xf86_lex_val.str = strdup(configRBuf);
return COMMENT;
}
@ -448,8 +448,11 @@ xf86getSubToken(char **comment)
for (;;) {
token = xf86getToken(NULL);
if (token == COMMENT) {
if (comment)
if (comment) {
*comment = xf86addComment(*comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
}
}
else
return token;
@ -464,8 +467,11 @@ xf86getSubTokenWithTab(char **comment, const xf86ConfigSymTabRec * tab)
for (;;) {
token = xf86getToken(tab);
if (token == COMMENT) {
if (comment)
if (comment) {
*comment = xf86addComment(*comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
}
}
else
return token;

View file

@ -98,7 +98,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
bg_color.green = pCursor->backGreen;
bg_color.blue = pCursor->backBlue;
xnestSetCursorPriv(pCursor, pScreen, malloc(sizeof(xnestPrivCursor)));
xnestSetCursorPriv(pCursor, pScreen, calloc(1, sizeof(xnestPrivCursor)));
xnestCursor(pCursor, pScreen) =
XCreatePixmapCursor(xnestDisplay, source, mask, &fg_color, &bg_color,
pCursor->bits->xhot, pCursor->bits->yhot);

View file

@ -94,7 +94,7 @@ xnestCollectExposures(void)
RegionInit(&Rgn, &Box, 1);
miSendExposures(pWin, &Rgn, Box.x2, Box.y2);
miSendExposures(pWin, &Rgn, Box.x1, Box.y1);
}
}
}