diff --git a/client/Makefile b/client/Makefile index 1cdc18f73..cbbf07e15 100644 --- a/client/Makefile +++ b/client/Makefile @@ -58,11 +58,11 @@ INCLUDES_CLIENT += -I./src -I../include -I../common -I../common_fpga $(LIBS) #CFLAGS ?= -Wall -Werror -O3 ifneq ($(platform),Darwin) # readline has strict-prototype issues -CFLAGS ?= -Wall -Werror -O3 -Wmissing-prototypes -Wchar-subscripts -Wundef -Wcast-align -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wnested-externs -Wmissing-declarations +CFLAGS ?= -Wall -Werror -O3 -Wredundant-decls -Wmissing-prototypes -Wchar-subscripts -Wundef -Wcast-align -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wnested-externs -Wmissing-declarations else -CFLAGS ?= -Wall -Werror -O3 -Wmissing-prototypes -Wchar-subscripts -Wundef -Wcast-align -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wstrict-prototypes -Wnested-externs -Wmissing-declarations +CFLAGS ?= -Wall -Werror -O3 -Wredundant-decls -Wmissing-prototypes -Wchar-subscripts -Wundef -Wcast-align -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wstrict-prototypes -Wnested-externs -Wmissing-declarations endif -# -Wshadow -Wredundant-decls +# -Wshadow # -Wbad-function-cast -Wextra -Wswitch-enum -Wold-style-definition # We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env: diff --git a/client/src/cmddata.h b/client/src/cmddata.h index a19bead27..4a740f8a2 100644 --- a/client/src/cmddata.h +++ b/client/src/cmddata.h @@ -81,6 +81,5 @@ extern size_t DemodBufferLen; extern int g_DemodClock; extern size_t g_DemodStartIdx; -extern uint8_t g_debugMode; #endif diff --git a/client/src/cmdhfmfu.h b/client/src/cmdhfmfu.h index be52b1ed8..0f87cb3f6 100644 --- a/client/src/cmdhfmfu.h +++ b/client/src/cmdhfmfu.h @@ -29,15 +29,6 @@ void printMFUdumpEx(mfu_dump_t *card, uint16_t pages, uint8_t startpage); int CmdHFMFUltra(const char *Cmd); -uint32_t ul_ev1_pwdgenA(uint8_t *uid); -uint32_t ul_ev1_pwdgenB(uint8_t *uid); -uint32_t ul_ev1_pwdgenC(uint8_t *uid); -uint32_t ul_ev1_pwdgenD(uint8_t *uid); - -uint16_t ul_ev1_packgenA(uint8_t *uid); -uint16_t ul_ev1_packgenB(uint8_t *uid); -uint16_t ul_ev1_packgenC(uint8_t *uid); -uint16_t ul_ev1_packgenD(uint8_t *uid); uint16_t ul_ev1_packgen_VCNEW(uint8_t *uid, uint32_t pwd); uint32_t ul_ev1_otpgenA(uint8_t *uid); diff --git a/client/src/graph.h b/client/src/graph.h index 01b20c7e2..b753f418d 100644 --- a/client/src/graph.h +++ b/client/src/graph.h @@ -30,10 +30,7 @@ int GetNrzClock(const char *str, bool printAns); int GetFskClock(const char *str, bool printAns); bool fskClocks(uint8_t *fc1, uint8_t *fc2, uint8_t *rf1, int *firstClockEdge); -// Max graph trace len: 40000 (bigbuf) * 8 (at 1 bit per sample) -#ifndef MAX_GRAPH_TRACE_LEN -#define MAX_GRAPH_TRACE_LEN (40000 * 8 ) -#endif +#define MAX_GRAPH_TRACE_LEN (40000 * 8) #define GRAPH_SAVE 1 #define GRAPH_RESTORE 0 diff --git a/client/src/proxgui.h b/client/src/proxgui.h index bfcbc78e1..4666cccc3 100644 --- a/client/src/proxgui.h +++ b/client/src/proxgui.h @@ -26,12 +26,6 @@ void RepaintGraphWindow(void); void MainGraphics(void); void InitGraphics(int argc, char **argv, char *script_cmds_file, char *script_cmd, bool stayInCommandLoop); void ExitGraphics(void); -#ifndef MAX_GRAPH_TRACE_LEN -#define MAX_GRAPH_TRACE_LEN (40000 * 8) -#endif -extern int GraphBuffer[MAX_GRAPH_TRACE_LEN]; -extern size_t GraphTraceLen; -extern int s_Buff[MAX_GRAPH_TRACE_LEN]; extern double CursorScaleFactor; extern int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, GridOffset; @@ -40,21 +34,8 @@ extern int CommandFinished; extern int offline; extern bool GridLocked; -//Operations defined in data_operations -//int autoCorr(const int* in, int *out, size_t len, int window); -int AskEdgeDetect(const int *in, int *out, int len, int threshold); -int AutoCorrelate(const int *in, int *out, size_t len, size_t window, bool SaveGrph, bool verbose); -int directionalThreshold(const int *in, int *out, size_t len, int8_t up, int8_t down); -void save_restoreGB(uint8_t saveOpt); - #define GRAPH_SAVE 1 #define GRAPH_RESTORE 0 -#define MAX_DEMOD_BUF_LEN (1024*128) -extern uint8_t DemodBuffer[MAX_DEMOD_BUF_LEN]; -extern size_t DemodBufferLen; -extern size_t g_DemodStartIdx; -extern bool showDemod; -extern uint8_t g_debugMode; #ifndef FILE_PATH_SIZE #define FILE_PATH_SIZE 1000 diff --git a/client/src/proxguiqt.cpp b/client/src/proxguiqt.cpp index 59bbddb69..7f0dcb8a8 100644 --- a/client/src/proxguiqt.cpp +++ b/client/src/proxguiqt.cpp @@ -26,12 +26,14 @@ #include #include "proxgui.h" #include -#include "ui.h" -#include "comms.h" extern "C" int preferences_save(void); extern "C" { +#include "ui.h" +#include "comms.h" +#include "graph.h" +#include "cmddata.h" #include "util_darwin.h" } diff --git a/client/src/scripting.c b/client/src/scripting.c index 756799626..25bda6322 100644 --- a/client/src/scripting.c +++ b/client/src/scripting.c @@ -33,6 +33,7 @@ #include "protocols.h" #include "fileutils.h" // searchfile #include "cmdlf.h" // lf_config +#include "generator.h" static int returnToLuaWithError(lua_State *L, const char *fmt, ...) { char buffer[200]; diff --git a/client/src/ui.h b/client/src/ui.h index ee101601e..8ba9c06a4 100644 --- a/client/src/ui.h +++ b/client/src/ui.h @@ -42,7 +42,7 @@ typedef struct { } session_arg_t; extern session_arg_t session; - +extern bool showDemod; #ifndef M_PI #define M_PI 3.14159265358979323846264338327 #endif diff --git a/common/lfdemod.c b/common/lfdemod.c index 8b10b2fb3..ee6d6afe0 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -51,6 +51,7 @@ #ifndef ON_DEVICE #include "ui.h" +#include "util.h" # include "cmddata.h" # define prnt(args...) PrintAndLogEx(DEBUG, ## args ); #else