Skip to content

Commit

Permalink
Merge pull request #25 from hendersontrent/trent-dev
Browse files Browse the repository at this point in the history
Warning fix for main.c
  • Loading branch information
hendersontrent committed May 15, 2021
2 parents 2f17619 + c4a69e6 commit efeaa7e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 61 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: Rcatch22
Type: Package
Title: Calculation of 22 CAnonical Time-series CHaracteristics
Version: 0.1.7
Date: 2021-04-20
Version: 0.1.8
Date: 2021-05-15
Authors@R: c(
person("Trent", "Henderson", email = "then6675@uni.sydney.edu.au", role = c("cre", "aut")),
person("Carl", "Lubba", email = "c.lubba15@imperial.ac.uk", role = c("ctb"))
Expand Down
Binary file modified src/Rcatch22.so
Binary file not shown.
59 changes: 0 additions & 59 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,65 +213,6 @@ void print_help(char *argv[], char msg[])
// fprintf(stdout, "\tOutput order is:\n%s\n", HEADER);
}

int main(int argc, char * argv[])
{
FILE * infile, * outfile;
int array_size;
double * y;
int size;
double value;
// DIR *d;
struct dirent *dir;


switch (argc) {
case 1:
print_help(argv, "");
break;
case 2:
if ((infile = fopen(argv[1], "r")) == NULL) {
print_help(argv, "Can't open input file\n");
}
outfile = stdout;
break;
case 3:
if ((infile = fopen(argv[1], "r")) == NULL) {
print_help(argv, "Can't open input file\n");
}
if ((outfile = fopen(argv[2], "w")) == NULL) {
print_help(argv, "Can't open output file\n");
}
break;
}

/*
// debug: fix these.
infile = fopen("/Users/carl/PycharmProjects/catch22/C/timeSeries/tsid0244.txt", "r");
outfile = stdout;
*/

// fprintf(outfile, "%s", HEADER);
array_size = 50;
size = 0;
y = malloc(array_size * sizeof *y);

while (fscanf(infile, "%lf", &value) != EOF) {
if (size == array_size) {
y = realloc(y, 2 * array_size * sizeof *y);
array_size *= 2;
}
y[size++] = value;
}
fclose(infile);
y = realloc(y, size * sizeof *y);
//printf("size=%i\n", size);
run_features(y, size, outfile);
fclose(outfile);
free(y);

return 0;
}

int main2(int argc, char * argv[])
{
(void)argc;
Expand Down
Binary file modified src/main.o
Binary file not shown.

0 comments on commit efeaa7e

Please sign in to comment.