Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
libX11
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
92
Issues
92
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xorg
lib
libX11
Commits
76850471
Commit
76850471
authored
Jul 19, 2015
by
Alan Coopersmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert src/xcms to use reallocarray()
Signed-off-by:
Alan Coopersmith
<
alan.coopersmith@oracle.com
>
parent
8a62e265
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
src/xcms/CvCols.c
src/xcms/CvCols.c
+2
-1
src/xcms/StCols.c
src/xcms/StCols.c
+2
-1
src/xcms/cmsInt.c
src/xcms/cmsInt.c
+3
-2
No files found.
src/xcms/CvCols.c
View file @
76850471
...
...
@@ -39,6 +39,7 @@
#include "Xlibint.h"
#include "Xcmsint.h"
#include "Cv.h"
#include "reallocarray.h"
/*
* LOCAL DEFINES
...
...
@@ -796,7 +797,7 @@ XcmsConvertColors(
* Make copy of array of color specifications
*/
if
(
nColors
>
1
)
{
pColors_tmp
=
Xmalloc
(
nColors
*
sizeof
(
XcmsColor
));
pColors_tmp
=
Xmalloc
array
(
nColors
,
sizeof
(
XcmsColor
));
}
else
{
pColors_tmp
=
&
Color1
;
}
...
...
src/xcms/StCols.c
View file @
76850471
...
...
@@ -38,6 +38,7 @@
#include "Xlibint.h"
#include "Xcmsint.h"
#include "Cv.h"
#include "reallocarray.h"
/************************************************************************
...
...
@@ -85,7 +86,7 @@ XcmsStoreColors(
* overwrite the contents.
*/
if
(
nColors
>
1
)
{
pColors_tmp
=
Xmalloc
(
nColors
*
sizeof
(
XcmsColor
));
pColors_tmp
=
Xmalloc
array
(
nColors
,
sizeof
(
XcmsColor
));
}
else
{
pColors_tmp
=
&
Color1
;
}
...
...
src/xcms/cmsInt.c
View file @
76850471
...
...
@@ -41,6 +41,7 @@
#include "Xlibint.h"
#include "Xcmsint.h"
#include "Cv.h"
#include "reallocarray.h"
#ifndef XCMSCOMPPROC
# define XCMSCOMPPROC XcmsTekHVCClipC
...
...
@@ -82,7 +83,7 @@ _XcmsCopyPointerArray(
for
(
tmp
=
pap
,
n
=
0
;
*
tmp
!=
NULL
;
tmp
++
,
n
++
);
n
++
;
/* add 1 to include the NULL pointer */
if
((
newArray
=
Xmalloc
(
n
*
sizeof
(
XPointer
))))
{
if
((
newArray
=
Xmalloc
array
(
n
,
sizeof
(
XPointer
))))
{
memcpy
((
char
*
)
newArray
,
(
char
*
)
pap
,
(
unsigned
)(
n
*
sizeof
(
XPointer
)));
}
...
...
@@ -141,7 +142,7 @@ _XcmsPushPointerArray(
/* add 2: 1 for the new pointer and another for the NULL pointer */
n
+=
2
;
if
((
newArray
=
Xmalloc
(
n
*
sizeof
(
XPointer
))))
{
if
((
newArray
=
Xmalloc
array
(
n
,
sizeof
(
XPointer
))))
{
memcpy
((
char
*
)(
newArray
+
1
),(
char
*
)
pap
,
(
unsigned
)((
n
-
1
)
*
sizeof
(
XPointer
)));
*
newArray
=
p
;
...
...
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