mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-31 17:50:26 +08:00
Fix ncdump clang warnings. Fix invalid encodings for some non-ascii strings in tests.
This commit is contained in:
parent
3d5be0b3f0
commit
ec89eb5806
@ -5147,7 +5147,7 @@ NC3_get_vara(int ncid, int varid,
|
||||
/* If this is a record variable, then we have to
|
||||
substitute the number of records into dimension 0. */
|
||||
if(varp->shape[0] == 0) {
|
||||
(void*)memcpy((void*)modedges,(void*)varp->shape,
|
||||
(void)memcpy((void*)modedges,(void*)varp->shape,
|
||||
sizeof(size_t)*varp->ndims);
|
||||
modedges[0] = NC_get_numrecs(nc3);
|
||||
edges = modedges;
|
||||
@ -5280,7 +5280,7 @@ NC3_put_vara(int ncid, int varid,
|
||||
/* If this is a record variable, then we have to
|
||||
substitute the number of records into dimension 0. */
|
||||
if(varp->shape[0] == 0) {
|
||||
(void*)memcpy((void*)modedges,(void*)varp->shape,
|
||||
(void)memcpy((void*)modedges,(void*)varp->shape,
|
||||
sizeof(size_t)*varp->ndims);
|
||||
modedges[0] = NC_get_numrecs(nc3);
|
||||
edges = modedges;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <config.h>
|
||||
#include <unistd.h>
|
||||
#include <nc_tests.h>
|
||||
#include <hdf5.h>
|
||||
#include <H5DSpublic.h>
|
||||
@ -80,10 +81,10 @@ int create_hdf_file(int dtype) {
|
||||
sds_id = SDcreate(sd_id, SDSNAME, dtype, RANK, edges);
|
||||
|
||||
istat = SDendaccess(sds_id);
|
||||
if(istat) {printf("Failure %d\n"); SDend(sd_id); return istat;}
|
||||
if(istat) {printf("Failure %d\n", istat); SDend(sd_id); return istat;}
|
||||
|
||||
istat = SDend(sd_id);
|
||||
if(istat) {printf("Failure %d\n"); SDend(sd_id); return istat;}
|
||||
if(istat) {printf("Failure %d\n", istat); SDend(sd_id); return istat;}
|
||||
|
||||
sd_id = SDstart(FILENAME, DFACC_WRITE);
|
||||
|
||||
@ -91,13 +92,13 @@ int create_hdf_file(int dtype) {
|
||||
sds_id = SDselect(sd_id, sd_index);
|
||||
|
||||
istat = SDwritedata(sds_id, start, NULL, edges, (VOIDP)array_data);
|
||||
if(istat) {printf("Failure %d\n"); SDend(sd_id); return istat;}
|
||||
if(istat) {printf("Failure %d\n", istat); SDend(sd_id); return istat;}
|
||||
|
||||
istat = SDendaccess(sds_id);
|
||||
if(istat) {printf("Failure %d\n"); SDend(sd_id); return istat;}
|
||||
if(istat) {printf("Failure %d\n", istat); SDend(sd_id); return istat;}
|
||||
|
||||
istat = SDend(sd_id);
|
||||
if(istat) {printf("Failure %d\n"); return istat;}
|
||||
if(istat) {printf("Failure %d\n", istat); return istat;}
|
||||
|
||||
printf("Success\n");
|
||||
return 0;
|
||||
|
@ -6,6 +6,8 @@
|
||||
* See https://bugtracking.unidata.ucar.edu/browse/NCF-330
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <netcdf.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
@ -296,7 +296,7 @@ fileopen(const char* path, void** memp, size_t* sizep)
|
||||
int status = NC_NOERR;
|
||||
int fd = -1;
|
||||
int oflags = 0;
|
||||
size_t size = 0;
|
||||
off_t size = 0;
|
||||
void* mem = NULL;
|
||||
off_t red = 0;
|
||||
char* pos = NULL;
|
||||
|
@ -933,7 +933,7 @@ main() { /* create ctest0.nc */
|
||||
}
|
||||
|
||||
{ /* store c3 */
|
||||
static char c3[] = {"\001\300."};
|
||||
static char c3[] = {"\001\177."};
|
||||
stat = nc_put_var_text(ncid, c3_id, c3);
|
||||
check_err(stat,__LINE__,__FILE__);
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ data:
|
||||
|
||||
d2 = -1e+308, 1e+308 ;
|
||||
|
||||
c3 = "\001\300." ;
|
||||
c3 = "\001\177." ;
|
||||
|
||||
b3 = -128, 127, -1 ;
|
||||
|
||||
|
@ -159,7 +159,7 @@ data:
|
||||
|
||||
d2 = -1e+308, 1e+308 ;
|
||||
|
||||
c3 = "\001\300." ;
|
||||
c3 = "\001\177." ;
|
||||
|
||||
b3 = -128, 127, -1 ;
|
||||
|
||||
|
@ -933,7 +933,7 @@ main() { /* create ctest0_64.nc */
|
||||
}
|
||||
|
||||
{ /* store c3 */
|
||||
static char c3[] = {"\001\300."};
|
||||
static char c3[] = {"\001\177."};
|
||||
stat = nc_put_var_text(ncid, c3_id, c3);
|
||||
check_err(stat,__LINE__,__FILE__);
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ data:
|
||||
|
||||
d2 = -1e+308, 1e+308 ;
|
||||
|
||||
c3 = "\001\300." ;
|
||||
c3 = "\001\177." ;
|
||||
|
||||
b3 = -128, 127, -1 ;
|
||||
|
||||
|
@ -167,7 +167,7 @@ data:
|
||||
|
||||
d2 = -1e+308, 1e+308 ;
|
||||
|
||||
c3 = "\001\300." ;
|
||||
c3 = "\001\177." ;
|
||||
|
||||
b3 = -128, 127, -1 ;
|
||||
|
||||
|
@ -159,7 +159,7 @@ data:
|
||||
|
||||
d2 = -1e+308, 1e+308 ;
|
||||
|
||||
c3 = "\001\300." ;
|
||||
c3 = "\001\177." ;
|
||||
|
||||
b3 = -128, 127, -1 ;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user