mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Manually fixed readability-suspicious-call-argument warnings
This commit is contained in:
parent
42d0b48e8d
commit
e1f22bc4ed
@ -235,7 +235,7 @@ nc_copy_data_all(int ncid, nc_type xtype, const void* memory, size_t count, void
|
||||
|
||||
/* allocate the top-level */
|
||||
if(count > 0) {
|
||||
if((copy = calloc(xsize,count))==NULL)
|
||||
if((copy = calloc(count,xsize))==NULL)
|
||||
{stat = NC_ENOMEM; goto done;}
|
||||
}
|
||||
stat = nc_copy_data(ncid,xtype,memory,count,copy);
|
||||
|
@ -567,7 +567,7 @@ NC_copy_data_all(NC* nc, nc_type xtype, const void* memory, size_t count, void**
|
||||
|
||||
if(xtype <= NC_STRING && count > 0) {
|
||||
xsize = NC_atomictypelen(xtype);
|
||||
if((copy = calloc(xsize,count))==NULL) {stat = NC_ENOMEM; goto done;}
|
||||
if((copy = calloc(count,xsize))==NULL) {stat = NC_ENOMEM; goto done;}
|
||||
if(xtype < NC_STRING) /* fixed-size atomic type */
|
||||
memcpy(copy,memory,xsize*count);
|
||||
else { /* string type */
|
||||
@ -589,7 +589,7 @@ NC_copy_data_all(NC* nc, nc_type xtype, const void* memory, size_t count, void**
|
||||
xsize = utype->size;
|
||||
/* allocate the top-level */
|
||||
if(count > 0) {
|
||||
if((copy = calloc(xsize,count))==NULL) {stat = NC_ENOMEM; goto done;}
|
||||
if((copy = calloc(count,xsize))==NULL) {stat = NC_ENOMEM; goto done;}
|
||||
}
|
||||
if((stat = NC_copy_data(nc,xtype,memory,count,copy)))
|
||||
(void)NC_reclaim_data_all(nc,xtype,copy,count);
|
||||
|
Loading…
Reference in New Issue
Block a user