Skip to content

Commit

Permalink
Merge pull request #41 from yayahjb/CBFlib-0.9.7-devel
Browse files Browse the repository at this point in the history
Cbflib 0.9.7 devel
  • Loading branch information
yayahjb authored Apr 11, 2022
2 parents 0b8ad65 + 34e8625 commit 2a287b0
Show file tree
Hide file tree
Showing 117 changed files with 139,283 additions and 55,714 deletions.
902 changes: 564 additions & 338 deletions Makefile

Large diffs are not rendered by default.

2,638 changes: 0 additions & 2,638 deletions Makefile_AIX

This file was deleted.

911 changes: 572 additions & 339 deletions Makefile_LINUX_gcc42 → Makefile_DIALS

Large diffs are not rendered by default.

2,644 changes: 0 additions & 2,644 deletions Makefile_IRIX_gcc

This file was deleted.

901 changes: 564 additions & 337 deletions Makefile_LINUX

Large diffs are not rendered by default.

2,642 changes: 0 additions & 2,642 deletions Makefile_LINUX_64

This file was deleted.

2,641 changes: 0 additions & 2,641 deletions Makefile_LINUX_DMALLOC

This file was deleted.

2,642 changes: 0 additions & 2,642 deletions Makefile_LINUX_gcc42_DMALLOC

This file was deleted.

896 changes: 560 additions & 336 deletions Makefile_MINGW

Large diffs are not rendered by default.

893 changes: 558 additions & 335 deletions Makefile_MSYS2

Large diffs are not rendered by default.

2,605 changes: 0 additions & 2,605 deletions Makefile_MSYS2_save

This file was deleted.

892 changes: 557 additions & 335 deletions Makefile_OSX

Large diffs are not rendered by default.

2,644 changes: 0 additions & 2,644 deletions Makefile_OSX_gcc42

This file was deleted.

2,646 changes: 0 additions & 2,646 deletions Makefile_OSX_gcc42_DMALLOC

This file was deleted.

