Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
5ec2ad13
Commit
5ec2ad13
authored
May 28, 2014
by
Uwe Schulzweida
Browse files
cast result of xrealloc
parent
03bdee6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/resource_handle.c
View file @
5ec2ad13
...
...
@@ -42,11 +42,13 @@ typedef struct listElem {
int
status
;
}
listElem_t
;
st
atic
struc
t
st
ruct
resHList_
t
{
int
size
,
freeHead
,
hasDefaultRes
;
listElem_t
*
resources
;
}
*
resHList
;
};
static
struct
resHList_t
*
resHList
;
static
int
resHListSize
=
0
;
...
...
@@ -94,7 +96,7 @@ listInitResources(int nsp)
xassert
(
nsp
<
resHListSize
&&
nsp
>=
0
);
int
size
=
resHList
[
nsp
].
size
=
MIN_LIST_SIZE
;
xassert
(
resHList
[
nsp
].
resources
==
NULL
);
resHList
[
nsp
].
resources
=
xcalloc
(
MIN_LIST_SIZE
,
sizeof
(
listElem_t
));
resHList
[
nsp
].
resources
=
(
listElem_t
*
)
xcalloc
(
MIN_LIST_SIZE
,
sizeof
(
listElem_t
));
listElem_t
*
p
=
resHList
[
nsp
].
resources
;
for
(
int
i
=
0
;
i
<
size
;
i
++
)
...
...
@@ -128,7 +130,7 @@ reshListCreate(int namespaceID)
LIST_LOCK
();
if
(
resHListSize
<=
namespaceID
)
{
resHList
=
xrealloc
(
resHList
,
(
namespaceID
+
1
)
*
sizeof
(
resHList
[
0
]));
resHList
=
(
resHList_t
*
)
xrealloc
(
resHList
,
(
namespaceID
+
1
)
*
sizeof
(
resHList
[
0
]));
for
(
int
i
=
resHListSize
;
i
<=
namespaceID
;
++
i
)
reshListClearEntry
(
i
);
resHListSize
=
namespaceID
+
1
;
...
...
@@ -209,9 +211,8 @@ void listSizeExtend()
int
oldSize
=
resHList
[
nsp
].
size
;
int
newListSize
=
oldSize
+
MIN_LIST_SIZE
;
resHList
[
nsp
].
resources
=
xrealloc
(
resHList
[
nsp
].
resources
,
newListSize
*
sizeof
(
resHList
[
0
].
resources
[
0
]));
resHList
[
nsp
].
resources
=
(
listElem_t
*
)
xrealloc
(
resHList
[
nsp
].
resources
,
newListSize
*
sizeof
(
listElem_t
));
listElem_t
*
r
=
resHList
[
nsp
].
resources
;
for
(
int
i
=
oldSize
;
i
<
newListSize
;
++
i
)
...
...
@@ -527,7 +528,7 @@ void reshPackBufferCreate(char **packBuffer, int *packBufferSize, void *context)
int
nsp
=
namespaceGetActive
();
int
pBSize
=
*
packBufferSize
=
getPackBufferSize
(
context
);
char
*
pB
=
*
packBuffer
=
xcalloc
(
1
,
*
packBufferSize
);
char
*
pB
=
*
packBuffer
=
(
char
*
)
xcalloc
(
1
,
*
packBufferSize
);
{
int
header
[
3
]
=
{
start
,
nsp
,
sep
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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