Skip to content

Commit

Permalink
Remove the Must_have_memory hack.
Browse files Browse the repository at this point in the history
We are not using any alloc function that respects that variable, so lets drop it. This

  commit 0ce61e21d6d7dcca0090e319bbcdb678570f2c3f
  Author: Adam Jackson <[email protected]>
  Date:   Fri Oct 3 16:05:19 2008 -0400

    Remove the Must_have_memory hack.

    Also remove an astonishing amount of misunderstanding of how casts work.
  • Loading branch information
uli42 committed May 31, 2019
1 parent 57f63f4 commit 92eb55c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 37 deletions.
2 changes: 0 additions & 2 deletions nx-X11/programs/Xserver/Xi/chgkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,9 @@ ProcXChangeKeyboardDevice(register ClientPtr client)
df->time = xf->time;
df->traceGood = xf->traceGood;
if (df->traceSize != xf->traceSize) {
Must_have_memory = TRUE; /* XXX */
df->trace = (WindowPtr *) realloc(df->trace,
xf->traceSize *
sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
df->traceSize = xf->traceSize;
for (i = 0; i < df->traceSize; i++)
Expand Down
25 changes: 8 additions & 17 deletions nx-X11/programs/Xserver/dix/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1947,10 +1947,8 @@ XYToWindow(int x, int y)
if (spriteTraceGood >= spriteTraceSize)
{
spriteTraceSize += 10;
Must_have_memory = TRUE; /* XXX */
spriteTrace = (WindowPtr *)realloc(
spriteTrace = realloc(
spriteTrace, spriteTraceSize*sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
spriteTrace[spriteTraceGood++] = pWin;
pWin = pWin->firstChild;
Expand Down Expand Up @@ -2464,11 +2462,9 @@ CheckPassiveGrabsOnWindow(
{
if (device->sync.evcount < count)
{
Must_have_memory = TRUE; /* XXX */
device->sync.event = (xEvent *)realloc(device->sync.event,
count*
sizeof(xEvent));
Must_have_memory = FALSE; /* XXX */
device->sync.event = realloc(device->sync.event,
count*
sizeof(xEvent));
}
device->sync.evcount = count;
for (dxE = device->sync.event; --count >= 0; dxE++, xE++)
Expand Down Expand Up @@ -2636,10 +2632,8 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev,
FreezeThaw(thisDev, TRUE);
if (thisDev->sync.evcount < count)
{
Must_have_memory = TRUE; /* XXX */
thisDev->sync.event = (xEvent *)realloc(thisDev->sync.event,
count*sizeof(xEvent));
Must_have_memory = FALSE; /* XXX */
thisDev->sync.event = realloc(thisDev->sync.event,
count*sizeof(xEvent));
}
thisDev->sync.evcount = count;
for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++)
Expand Down Expand Up @@ -3514,11 +3508,8 @@ SetInputFocus(
if (depth > focus->traceSize)
{
focus->traceSize = depth+1;
Must_have_memory = TRUE; /* XXX */
focus->trace = (WindowPtr *)realloc(focus->trace,
focus->traceSize *
sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
focus->trace = realloc(focus->trace,
focus->traceSize * sizeof(WindowPtr));
}
focus->traceGood = depth;
for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--)
Expand Down
4 changes: 1 addition & 3 deletions nx-X11/programs/Xserver/hw/nxagent/NXevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,8 @@ XYToWindow(int x, int y)
if (spriteTraceGood >= spriteTraceSize)
{
spriteTraceSize += 10;
Must_have_memory = TRUE; /* XXX */
spriteTrace = (WindowPtr *)realloc(
spriteTrace = realloc(
spriteTrace, spriteTraceSize*sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
spriteTrace[spriteTraceGood++] = pWin;
pWin = pWin->firstChild;
Expand Down
1 change: 0 additions & 1 deletion nx-X11/programs/Xserver/include/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ extern int monitorResolution;
extern Bool loadableFonts;
extern int defaultColorVisualClass;

extern Bool Must_have_memory;
extern int GrabInProgress;
extern char *ConnectionInfo;
extern Bool noTestExtensions;
Expand Down
12 changes: 4 additions & 8 deletions nx-X11/programs/Xserver/mi/micursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ SOFTWARE.
#include "misc.h"
#include "mi.h"

extern Bool Must_have_memory;

void
miRecolorCursor( pScr, pCurs, displayed)
ScreenPtr pScr;
Expand All @@ -65,11 +63,9 @@ miRecolorCursor( pScr, pCurs, displayed)
* This is guaranteed to correct any color-dependent state which may have
* been bound up in private state created by RealizeCursor
*/
(* pScr->UnrealizeCursor)( pScr, pCurs);
Must_have_memory = TRUE; /* XXX */
(* pScr->RealizeCursor)( pScr, pCurs);
Must_have_memory = FALSE; /* XXX */
if ( displayed)
(* pScr->DisplayCursor)( pScr, pCurs);
pScr->UnrealizeCursor(pScr, pCurs);
pScr->RealizeCursor(pScr, pCurs);
if (displayed)
pScr->DisplayCursor(pScr, pCurs);

}
6 changes: 2 additions & 4 deletions nx-X11/programs/Xserver/mi/migc.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ miCreateGCOps(prototype)
{
GCOpsPtr ret;

/* XXX */ Must_have_memory = TRUE;
ret = (GCOpsPtr) malloc(sizeof(GCOps));
/* XXX */ Must_have_memory = FALSE;
ret = malloc(sizeof(GCOps));
if (!ret)
return 0;
return NULL;
*ret = *prototype;
ret->devPrivate.val = 1;
return ret;
Expand Down
2 changes: 0 additions & 2 deletions nx-X11/programs/Xserver/os/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ Bool PanoramiXExtensionDisabledHack = FALSE;

int auditTrailLevel = 1;

Bool Must_have_memory = FALSE;

#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
#define HAS_SAVED_IDS_AND_SETEUID
#endif
Expand Down

0 comments on commit 92eb55c

Please sign in to comment.