Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
ce40aec0
Commit
ce40aec0
authored
Jun 27, 2016
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nx-X11/programs/Xserver: Drop {X,x}calloc() macros, use calloc() instead.
parent
74a5450b
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
53 additions
and
62 deletions
+53
-62
nx-X11_lib_xtrans_Xtranssock.c.X.original
..._XOrg69_patches/nx-X11_lib_xtrans_Xtranssock.c.X.original
+1
-1
randr.NX.diff
doc/nx-X11_vs_XOrg69_patches/randr.NX.diff
+1
-1
Xtransdnet.c
nx-X11/lib/xtrans/Xtransdnet.c
+6
-6
Xtranslcl.c
nx-X11/lib/xtrans/Xtranslcl.c
+4
-4
Xtransos2.c
nx-X11/lib/xtrans/Xtransos2.c
+7
-7
Xtranssock.c
nx-X11/lib/xtrans/Xtranssock.c
+6
-6
Xtranstli.c
nx-X11/lib/xtrans/Xtranstli.c
+2
-2
transport.c
nx-X11/lib/xtrans/transport.c
+0
-1
panoramiX.c
nx-X11/programs/Xserver/Xext/panoramiX.c
+4
-4
panoramiXprocs.c
nx-X11/programs/Xserver/Xext/panoramiXprocs.c
+1
-1
listdev.c
nx-X11/programs/Xserver/Xi/listdev.c
+1
-1
dbe.c
nx-X11/programs/Xserver/dbe/dbe.c
+1
-1
colormap.c
nx-X11/programs/Xserver/dix/colormap.c
+1
-1
dispatch.c
nx-X11/programs/Xserver/dix/dispatch.c
+1
-1
main.c
nx-X11/programs/Xserver/dix/main.c
+2
-2
fbpseudocolor.c
nx-X11/programs/Xserver/fb/fbpseudocolor.c
+1
-1
mibank.c
nx-X11/programs/Xserver/mi/mibank.c
+2
-2
mioverlay.c
nx-X11/programs/Xserver/mi/mioverlay.c
+1
-1
randr.c
nx-X11/programs/Xserver/randr/randr.c
+1
-1
rrcrtc.c
nx-X11/programs/Xserver/randr/rrcrtc.c
+3
-3
rrmonitor.c
nx-X11/programs/Xserver/randr/rrmonitor.c
+5
-5
rrprovider.c
nx-X11/programs/Xserver/randr/rrprovider.c
+1
-1
set.c
nx-X11/programs/Xserver/record/set.c
+1
-9
No files found.
doc/nx-X11_vs_XOrg69_patches/nx-X11_lib_xtrans_Xtranssock.c.X.original
View file @
ce40aec0
...
...
@@ -312,7 +312,7 @@
+ fprintf(stderr, "SocketCreateConnInfo: Going to create the NX connection info.\n");
+#endif
+
+ if ((ciptr = (XtransConnInfo)
x
calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
+ if ((ciptr = (XtransConnInfo) calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
+ {
+ PRMSG (1, "SocketCreateConnInfo: malloc failed\n", 0, 0, 0);
+ return NULL;
...
...
doc/nx-X11_vs_XOrg69_patches/randr.NX.diff
View file @
ce40aec0
...
...
@@ -565,7 +565,7 @@ diff -u ./nx-X11/programs/Xserver/randr.X.original/randr.c ./nx-X11/programs/Xse
+ return FALSE;
- pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec));
+ pScrPriv = (rrScrPrivPtr)
x
calloc (1, sizeof (rrScrPrivRec));
+ pScrPriv = (rrScrPrivPtr) calloc (1, sizeof (rrScrPrivRec));
if (!pScrPriv)
return FALSE;
...
...
nx-X11/lib/xtrans/Xtransdnet.c
View file @
ce40aec0
...
...
@@ -187,7 +187,7 @@ TRANS(DNETOpenCOTSClient) (Xtransport *thistrans, char *protocol,
PRMSG
(
2
,
"DNETOpenCOTSClient(%s,%s,%s)
\n
"
,
protocol
,
host
,
port
);
if
((
ciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"DNETOpenCOTSClient: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
@@ -215,7 +215,7 @@ TRANS(DNETOpenCOTSServer) (Xtransport *thistrans, char *protocol,
PRMSG
(
2
,
"DNETOpenCOTSServer(%s,%s,%s)
\n
"
,
protocol
,
host
,
port
);
if
((
ciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"DNETOpenCOTSServer: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
@@ -247,7 +247,7 @@ TRANS(DNETOpenCLTSClient) (Xtransport *thistrans, char *protocol,
PRMSG
(
2
,
"DNETOpenCLTSClient(%s,%s,%s)
\n
"
,
protocol
,
host
,
port
);
if
((
ciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"DNETOpenCLTSClient: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
@@ -290,7 +290,7 @@ TRANS(DNETReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
PRMSG
(
2
,
"DNETReopenCOTSServer(%d,%s)
\n
"
,
fd
,
port
,
0
);
if
((
ciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"DNETReopenCOTSServer: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
@@ -311,7 +311,7 @@ TRANS(DNETReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
PRMSG
(
2
,
"DNETReopenCLTSServer(%d,%s)
\n
"
,
fd
,
port
,
0
);
if
((
ciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"DNETReopenCLTSServer: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
@@ -393,7 +393,7 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status)
PRMSG
(
2
,
"DNETAccept(%x,%d)
\n
"
,
ciptr
,
ciptr
->
fd
,
0
);
if
((
newciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
newciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"DNETAccept: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
nx-X11/lib/xtrans/Xtranslcl.c
View file @
ce40aec0
...
...
@@ -2038,7 +2038,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
*/
#endif
/* X11_t */
if
(
(
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"LocalOpenClient: calloc(1,%d) failed
\n
"
,
sizeof
(
struct
_XtransConnInfo
),
0
,
0
);
...
...
@@ -2113,7 +2113,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
*/
#endif
/* X11_t */
if
(
(
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"LocalOpenServer: calloc(1,%d) failed
\n
"
,
sizeof
(
struct
_XtransConnInfo
),
0
,
0
);
...
...
@@ -2168,7 +2168,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
PRMSG
(
2
,
"LocalReopenServer(%d,%d,%d)
\n
"
,
type
,
index
,
fd
);
if
(
(
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"LocalReopenServer: calloc(1,%d) failed
\n
"
,
sizeof
(
struct
_XtransConnInfo
),
0
,
0
);
...
...
@@ -2384,7 +2384,7 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
transptr
=
(
LOCALtrans2dev
*
)
ciptr
->
priv
;
if
(
(
newciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
newciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"LocalAccept: calloc(1,%d) failed
\n
"
,
sizeof
(
struct
_XtransConnInfo
),
0
,
0
);
...
...
nx-X11/lib/xtrans/Xtransos2.c
View file @
ce40aec0
...
...
@@ -90,7 +90,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
PRMSG
(
5
,
"Os2OpenClient: Creating pipe %s
\n
"
,
pipename
,
0
,
0
);
/* make a connection entry */
if
(
(
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
if
(
(
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"Os2OpenClient: calloc(1,%d) failed
\n
"
,
sizeof
(
struct
_XtransConnInfo
),
0
,
0
);
return
NULL
;
...
...
@@ -268,9 +268,9 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
PRMSG
(
2
,
"Os2OpenServer(%s,%s,%s)
\n
"
,
protocol
,
host
,
port
);
if
(
(
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"Os2OpenServer:
x
calloc(1,%d) failed
\n
"
,
PRMSG
(
1
,
"Os2OpenServer: calloc(1,%d) failed
\n
"
,
sizeof
(
struct
_XtransConnInfo
),
0
,
0
);
return
NULL
;
}
...
...
@@ -432,9 +432,9 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
PRMSG
(
2
,
"Os2ReopenCOTSServer(%d,%s)
\n
"
,
fd
,
port
,
0
);
if
(
(
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"Os2ReopenCOTSServer:
x
calloc(1,%d) failed
\n
"
,
PRMSG
(
1
,
"Os2ReopenCOTSServer: calloc(1,%d) failed
\n
"
,
sizeof
(
struct
_XtransConnInfo
),
0
,
0
);
return
NULL
;
}
...
...
@@ -508,9 +508,9 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
PRMSG
(
2
,
"Os2Accept(%x->%d)
\n
"
,
ciptr
,
ciptr
->
fd
,
0
);
if
(
(
newciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
newciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"Os2Accept:
x
calloc(1,%d) failed
\n
"
,
PRMSG
(
1
,
"Os2Accept: calloc(1,%d) failed
\n
"
,
sizeof
(
struct
_XtransConnInfo
),
0
,
0
);
*
status
=
TRANS_ACCEPT_BAD_MALLOC
;
return
NULL
;
...
...
nx-X11/lib/xtrans/Xtranssock.c
View file @
ce40aec0
...
...
@@ -601,7 +601,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
fprintf
(
stderr
,
"SocketCreateConnInfo: Going to create the NX connection info.
\n
"
);
#endif
if
((
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
((
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"SocketCreateConnInfo: malloc failed
\n
"
,
0
,
0
,
0
);
return
NULL
;
...
...
@@ -653,7 +653,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
exit
(
1
);
}
_NXProxyConnInfoTab
[
ciptr
->
fd
]
=
(
_NXProxyConnInfo
*
)
x
calloc
(
1
,
sizeof
(
_NXProxyConnInfo
));
_NXProxyConnInfoTab
[
ciptr
->
fd
]
=
(
_NXProxyConnInfo
*
)
calloc
(
1
,
sizeof
(
_NXProxyConnInfo
));
if
(
_NXProxyConnInfoTab
[
ciptr
->
fd
]
==
NULL
)
{
...
...
@@ -1063,7 +1063,7 @@ TRANS(SocketOpen) (int i, int type)
return
NULL
;
#endif
if
((
ciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"SocketOpen: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
@@ -1119,7 +1119,7 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
PRMSG
(
3
,
"SocketReopen(%d,%d,%s)
\n
"
,
type
,
fd
,
port
);
if
((
ciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"SocketReopen: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
@@ -1953,7 +1953,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
PRMSG
(
2
,
"SocketINETAccept(%p,%d)
\n
"
,
ciptr
,
ciptr
->
fd
,
0
);
if
((
newciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
newciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"SocketINETAccept: malloc failed
\n
"
,
0
,
0
,
0
);
...
...
@@ -2036,7 +2036,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
PRMSG
(
2
,
"SocketUNIXAccept(%p,%d)
\n
"
,
ciptr
,
ciptr
->
fd
,
0
);
if
((
newciptr
=
(
XtransConnInfo
)
x
calloc
(
if
((
newciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"SocketUNIXAccept: malloc() failed
\n
"
,
0
,
0
,
0
);
...
...
nx-X11/lib/xtrans/Xtranstli.c
View file @
ce40aec0
...
...
@@ -320,7 +320,7 @@ TRANS(TLIOpen)(char *device)
PRMSG
(
3
,
"TLIOpen(%s)
\n
"
,
device
,
0
,
0
);
if
(
(
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"TLIOpen: calloc failed
\n
"
,
0
,
0
,
0
);
return
NULL
;
...
...
@@ -353,7 +353,7 @@ TRANS(TLIReopen)(char *device, int fd, char *port)
return
NULL
;
}
if
(
(
ciptr
=
(
XtransConnInfo
)
x
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
if
(
(
ciptr
=
(
XtransConnInfo
)
calloc
(
1
,
sizeof
(
struct
_XtransConnInfo
)))
==
NULL
)
{
PRMSG
(
1
,
"TLIReopen: calloc failed
\n
"
,
0
,
0
,
0
);
return
NULL
;
...
...
nx-X11/lib/xtrans/transport.c
View file @
ce40aec0
...
...
@@ -59,7 +59,6 @@ from The Open Group.
#include "os.h"
#else
#include <stdlib.h>
#define xcalloc(_num,_size) calloc(_num,_size)
#endif
#include "Xtransint.h"
...
...
nx-X11/programs/Xserver/Xext/panoramiX.c
View file @
ce40aec0
...
...
@@ -525,7 +525,7 @@ void PanoramiXExtensionInit(int argc, char *argv[])
*/
panoramiXdataPtr
=
(
PanoramiXData
*
)
x
calloc
(
PanoramiXNumScreens
,
sizeof
(
PanoramiXData
));
calloc
(
PanoramiXNumScreens
,
sizeof
(
PanoramiXData
));
BREAK_IF
(
!
panoramiXdataPtr
);
BREAK_IF
((
PanoramiXGCIndex
=
AllocateGCPrivateIndex
())
<
0
);
...
...
@@ -769,16 +769,16 @@ void PanoramiXConsolidate(void)
Bool
foundDepth
,
missingDepth
;
if
(
!
PanoramiXVisualTable
)
PanoramiXVisualTable
=
x
calloc
(
256
*
MAXSCREENS
,
sizeof
(
XID
));
PanoramiXVisualTable
=
calloc
(
256
*
MAXSCREENS
,
sizeof
(
XID
));
pScreen
=
screenInfo
.
screens
[
0
];
pVisual
=
pScreen
->
visuals
;
pDepth
=
pScreen
->
allowedDepths
;
PanoramiXNumDepths
=
0
;
PanoramiXDepths
=
x
calloc
(
pScreen
->
numDepths
,
sizeof
(
DepthRec
));
PanoramiXDepths
=
calloc
(
pScreen
->
numDepths
,
sizeof
(
DepthRec
));
PanoramiXNumVisuals
=
0
;
PanoramiXVisuals
=
x
calloc
(
pScreen
->
numVisuals
,
sizeof
(
VisualRec
));
PanoramiXVisuals
=
calloc
(
pScreen
->
numVisuals
,
sizeof
(
VisualRec
));
for
(
i
=
0
;
i
<
pScreen
->
numDepths
;
i
++
,
pDepth
++
)
{
missingDepth
=
FALSE
;
...
...
nx-X11/programs/Xserver/Xext/panoramiXprocs.c
View file @
ce40aec0
...
...
@@ -1036,7 +1036,7 @@ int PanoramiXCopyArea(ClientPtr client)
VERIFY_DRAWABLE
(
drawables
[
j
],
src
->
info
[
j
].
id
,
client
);
pitch
=
PixmapBytePad
(
stuff
->
width
,
drawables
[
0
]
->
depth
);
if
(
!
(
data
=
x
calloc
(
1
,
stuff
->
height
*
pitch
)))
if
(
!
(
data
=
calloc
(
1
,
stuff
->
height
*
pitch
)))
return
BadAlloc
;
XineramaGetImageData
(
drawables
,
srcx
,
srcy
,
...
...
nx-X11/programs/Xserver/Xi/listdev.c
View file @
ce40aec0
...
...
@@ -129,7 +129,7 @@ ProcXListInputDevices (client)
SizeDeviceInfo
(
d
,
&
namesize
,
&
size
);
total_length
=
numdevs
*
sizeof
(
xDeviceInfo
)
+
size
+
namesize
;
devbuf
=
(
char
*
)
x
calloc
(
1
,
total_length
);
devbuf
=
(
char
*
)
calloc
(
1
,
total_length
);
classbuf
=
devbuf
+
(
numdevs
*
sizeof
(
xDeviceInfo
));
namebuf
=
classbuf
+
size
;
savbuf
=
devbuf
;
...
...
nx-X11/programs/Xserver/dbe/dbe.c
View file @
ce40aec0
...
...
@@ -1874,7 +1874,7 @@ DbeExtensionInit()
if
(
!
AllocateWindowPrivate
(
pScreen
,
dbeWindowPrivIndex
,
0
)
||
!
(
pDbeScreenPriv
=
(
DbeScreenPrivPtr
)
Xcalloc
(
sizeof
(
DbeScreenPrivRec
))))
(
DbeScreenPrivPtr
)
calloc
(
1
,
sizeof
(
DbeScreenPrivRec
))))
{
/* If we can not alloc a window or screen private,
* then free any privates that we already alloc'ed and return
...
...
nx-X11/programs/Xserver/dix/colormap.c
View file @
ce40aec0
...
...
@@ -395,7 +395,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
pmap
->
devPrivates
=
NULL
;
else
{
pmap
->
devPrivates
=
(
DevUnion
*
)
x
calloc
(
pmap
->
devPrivates
=
(
DevUnion
*
)
calloc
(
sizeof
(
DevUnion
),
colormapPrivateCount
);
if
(
!
pmap
->
devPrivates
)
{
...
...
nx-X11/programs/Xserver/dix/dispatch.c
View file @
ce40aec0
...
...
@@ -2188,7 +2188,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
xgi
.
length
=
length
;
if
(
im_return
)
{
pBuf
=
(
char
*
)
x
calloc
(
1
,
sz_xGetImageReply
+
length
);
pBuf
=
(
char
*
)
calloc
(
1
,
sz_xGetImageReply
+
length
);
if
(
!
pBuf
)
return
(
BadAlloc
);
if
(
widthBytesLine
==
0
)
...
...
nx-X11/programs/Xserver/dix/main.c
View file @
ce40aec0
...
...
@@ -689,11 +689,11 @@ AddScreen(
if
(
i
==
MAXSCREENS
)
return
-
1
;
pScreen
=
(
ScreenPtr
)
x
calloc
(
1
,
sizeof
(
ScreenRec
));
pScreen
=
(
ScreenPtr
)
calloc
(
1
,
sizeof
(
ScreenRec
));
if
(
!
pScreen
)
return
-
1
;
pScreen
->
devPrivates
=
(
DevUnion
*
)
x
calloc
(
sizeof
(
DevUnion
),
pScreen
->
devPrivates
=
(
DevUnion
*
)
calloc
(
sizeof
(
DevUnion
),
screenPrivateCount
);
if
(
!
pScreen
->
devPrivates
&&
screenPrivateCount
)
{
...
...
nx-X11/programs/Xserver/fb/fbpseudocolor.c
View file @
ce40aec0
...
...
@@ -1150,7 +1150,7 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy
pScrPriv
->
sync
=
sync
;
pScreen
->
maxInstalledCmaps
+=
MAX_NUM_XX_INSTALLED_CMAPS
;
pScrPriv
->
InstalledCmaps
=
x
calloc
(
MAX_NUM_XX_INSTALLED_CMAPS
,
pScrPriv
->
InstalledCmaps
=
calloc
(
MAX_NUM_XX_INSTALLED_CMAPS
,
sizeof
(
ColormapPtr
));
if
(
!
pScrPriv
->
InstalledCmaps
)
return
FALSE
;
...
...
nx-X11/programs/Xserver/mi/mibank.c
View file @
ce40aec0
...
...
@@ -2243,11 +2243,11 @@ miInitializeBanking(
(
sizeof
(
miBankGCRec
)
-
sizeof
(
RegionPtr
))))
return
FALSE
;
if
(
!
(
pScreenPriv
=
(
miBankScreenPtr
)
Xcalloc
(
sizeof
(
miBankScreenRec
))))
if
(
!
(
pScreenPriv
=
(
miBankScreenPtr
)
calloc
(
1
,
sizeof
(
miBankScreenRec
))))
return
FALSE
;
if
(
!
(
pScreenPriv
->
pBanks
=
/* Allocate and clear */
(
RegionPtr
*
)
Xcalloc
(
nBanks
*
sizeof
(
RegionPtr
))))
(
RegionPtr
*
)
calloc
(
1
,
nBanks
*
sizeof
(
RegionPtr
))))
{
free
(
pScreenPriv
);
return
FALSE
;
...
...
nx-X11/programs/Xserver/mi/mioverlay.c
View file @
ce40aec0
...
...
@@ -196,7 +196,7 @@ miOverlayCreateWindow(WindowPtr pWin)
pWinPriv
->
tree
=
NULL
;
if
(
!
pWin
->
parent
||
!
((
*
pScreenPriv
->
InOverlay
)(
pWin
)))
{
if
(
!
(
pTree
=
(
miOverlayTreePtr
)
x
calloc
(
1
,
sizeof
(
miOverlayTreeRec
))))
if
(
!
(
pTree
=
(
miOverlayTreePtr
)
calloc
(
1
,
sizeof
(
miOverlayTreeRec
))))
return
FALSE
;
}
...
...
nx-X11/programs/Xserver/randr/randr.c
View file @
ce40aec0
...
...
@@ -321,7 +321,7 @@ RRScreenInit(ScreenPtr pScreen)
if
(
!
RRInit
())
return
FALSE
;
pScrPriv
=
(
rrScrPrivPtr
)
x
calloc
(
1
,
sizeof
(
rrScrPrivRec
));
pScrPriv
=
(
rrScrPrivPtr
)
calloc
(
1
,
sizeof
(
rrScrPrivRec
));
if
(
!
pScrPriv
)
return
FALSE
;
...
...
nx-X11/programs/Xserver/randr/rrcrtc.c
View file @
ce40aec0
...
...
@@ -95,7 +95,7 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate)
return
FALSE
;
pScrPriv
->
crtcs
=
crtcs
;
crtc
=
x
calloc
(
1
,
sizeof
(
RRCrtcRec
));
crtc
=
calloc
(
1
,
sizeof
(
RRCrtcRec
));
if
(
!
crtc
)
return
NULL
;
crtc
->
id
=
FakeClientID
(
0
);
...
...
@@ -370,7 +370,7 @@ RRComputeContiguity(ScreenPtr pScreen)
Bool
discontiguous
=
TRUE
;
int
i
,
n
=
pScrPriv
->
numCrtcs
;
int
*
reachable
=
x
calloc
(
n
,
sizeof
(
int
));
int
*
reachable
=
calloc
(
n
,
sizeof
(
int
));
if
(
!
reachable
)
goto
out
;
...
...
@@ -1673,7 +1673,7 @@ ProcRRGetCrtcTransform(ClientPtr client)
nextra
=
(
transform_filter_length
(
pending
)
+
transform_filter_length
(
current
));
reply
=
x
calloc
(
1
,
sizeof
(
xRRGetCrtcTransformReply
)
+
nextra
);
reply
=
calloc
(
1
,
sizeof
(
xRRGetCrtcTransformReply
)
+
nextra
);
if
(
!
reply
)
return
BadAlloc
;
...
...
nx-X11/programs/Xserver/randr/rrmonitor.c
View file @
ce40aec0
...
...
@@ -95,7 +95,7 @@ RRMonitorSetFromServer(RRCrtcPtr crtc, RRMonitorPtr monitor)
monitor
->
name
=
RRMonitorCrtcName
(
crtc
);
monitor
->
pScreen
=
crtc
->
pScreen
;
monitor
->
numOutputs
=
crtc
->
numOutputs
;
monitor
->
outputs
=
x
calloc
(
crtc
->
numOutputs
,
sizeof
(
RRCrtc
));
monitor
->
outputs
=
calloc
(
crtc
->
numOutputs
,
sizeof
(
RRCrtc
));
if
(
!
monitor
->
outputs
)
return
FALSE
;
for
(
o
=
0
;
o
<
crtc
->
numOutputs
;
o
++
)
...
...
@@ -173,7 +173,7 @@ RRMonitorSetFromClient(RRMonitorPtr client_monitor, RRMonitorPtr monitor)
monitor
->
name
=
client_monitor
->
name
;
monitor
->
pScreen
=
client_monitor
->
pScreen
;
monitor
->
numOutputs
=
client_monitor
->
numOutputs
;
monitor
->
outputs
=
x
calloc
(
client_monitor
->
numOutputs
,
sizeof
(
RROutput
));
monitor
->
outputs
=
calloc
(
client_monitor
->
numOutputs
,
sizeof
(
RROutput
));
if
(
!
monitor
->
outputs
&&
client_monitor
->
numOutputs
)
return
FALSE
;
memcpy
(
monitor
->
outputs
,
client_monitor
->
outputs
,
client_monitor
->
numOutputs
*
sizeof
(
RROutput
));
...
...
@@ -216,7 +216,7 @@ RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active)
#endif
mon_list
->
num_crtcs
=
numCrtcs
;
mon_list
->
server_crtc
=
x
calloc
(
numCrtcs
*
2
,
sizeof
(
RRCrtcPtr
));
mon_list
->
server_crtc
=
calloc
(
numCrtcs
*
2
,
sizeof
(
RRCrtcPtr
));
if
(
!
mon_list
->
server_crtc
)
return
FALSE
;
...
...
@@ -321,7 +321,7 @@ RRMonitorMakeList(ScreenPtr screen, Bool get_active, RRMonitorPtr * monitors_ret
if
(
!
RRMonitorInitList
(
screen
,
&
list
,
get_active
))
return
FALSE
;
monitors
=
x
calloc
(
list
.
num_client
+
list
.
num_server
,
sizeof
(
RRMonitorRec
));
monitors
=
calloc
(
list
.
num_client
+
list
.
num_server
,
sizeof
(
RRMonitorRec
));
if
(
!
monitors
)
{
RRMonitorFiniList
(
&
list
);
return
FALSE
;
...
...
@@ -409,7 +409,7 @@ RRMonitorAlloc(int noutput)
{
RRMonitorPtr
monitor
;
monitor
=
x
calloc
(
1
,
sizeof
(
RRMonitorRec
)
+
noutput
*
sizeof
(
RROutput
));
monitor
=
calloc
(
1
,
sizeof
(
RRMonitorRec
)
+
noutput
*
sizeof
(
RROutput
));
if
(
!
monitor
)
return
NULL
;
monitor
->
numOutputs
=
noutput
;
...
...
nx-X11/programs/Xserver/randr/rrprovider.c
View file @
ce40aec0
...
...
@@ -380,7 +380,7 @@ RRProviderCreate(ScreenPtr pScreen, const char *name,
pScrPriv
=
rrGetScrPriv
(
pScreen
);
provider
=
x
calloc
(
1
,
sizeof
(
RRProviderRec
)
+
nameLength
+
1
);
provider
=
calloc
(
1
,
sizeof
(
RRProviderRec
)
+
nameLength
+
1
);
if
(
!
provider
)
return
NULL
;
...
...
nx-X11/programs/Xserver/record/set.c
View file @
ce40aec0
...
...
@@ -75,14 +75,6 @@ typedef unsigned short CARD16;
#define ALLOCATE_LOCAL malloc
#define DEALLOCATE_LOCAL free
void
*
Xcalloc
(
size
)
int
size
;
{
void
*
p
=
malloc
(
size
);
if
(
p
)
memset
(
p
,
0
,
size
);
return
p
;
}
#ifndef max
#define max(_a, _b) ( ((_a) > (_b)) ? (_a) : (_b) )
#endif
...
...
@@ -258,7 +250,7 @@ BitVectorCreateSet(pIntervals, nIntervals, pMem, memsize)
}
else
{
pbvs
=
(
BitVectorSetPtr
)
Xcalloc
(
memsize
);
pbvs
=
(
BitVectorSetPtr
)
calloc
(
1
,
memsize
);
if
(
!
pbvs
)
return
NULL
;
pbvs
->
baseSet
.
ops
=
&
BitVectorSetOperations
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment