Merge pull request #561 from neheb/master

Fix a bunch of warnings.
pull/563/head
Jens Steube 8 years ago committed by GitHub
commit 6133809704

@ -6,4 +6,7 @@
#ifndef _BENCHMARK_H #ifndef _BENCHMARK_H
#define _BENCHMARK_H #define _BENCHMARK_H
extern const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_CNT;
extern const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_BUF[];
#endif // _BENCHMARK_H #endif // _BENCHMARK_H

@ -27,8 +27,8 @@ void naive_escape (char *s, size_t s_max, const char key_char, const char escape
void hc_sleep_msec (const u32 msec); void hc_sleep_msec (const u32 msec);
void hc_sleep (const u32 sec); void hc_sleep (const u32 sec);
void setup_environment_variables (); void setup_environment_variables (void);
void setup_umask (); void setup_umask (void);
void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed); void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed);
#endif // _SHARED_H #endif // _SHARED_H

@ -26,10 +26,10 @@
void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag); void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag);
void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop); void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop);
int setup_console (); int setup_console (void);
void send_prompt (); void send_prompt (void);
void clear_prompt (); void clear_prompt (void);
void *thread_keypress (void *p); void *thread_keypress (void *p);
@ -37,9 +37,9 @@ void *thread_keypress (void *p);
void SetConsoleWindowSize (const int x); void SetConsoleWindowSize (const int x);
#endif #endif
int tty_break(); int tty_break(void);
int tty_getchar(); int tty_getchar(void);
int tty_fix(); int tty_fix(void);
void opencl_info (hashcat_ctx_t *hashcat_ctx); void opencl_info (hashcat_ctx_t *hashcat_ctx);
void opencl_info_compact (hashcat_ctx_t *hashcat_ctx); void opencl_info_compact (hashcat_ctx_t *hashcat_ctx);

@ -98,7 +98,7 @@ BINARY_NATIVE := $(PROG_NAME)
## General compiler and linker flags ## General compiler and linker flags
## ##
CFLAGS := -pipe -W -Wall -std=c99 -Iinclude/ -IOpenCL/ CFLAGS := -pipe -W -Wall -std=c99 -Iinclude/ -IOpenCL/ -Wundef -Wmissing-declarations -Wmissing-prototypes -Wdouble-promotion
LFLAGS := LFLAGS :=
ifndef DEBUG ifndef DEBUG

@ -6,9 +6,9 @@
#include "common.h" #include "common.h"
#include "benchmark.h" #include "benchmark.h"
const int DEFAULT_BENCHMARK_ALGORITHMS_CNT = 146; const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_CNT = 146;
const int DEFAULT_BENCHMARK_ALGORITHMS_BUF[] = const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_BUF[] =
{ {
900, 900,
0, 0,

@ -18,8 +18,6 @@
#include "event.h" #include "event.h"
#endif #endif
static const char SLASH[] = "/";
int sort_by_stringptr (const void *p1, const void *p2) int sort_by_stringptr (const void *p1, const void *p2)
{ {
const char **s1 = (const char **) p1; const char **s1 = (const char **) p1;
@ -76,7 +74,7 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz)
return 0; return 0;
} }
void get_install_dir (char *install_dir, const char *exec_path) static void get_install_dir (char *install_dir, const char *exec_path)
{ {
strncpy (install_dir, exec_path, HCBUFSIZ_TINY - 1); strncpy (install_dir, exec_path, HCBUFSIZ_TINY - 1);
@ -97,12 +95,12 @@ void get_install_dir (char *install_dir, const char *exec_path)
} }
} }
void get_profile_dir (char *profile_dir, const char *home_dir) static void get_profile_dir (char *profile_dir, const char *home_dir)
{ {
snprintf (profile_dir, HCBUFSIZ_TINY - 1, "%s/%s", home_dir, DOT_HASHCAT); snprintf (profile_dir, HCBUFSIZ_TINY - 1, "%s/%s", home_dir, DOT_HASHCAT);
} }
void get_session_dir (char *session_dir, const char *profile_dir) static void get_session_dir (char *session_dir, const char *profile_dir)
{ {
snprintf (session_dir, HCBUFSIZ_TINY - 1, "%s/%s", profile_dir, SESSIONS_FOLDER); snprintf (session_dir, HCBUFSIZ_TINY - 1, "%s/%s", profile_dir, SESSIONS_FOLDER);
} }
@ -250,6 +248,8 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
static const char SLASH[] = "/";
if (install_folder == NULL) install_folder = SLASH; // makes library use easier if (install_folder == NULL) install_folder = SLASH; // makes library use easier
char *resolved_install_folder = realpath (install_folder, NULL); char *resolved_install_folder = realpath (install_folder, NULL);

