Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcdi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mpim-sw
libcdi
Commits
c745f73d
Commit
c745f73d
authored
Jun 15, 2020
by
Uwe Schulzweida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gcc10 analyzer warning.
parent
f8719869
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
src/cdi_att.c
src/cdi_att.c
+9
-16
No files found.
src/cdi_att.c
View file @
c745f73d
...
@@ -544,14 +544,10 @@ int cdi_att_compare(cdi_atts_t *attspa, cdi_atts_t *attspb, int attnum)
...
@@ -544,14 +544,10 @@ int cdi_att_compare(cdi_atts_t *attspa, cdi_atts_t *attspb, int attnum)
static
static
int
cdiAttGetSize
(
vlist_t
*
vlistptr
,
int
varID
,
int
attnum
,
void
*
context
)
int
cdiAttGetSize
(
cdi_atts_t
*
attsp
,
int
attnum
,
void
*
context
)
{
{
cdi_atts_t
*
attsp
;
cdi_att_t
*
attp
;
xassert
(
attsp
=
get_attsp
(
vlistptr
,
varID
));
xassert
(
attnum
>=
0
&&
attnum
<
(
int
)
attsp
->
nelems
);
xassert
(
attnum
>=
0
&&
attnum
<
(
int
)
attsp
->
nelems
);
attp
=
&
(
attsp
->
value
[
attnum
]);
cdi_att_t
*
attp
=
&
(
attsp
->
value
[
attnum
]);
int
txsize
=
serializeGetSize
(
cdi_att_nints
,
CDI_DATATYPE_INT
,
context
)
int
txsize
=
serializeGetSize
(
cdi_att_nints
,
CDI_DATATYPE_INT
,
context
)
+
serializeGetSize
((
int
)
attp
->
namesz
,
CDI_DATATYPE_TXT
,
context
);
+
serializeGetSize
((
int
)
attp
->
namesz
,
CDI_DATATYPE_TXT
,
context
);
txsize
+=
serializeGetSize
((
int
)
attp
->
nelems
,
cdiAttTypeLookup
(
attp
),
context
);
txsize
+=
serializeGetSize
((
int
)
attp
->
nelems
,
cdiAttTypeLookup
(
attp
),
context
);
...
@@ -561,23 +557,20 @@ int cdiAttGetSize(vlist_t *vlistptr, int varID, int attnum, void *context)
...
@@ -561,23 +557,20 @@ int cdiAttGetSize(vlist_t *vlistptr, int varID, int attnum, void *context)
int
cdiAttsGetSize
(
void
*
vp
,
int
varID
,
void
*
context
)
int
cdiAttsGetSize
(
void
*
vp
,
int
varID
,
void
*
context
)
{
{
vlist_t
*
p
=
(
vlist_t
*
)
v
p
;
cdi_atts_t
*
atts
p
;
cdi_atts_t
*
attsp
=
get_attsp
(
p
,
varID
);
xassert
(
attsp
=
get_attsp
((
vlist_t
*
)
vp
,
varID
)
);
int
txsize
=
serializeGetSize
(
1
,
CDI_DATATYPE_INT
,
context
);
int
txsize
=
serializeGetSize
(
1
,
CDI_DATATYPE_INT
,
context
);
size_t
numAtts
=
attsp
->
nelems
;
size_t
numAtts
=
attsp
->
nelems
;
for
(
size_t
i
=
0
;
i
<
numAtts
;
++
i
)
for
(
size_t
i
=
0
;
i
<
numAtts
;
++
i
)
txsize
+=
cdiAttGetSize
(
p
,
varID
,
(
int
)
i
,
context
);
txsize
+=
cdiAttGetSize
(
attsp
,
(
int
)
i
,
context
);
return
txsize
;
return
txsize
;
}
}
static
static
void
cdiAttPack
(
vlist_t
*
vlistptr
,
int
varID
,
int
attnum
,
void
cdiAttPack
(
cdi_atts_t
*
attsp
,
int
attnum
,
void
*
buf
,
int
size
,
int
*
position
,
void
*
context
)
void
*
buf
,
int
size
,
int
*
position
,
void
*
context
)
{
{
cdi_atts_t
*
attsp
;
int
tempbuf
[
cdi_att_nints
];
int
tempbuf
[
cdi_att_nints
];
xassert
(
attsp
=
get_attsp
(
vlistptr
,
varID
));
xassert
(
attnum
>=
0
&&
attnum
<
(
int
)
attsp
->
nelems
);
xassert
(
attnum
>=
0
&&
attnum
<
(
int
)
attsp
->
nelems
);
cdi_att_t
*
attp
=
&
(
attsp
->
value
[
attnum
]);
cdi_att_t
*
attp
=
&
(
attsp
->
value
[
attnum
]);
tempbuf
[
0
]
=
(
int
)
attp
->
namesz
;
tempbuf
[
0
]
=
(
int
)
attp
->
namesz
;
...
@@ -593,14 +586,14 @@ void cdiAttPack(vlist_t *vlistptr, int varID, int attnum,
...
@@ -593,14 +586,14 @@ void cdiAttPack(vlist_t *vlistptr, int varID, int attnum,
void
cdiAttsPack
(
void
*
vp
,
int
varID
,
void
*
buf
,
int
size
,
int
*
position
,
void
*
context
)
void
cdiAttsPack
(
void
*
vp
,
int
varID
,
void
*
buf
,
int
size
,
int
*
position
,
void
*
context
)
{
{
vlist_t
*
p
=
(
vlist_t
*
)
v
p
;
cdi_atts_t
*
atts
p
;
cdi_atts_t
*
attsp
=
get_attsp
(
p
,
varID
);
xassert
(
attsp
=
get_attsp
((
vlist_t
*
)
vp
,
varID
)
);
size_t
numAtts
=
attsp
->
nelems
;
size_t
numAtts
=
attsp
->
nelems
;
int
numAttsI
=
(
int
)
numAtts
;
int
numAttsI
=
(
int
)
numAtts
;
xassert
(
numAtts
<=
INT_MAX
);
xassert
(
numAtts
<=
INT_MAX
);
serializePack
(
&
numAttsI
,
1
,
CDI_DATATYPE_INT
,
buf
,
size
,
position
,
context
);
serializePack
(
&
numAttsI
,
1
,
CDI_DATATYPE_INT
,
buf
,
size
,
position
,
context
);
for
(
size_t
i
=
0
;
i
<
numAtts
;
++
i
)
for
(
size_t
i
=
0
;
i
<
numAtts
;
++
i
)
cdiAttPack
(
p
,
varID
,
(
int
)
i
,
buf
,
size
,
position
,
context
);
cdiAttPack
(
attsp
,
(
int
)
i
,
buf
,
size
,
position
,
context
);
}
}
static
static
...
...
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