40 changes: 21 additions & 19 deletions examples/adscimg2cbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static void gethd ( char* field, char* value, char* header )
l = strlen (field);
newfield = (char*) malloc ( l + 3 );
*newfield = 10;
strncpy (newfield+1, field, l);
memcpy (newfield+1, field, l);
*(newfield+l+1) = '=';
*(newfield+l+2) = (char) 0;
l += 2;
Expand Down Expand Up @@ -158,43 +158,43 @@ int main(int argc, char *argv[])
int argtype_array[argc];
int *argtype=argtype_array;
int filec;
int file_size, header_size_char, actread;
int cbf_status;
int i, j, k=0;
int size1, size2;
int file_type;
int pack_flags;
int pad_flag;
int status_pclose;
int beam_center_convention;
int add_minicbf_header=0;
int file_size, header_size_char, actread;
int cbf_status;
int i, j, k=0;
int size1, size2;
int file_type;
int pack_flags;
int pad_flag;
int status_pclose;
int beam_center_convention;
int add_minicbf_header=0;
int bin=0;
int transpose=0;
int interleave=0;
int *new_int_data, *old_int_data;
size_t new_int_data_size, old_int_data_size;
double thickness=0.;
double thickness=0.;
const char * argval_array[argc];
const char * * argval=argval_array;
const char * roi=NULL;
const char * thickstr=NULL;
const char * polarstr=NULL;
const char * roi=NULL;
const char * thickstr=NULL;
const char * polarstr=NULL;
const char * scalestr=NULL;
const char * offsetstr=NULL;
const char * cliplowstr=NULL;
const char * cliphighstr=NULL;
const char * rad_smoothstr=NULL;
const char * ifile=NULL;
const char * ofile=NULL;
char * strstrhit;
static char *endings[] = {
char * strstrhit;
static char *endings[] = {
".img",
".img.gz",
".img.bz2",
".img.Z",
NULL
};
static char *flags[32] = {
static char *flags[32] = {
"--cbf_byte_offset", /* 0 */
"--cbf_packed_v2", /* 1 */
"--cbf_packed", /* 2 */
Expand Down Expand Up @@ -229,6 +229,8 @@ int main(int argc, char *argv[])
NULL
};

CBF_UNUSED( cbf_status );
CBF_UNUSED( thickness );

if(argc < 2)
{
Expand All @@ -242,7 +244,7 @@ int main(int argc, char *argv[])
char modc;
if ( argv[iarg][0] == '-' && argv[iarg][1] == '-' ) {
for(j = 0; flags[j] != NULL; j++) {
strstrhit = cbf_cistrnstr(argv[iarg], flags[j], strlen(flags[j]));
strstrhit = (char *)cbf_cistrnstr(argv[iarg], flags[j], strlen(flags[j]));
if(NULL != strstrhit && strstrhit==argv[iarg] )
break;
}
Expand Down
14 changes: 10 additions & 4 deletions examples/adscimg2cbf_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,10 @@ int adscimg2cbf_sub2(char *header,
double cliplow, cliphigh;
int rad_smooth;


CBF_UNUSED( smv_bin_type);
CBF_UNUSED( kicm );
CBF_UNUSED( kjcm );

if(0 == pack_flags)
pack_flags = CBF_BYTE_OFFSET; /* default if 0 is given for "pack_flags" */

Expand Down Expand Up @@ -790,7 +793,7 @@ int adscimg2cbf_sub2(char *header,
smv_size2, smv_size1);
return(1);
}
if (convertroi(roi, smv_size1, smv_size2,
if (convertroi((char *)roi, smv_size1, smv_size2,
&fastlow, &fasthigh, &slowlow, &slowhigh)) {
fprintf(stderr,
"adscimg2cbf_sub2: Error: Invalid region of interest '%s'\n", roi);
Expand Down Expand Up @@ -1724,7 +1727,7 @@ int adscimg2cbf_sub2(char *header,
return(1);
};
if (log) fprintf(stderr,"minicbf_header messages: \n%s\n", log);
cbf_free_text(&log,NULL);
cbf_free_text((const char **)(&log),NULL);
}

cbf_failnez (cbf_require_category (cbf, "array_data"));
Expand Down Expand Up @@ -1870,6 +1873,9 @@ int adscimg2cbf_sub2(char *header,
int ivec2cm[2];
double dist2cm;
int id,ir;

CBF_UNUSED( valmax );
CBF_UNUSED( valnew );

cmi = rint(cmi/cmv);
cmj = rint(cmj/cmv);
Expand Down Expand Up @@ -2072,7 +2078,7 @@ int adscimg2cbf_sub(char *header,
int pad_flag){
return adscimg2cbf_sub2(header,
data,
NULL,NULL,NULL,NULL,
NULL,0,NULL,NULL,
cbf_filename,
pack_flags,
beam_center_convention,
Expand Down
8 changes: 8 additions & 0 deletions examples/cbf2adscimg_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@ static int cbfhandle2img_sub(cbf_handle cbf, char **header, unsigned short **dat
char *fps, *fpe, *vps, *vpe, *cp;

const char *direction [2];

CBF_UNUSED( dirinc );
CBF_UNUSED( dirend );
CBF_UNUSED( dirsta );
CBF_UNUSED( second );
CBF_UNUSED( first );
CBF_UNUSED( colrow );


/*
* Legal, but uninteresting case.
Expand Down
14 changes: 14 additions & 0 deletions examples/cbf_standardize_numbers.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ int main (int argc, char ** argv) {
int termc;
int numcomp;
int spacestarted;
int baposstarted;
int digits = 6;
double number, anumber, ascale, fpart;
CBF_UNUSED( bracket );
Expand All @@ -65,10 +66,23 @@ int main (int argc, char ** argv) {
bracket = '\0';
termc = '\0';
spacestarted = 1;
baposstarted = 0;
numcomp = 0;
while(lineln) {
c = *line;
c &= 0xFF;
if ( c == 'b' && line[1] == '\'' ) {
baposstarted = 1;
lineln -= 2;
line += 2;
continue;
}
if( c == '\'' && baposstarted ) {
baposstarted = 0;
lineln--;
line++;
continue;
}
if (isspace(c) || c == '[' || c == '(' || c == '{') {
bracket = c;
lineln--;
Expand Down
2 changes: 1 addition & 1 deletion examples/testhdf5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ static testResult_t testDatasets(const hid_t grp)
TEST_CBF_FAIL(cbf_H5Drequire(grp,&dset,"name",2,max,0,buf,H5T_STD_I32LE));
TEST_CBF_FAIL(cbf_H5Drequire(grp,&dset,"name",2,max,cnk,buf,CBF_H5FAIL));
/* check if things work */
TEST_CBF_PASS(cbf_H5Drequire(grp,0,"dataset_require_0",2,max,cnk,buf,H5T_STD_I32LE));
TEST_CBF_PASS(cbf_H5Drequire(grp,&dset,"dataset_require_0",2,max,cnk,buf,H5T_STD_I32LE));
TEST_COMPONENT(test_H5Drequire(grp,"dataset_require_1",2,max,cnk,buf,H5T_STD_I32LE));
TEST_COMPONENT(test_H5Drequire(grp,"dataset_require_2",2,max,cnk,0,H5T_STD_I32LE));
TEST_COMPONENT(test_H5Drequire(grp,"dataset_require_3",0,0,cnk,buf,H5T_STD_I32LE));
Expand Down
Loading

0 comments on commit 2a287b0

Please sign in to comment.