-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
418 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*********************************************************** | ||
* Name: builder.c | ||
* | ||
* Experimental C only buid system, idea inspired by: | ||
* https://github.com/tsoding | ||
* | ||
* | ||
* Creator: Vinícius Souza | ||
* Site: https://github.com/vinissou | ||
***********************************************************/ | ||
|
||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <sys/stat.h> | ||
|
||
//this will become a compiler selector in the future | ||
//might add cl one day | ||
#if defined(_WIN32) || defined(_WIN64) | ||
#define OUT retriever.exe | ||
char *compiler = "clang"; | ||
char *os = "WIN32"; | ||
char *input = ".\\src\\app.c"; | ||
char *output = "retriever.exe"; | ||
#else | ||
#define OUT retriever | ||
char *compiler = "cc"; | ||
char *os = "else"; //for now | ||
char *input = "./src/app.c"; | ||
char *output = "retriever"; | ||
#endif | ||
|
||
|
||
int main(int argc, char **argv) { | ||
char command[200]; | ||
|
||
if (strcmp(os, "WIN32") != 0){ | ||
system("dos2unix *"); //TODO make it portable | ||
system("dos2unix modules/*"); | ||
} | ||
|
||
sprintf(command,"%s -Wall -Wextra -pedantic -std=c99 -O3 %s -o %s", compiler, | ||
input, output); | ||
printf("\n%s\n", command); | ||
system(command); | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Clang-Tidy -extra-arg=-std=c99 ..\app.c >> .\TODO_CLANG-TIDY.txt | ||
cppcheck ..\app.c --output-file=TODO_CPPCHECK.txt | ||
del *.txt | ||
Clang-Tidy -extra-arg=-std=c99 ..\src\app.c >> .\TODO_CLANG-TIDY.txt | ||
cppcheck ..\src\app.c --output-file=TODO_CPPCHECK.txt |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
..\app.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches] | ||
..\src\app.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches] | ||
|
||
^ | ||
..\modules\output.c:42:5: error: Common realloc mistake: 'output_buffer' nulled but not freed upon failure [memleakOnRealloc] | ||
..\src\modules\output.c:42:5: error: Common realloc mistake: 'output_buffer' nulled but not freed upon failure [memleakOnRealloc] | ||
output_buffer = realloc(output_buffer, OUTPUT_MAX); | ||
^ | ||
..\modules\search.h:175:5: error: Common realloc mistake: 'good_suffix_ptr' nulled but not freed upon failure [memleakOnRealloc] | ||
..\src\modules\search.h:175:5: error: Common realloc mistake: 'good_suffix_ptr' nulled but not freed upon failure [memleakOnRealloc] | ||
good_suffix_ptr = realloc(good_suffix_ptr, sizeof(g_suffix_table)); | ||
^ | ||
..\modules\search.h:250:15: error: Null pointer dereference: buffer [nullPointer] | ||
..\src\modules\search.h:250:15: error: Null pointer dereference: buffer [nullPointer] | ||
fread(buffer, 1, (TERM.LENGHT -1), file); | ||
^ | ||
..\modules\search.h:242:21: note: Assignment 'buffer=NULL', assigned value is 0 | ||
..\src\modules\search.h:242:21: note: Assignment 'buffer=NULL', assigned value is 0 | ||
char * buffer = NULL; | ||
^ | ||
..\modules\search.h:250:15: note: Null pointer dereference | ||
..\src\modules\search.h:250:15: note: Null pointer dereference | ||
fread(buffer, 1, (TERM.LENGHT -1), file); | ||
^ | ||
..\modules\search.h:250:15: error: Null pointer dereference [nullPointer] | ||
..\src\modules\search.h:250:15: error: Null pointer dereference [nullPointer] | ||
fread(buffer, 1, (TERM.LENGHT -1), file); | ||
^ | ||
..\modules\search.h:130:57: warning: Uninitialized variable: f [uninitvar] | ||
..\src\modules\search.h:130:57: warning: Uninitialized variable: f [uninitvar] | ||
if (i > g && suffix_table[i + term_lenght - 1 - f] < i - g) | ||
^ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.