summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-04-12 19:18:52 +0200
committerOskar <[email protected]>2024-04-12 19:18:52 +0200
commit8454a5c30c8f5f17abd377965b61dc0786a08800 (patch)
tree2a491f7a364c3de23135dd1322a5dae4ef69e993
parentd6ea48c5be4ec380d2ae18af19ce6107926f58ac (diff)
Changed types in various functions
-rw-r--r--7ed.h6
-rw-r--r--Makefile2
-rw-r--r--editmode.c6
-rw-r--r--functions.c2
-rw-r--r--process_multiples.c2
5 files changed, 9 insertions, 9 deletions
diff --git a/7ed.h b/7ed.h
index a65e3fe..90788b5 100644
--- a/7ed.h
+++ b/7ed.h
@@ -24,12 +24,12 @@ void shuffle(char arr[], int n);
int startmode(char filename[]);
-int get_line(char filename[], long focus, char **line, size_t *start);
+int get_line(char *filename, long focus, char **line, size_t *start);
int editmode(char filename[], uint64_t focus);
-int new_line(char filename[], long new_line_pos_temp);
+int new_line(char filename[], long long new_line_pos_temp);
-int remove_line_contents(char filename[], long focus);
+int remove_line_contents(char filename[], uint64_t focus);
int delete_specified_newline(char filename[], long focus); \ No newline at end of file
diff --git a/Makefile b/Makefile
index 1be84f3..e4ac720 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
CC=gcc
-CFLAGS_TESTBIN=-O3 -Wfatal-errors -Wall -Werror -Wextra -g -fsanitize=address
+CFLAGS_TESTBIN=-O2 -Wfatal-errors -Wall -Werror -Wextra -g -fsanitize=address
CFLAGS=-O2 -flto -march=native -DNDEBUG -fomit-frame-pointer -s -static
TARGET=7ed
TESTTARGET=7ed-TESTING
diff --git a/editmode.c b/editmode.c
index 7080c84..149a158 100644
--- a/editmode.c
+++ b/editmode.c
@@ -149,9 +149,9 @@ int check_end_newline(char filename[]) { // function that checks if a file ends
}
-int new_line(char filename[], long new_line_pos_temp) { // creates a new line within a file after a specified line number
+int new_line(char filename[], long long new_line_pos_temp) { // creates a new line within a file after a specified line number
- long new_line_pos;
+ long long new_line_pos;
if (new_line_pos_temp < 0) {
fprintf(stderr, "The new line can not be under 0!\n");
return 1;
@@ -203,7 +203,7 @@ int new_line(char filename[], long new_line_pos_temp) { // creates a new line wi
}
-int remove_line_contents(char filename[], long focus) { // removes contents of a specified line without removing the newline
+int remove_line_contents(char *filename, uint64_t focus) { // removes contents of a specified line without removing the newline
char *line;
size_t start;
diff --git a/functions.c b/functions.c
index e7a8ad6..84cf0cb 100644
--- a/functions.c
+++ b/functions.c
@@ -108,7 +108,7 @@ void shuffle(char arr[], int n) {
}
}
-int get_line(char filename[], long focus, char **line, size_t *start) {
+int get_line(char *filename, long focus, char **line, size_t *start) {
FILE *file;
file = fopen(filename,"r"); // Open file
diff --git a/process_multiples.c b/process_multiples.c
index a2de559..b99b74d 100644
--- a/process_multiples.c
+++ b/process_multiples.c
@@ -294,7 +294,7 @@ int call_X(char *multiple, uint64_t focus, uint64_t Flines, char *filename) {
return 0;
}
- fprintf(stdout, "%s\n", multiple);
+ fprintf(stdout, "%s %ld\n", multiple, Flines);
return 0;
}