@ -23,6 +23,7 @@
#include "affinity.h" #include "affinity.h"
#include "autotune.h" #include "autotune.h"
#include "benchmark.h"
#include "bitmap.h" #include "bitmap.h"
#include "combinator.h" #include "combinator.h"
#include "cpt.h" #include "cpt.h"
@ -30,6 +31,7 @@
#include "dictstat.h" #include "dictstat.h"
#include "dispatch.h" #include "dispatch.h"
#include "event.h" #include "event.h"
#include "hashcat.h"
#include "hashes.h" #include "hashes.h"
#include "hwmon.h" #include "hwmon.h"
#include "induct.h" #include "induct.h"
@ -52,9 +54,6 @@
#include "weak_hash.h" #include "weak_hash.h"
#include "wordlist.h" #include "wordlist.h"
extern const u32 DEFAULT_BENCHMARK_ALGORITHMS_CNT;
extern const u32 DEFAULT_BENCHMARK_ALGORITHMS_BUF[];
// inner2_loop iterates through wordlists, then calls kernel execution // inner2_loop iterates through wordlists, then calls kernel execution
static int inner2_loop (hashcat_ctx_t *hashcat_ctx) static int inner2_loop (hashcat_ctx_t *hashcat_ctx)

@ -2676,7 +2676,7 @@ int hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u3
return -1; return -1;
} }
int hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int val) static int hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int val)
{ {
hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx;

@ -781,7 +781,7 @@ static void main_hashlist_sort_salt_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ct
event_log_info_nn (hashcat_ctx, "Sorted salts..."); event_log_info_nn (hashcat_ctx, "Sorted salts...");
} }
void event (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, const size_t len) static void event (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, const size_t len)
{ {
switch (id) switch (id)
{ {

@ -33,11 +33,11 @@ int get_runtime_left (const hashcat_ctx_t *hashcat_ctx)
time (&runtime_cur); time (&runtime_cur);
const int runtime_left = status_ctx->runtime_start const int runtime_left = (int) (status_ctx->runtime_start
+ status_ctx->prepare_time + status_ctx->prepare_time
+ user_options->runtime + user_options->runtime
+ (msec_paused / 1000) + (msec_paused / 1000)
- runtime_cur; - runtime_cur);
return runtime_left; return runtime_left;
} }

@ -935,8 +935,6 @@ int status_get_progress_mode (const hashcat_ctx_t *hashcat_ctx)
{ {
return PROGRESS_MODE_KEYSPACE_UNKNOWN; return PROGRESS_MODE_KEYSPACE_UNKNOWN;
} }
return PROGRESS_MODE_NONE;
} }
double status_get_progress_finished_percent (const hashcat_ctx_t *hashcat_ctx) double status_get_progress_finished_percent (const hashcat_ctx_t *hashcat_ctx)

@ -19,7 +19,7 @@
#include "terminal.h" #include "terminal.h"
#include "hashcat.h" #include "hashcat.h"
const char *PROMPT = "[s]tatus [p]ause [r]esume [b]ypass [c]heckpoint [q]uit => "; static const char *PROMPT = "[s]tatus [p]ause [r]esume [b]ypass [c]heckpoint [q]uit => ";
void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag) void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag)
{ {

Loading…
Cancel
Save