Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning fix for main.c #25

Merged
merged 1 commit into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.