Skip to content

Commit

Permalink
test2
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Nov 28, 2023
1 parent 4f67538 commit 825e625
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 175 deletions.
3 changes: 3 additions & 0 deletions include/ncjson.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ OPTEXPORT void NCJdictsort(NCjson* jdict);
/* Misc */
#define NCJisatomic(j) ((j)->sort != NCJ_ARRAY && (j)->sort != NCJ_DICT && (j)->sort != NCJ_NULL && (j)->sort != NCJ_UNDEF)

/**************************************************/
/* Error detection helper */
#define NCJcheck(expr) do{if((expr) < 0) abort();}while(0)
/**************************************************/

#endif /*!NCJSON_H!*/ /* Leave the ! as a tag for sed */
6 changes: 4 additions & 2 deletions include/netcdf_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ OPTEXPORT void NCJdictsort(NCjson* jdict);
/* Misc */
#define NCJisatomic(j) ((j)->sort != NCJ_ARRAY && (j)->sort != NCJ_DICT && (j)->sort != NCJ_NULL && (j)->sort != NCJ_UNDEF)

/**************************************************/
/* Error detection helper */
#define NCJcheck(expr) do{if((expr) < 0) abort();}while(0)
/**************************************************/

/* Copyright 2018, UCAR/Unidata.
Expand Down Expand Up @@ -754,8 +757,7 @@ NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp)
if(jsonp) *jsonp = NULL;
if(value == NULL)
{stat = NCJTHROW(NCJ_ERR); goto done;}
if((stat = NCJnew(sort,&json))==NCJ_ERR)
goto done;
if((stat = NCJnew(sort,&json))==NCJ_ERR) goto done;
if((json->string = (char*)malloc(len+1))==NULL)
{stat = NCJTHROW(NCJ_ERR); goto done;}
memcpy(json->string,value,len);
Expand Down
2 changes: 1 addition & 1 deletion libdispatch/dfilterx.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ nc_inq_var_filterx(int ncid, int varid, char** textp)
/* Get the filters on this variable */
if((stat = nc_inq_var_filterx_ids(ncid,varid,&text))) goto done;
/* Parse it */
if((stat = NCJparse(text,0,&json))) goto done;
if(NCJparse(text,0,&json)<0) goto done;
if(json->sort != NCJ_ARRAY)
{stat = NC_EFILTER; goto done;}
if(NCJlength(json) == 0 || NCJcontents(json) == NULL)
Expand Down
3 changes: 1 addition & 2 deletions libdispatch/ncjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,7 @@ NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp)
if(jsonp) *jsonp = NULL;
if(value == NULL)
{stat = NCJTHROW(NCJ_ERR); goto done;}
if((stat = NCJnew(sort,&json))==NCJ_ERR)
goto done;
if((stat = NCJnew(sort,&json))==NCJ_ERR) goto done;
if((json->string = (char*)malloc(len+1))==NULL)
{stat = NCJTHROW(NCJ_ERR); goto done;}
memcpy(json->string,value,len);
Expand Down
2 changes: 1 addition & 1 deletion libnczarr/zarr.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ ncz_unload_jatts(NCZ_FILE_INFO_T* zinfo, NC_OBJ* container, NCjson* jattrs, NCjs

if(!(zinfo->flags & FLAG_PUREZARR)) {
/* Insert the jtypes into the set of attributes */
NCJinsert(jattrs,NCZ_V2_ATTRS,jtypes);
NCJcheck(NCJinsert(jattrs,NCZ_V2_ATTRS,jtypes));
}

/* Upload the .zattrs object */
Expand Down
Loading

0 comments on commit 825e625

Please sign in to comment.