Skip to content

Commit dbbe658

Browse files
committed
Remove the Must_have_memory hack.
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.
1 parent a516365 commit dbbe658

File tree

7 files changed

+15
-37
lines changed

7 files changed

+15
-37
lines changed

nx-X11/programs/Xserver/Xi/chgkbd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,9 @@ ProcXChangeKeyboardDevice(register ClientPtr client)
153153
df->time = xf->time;
154154
df->traceGood = xf->traceGood;
155155
if (df->traceSize != xf->traceSize) {
156-
Must_have_memory = TRUE; /* XXX */
157156
df->trace = (WindowPtr *) realloc(df->trace,
158157
xf->traceSize *
159158
sizeof(WindowPtr));
160-
Must_have_memory = FALSE; /* XXX */
161159
}
162160
df->traceSize = xf->traceSize;
163161
for (i = 0; i < df->traceSize; i++)

nx-X11/programs/Xserver/dix/events.c

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,10 +1947,8 @@ XYToWindow(int x, int y)
19471947
if (spriteTraceGood >= spriteTraceSize)
19481948
{
19491949
spriteTraceSize += 10;
1950-
Must_have_memory = TRUE; /* XXX */
1951-
spriteTrace = (WindowPtr *)realloc(
1950+
spriteTrace = realloc(
19521951
spriteTrace, spriteTraceSize*sizeof(WindowPtr));
1953-
Must_have_memory = FALSE; /* XXX */
19541952
}
19551953
spriteTrace[spriteTraceGood++] = pWin;
19561954
pWin = pWin->firstChild;
@@ -2464,11 +2462,9 @@ CheckPassiveGrabsOnWindow(
24642462
{
24652463
if (device->sync.evcount < count)
24662464
{
2467-
Must_have_memory = TRUE; /* XXX */
2468-
device->sync.event = (xEvent *)realloc(device->sync.event,
2469-
count*
2470-
sizeof(xEvent));
2471-
Must_have_memory = FALSE; /* XXX */
2465+
device->sync.event = realloc(device->sync.event,
2466+
count*
2467+
sizeof(xEvent));
24722468
}
24732469
device->sync.evcount = count;
24742470
for (dxE = device->sync.event; --count >= 0; dxE++, xE++)
@@ -2636,10 +2632,8 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev,
26362632
FreezeThaw(thisDev, TRUE);
26372633
if (thisDev->sync.evcount < count)
26382634
{
2639-
Must_have_memory = TRUE; /* XXX */
2640-
thisDev->sync.event = (xEvent *)realloc(thisDev->sync.event,
2641-
count*sizeof(xEvent));
2642-
Must_have_memory = FALSE; /* XXX */
2635+
thisDev->sync.event = realloc(thisDev->sync.event,
2636+
count*sizeof(xEvent));
26432637
}
26442638
thisDev->sync.evcount = count;
26452639
for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++)
@@ -3514,11 +3508,8 @@ SetInputFocus(
35143508
if (depth > focus->traceSize)
35153509
{
35163510
focus->traceSize = depth+1;
3517-
Must_have_memory = TRUE; /* XXX */
3518-
focus->trace = (WindowPtr *)realloc(focus->trace,
3519-
focus->traceSize *
3520-
sizeof(WindowPtr));
3521-
Must_have_memory = FALSE; /* XXX */
3511+
focus->trace = realloc(focus->trace,
3512+
focus->traceSize * sizeof(WindowPtr));
35223513
}
35233514
focus->traceGood = depth;
35243515
for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--)

nx-X11/programs/Xserver/hw/nxagent/NXevents.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,8 @@ XYToWindow(int x, int y)
298298
if (spriteTraceGood >= spriteTraceSize)
299299
{
300300
spriteTraceSize += 10;
301-
Must_have_memory = TRUE; /* XXX */
302-
spriteTrace = (WindowPtr *)realloc(
301+
spriteTrace = realloc(
303302
spriteTrace, spriteTraceSize*sizeof(WindowPtr));
304-
Must_have_memory = FALSE; /* XXX */
305303
}
306304
spriteTrace[spriteTraceGood++] = pWin;
307305
pWin = pWin->firstChild;

nx-X11/programs/Xserver/include/globals.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ extern int monitorResolution;
2020
extern Bool loadableFonts;
2121
extern int defaultColorVisualClass;
2222

23-
extern Bool Must_have_memory;
2423
extern int GrabInProgress;
2524
extern char *ConnectionInfo;
2625
extern Bool noTestExtensions;

nx-X11/programs/Xserver/mi/micursor.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ SOFTWARE.
5353
#include "misc.h"
5454
#include "mi.h"
5555

56-
extern Bool Must_have_memory;
57-
5856
void
5957
miRecolorCursor( pScr, pCurs, displayed)
6058
ScreenPtr pScr;
@@ -65,11 +63,9 @@ miRecolorCursor( pScr, pCurs, displayed)
6563
* This is guaranteed to correct any color-dependent state which may have
6664
* been bound up in private state created by RealizeCursor
6765
*/
68-
(* pScr->UnrealizeCursor)( pScr, pCurs);
69-
Must_have_memory = TRUE; /* XXX */
70-
(* pScr->RealizeCursor)( pScr, pCurs);
71-
Must_have_memory = FALSE; /* XXX */
72-
if ( displayed)
73-
(* pScr->DisplayCursor)( pScr, pCurs);
66+
pScr->UnrealizeCursor(pScr, pCurs);
67+
pScr->RealizeCursor(pScr, pCurs);
68+
if (displayed)
69+
pScr->DisplayCursor(pScr, pCurs);
7470

7571
}

nx-X11/programs/Xserver/mi/migc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@ miCreateGCOps(prototype)
6868
{
6969
GCOpsPtr ret;
7070

71-
/* XXX */ Must_have_memory = TRUE;
72-
ret = (GCOpsPtr) malloc(sizeof(GCOps));
73-
/* XXX */ Must_have_memory = FALSE;
71+
ret = malloc(sizeof(GCOps));
7472
if (!ret)
75-
return 0;
73+
return NULL;
7674
*ret = *prototype;
7775
ret->devPrivate.val = 1;
7876
return ret;

nx-X11/programs/Xserver/os/utils.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ Bool PanoramiXExtensionDisabledHack = FALSE;
257257

258258
int auditTrailLevel = 1;
259259

260-
Bool Must_have_memory = FALSE;
261-
262260
#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
263261
#define HAS_SAVED_IDS_AND_SETEUID
264262
#endif

0 commit comments

Comments
 (0)