From 6eff449fcb1a848ccab0fdae12ce23a41ea6f4d6 Mon Sep 17 00:00:00 2001
From: magnum <magnum>
Date: Wed, 26 Oct 2011 01:10:08 +0200
Subject: [PATCH] j7: Drop some unused variables and fix an fread warning that
 was missed. This makes for building completely without
 warnings on my gear, using gcc 4.6.1 on Linux x86-64

---
 src/dynamic_fmt.c      |    6 +++---
 src/mscash2_fmt_plug.c |    3 +--
 src/pkzip_fmt_plug.c   |    3 +--
 src/rar2john.c         |    2 +-
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/dynamic_fmt.c b/src/dynamic_fmt.c
index 54f9517..8893479 100644
--- a/src/dynamic_fmt.c
+++ b/src/dynamic_fmt.c
@@ -4711,13 +4711,13 @@ void DynamicFunc__overwrite_from_last_output_as_base16_no_size_fix()
 	for (j = 0; j < m_count; ++j)
 	{
 		unsigned char *cpo, *cpi;
-		MD5_word *w;
+		/* MD5_word *w; */
 #if MD5_X2
 		if (j&1)
-			{cpo = input_buf_X86[j>>MD5_X2].x2.B2; cpi = crypt_key_X86[j>>MD5_X2].x2.B2; w=input_buf_X86[j>>MD5_X2].x2.w2;}
+			{cpo = input_buf_X86[j>>MD5_X2].x2.B2; cpi = crypt_key_X86[j>>MD5_X2].x2.B2; /* w=input_buf_X86[j>>MD5_X2].x2.w2; */ }
 		else
 #endif
-		{cpo = input_buf_X86[j>>MD5_X2].x1.B; cpi = crypt_key_X86[j>>MD5_X2].x1.B; w=input_buf_X86[j>>MD5_X2].x1.w;}
+			{cpo = input_buf_X86[j>>MD5_X2].x1.B; cpi = crypt_key_X86[j>>MD5_X2].x1.B; /* w=input_buf_X86[j>>MD5_X2].x1.w; */ }
 		for (i = 0; i < 16; ++i, ++cpi)
 		{
 			*cpo++ = md5gen_itoa16[*cpi>>4];
diff --git a/src/mscash2_fmt_plug.c b/src/mscash2_fmt_plug.c
index 2f82dfe..2877205 100644
--- a/src/mscash2_fmt_plug.c
+++ b/src/mscash2_fmt_plug.c
@@ -522,7 +522,7 @@ static void pbkdf2_sse2(int t)
 	unsigned int ipad[SHA_LBLOCK], opad[SHA_LBLOCK];
 	unsigned int tmp_hash[SHA_DIGEST_LENGTH/4];
 	unsigned int i, j, k, *i1, *i2, *o1, *t_crypt;
-	unsigned char *t_sse_crypt, *t_sse_crypt1, *t_sse_crypt2, *t_sse_hash1;
+	unsigned char *t_sse_crypt1, *t_sse_crypt2, *t_sse_hash1;
 
 	memset(&ipad[4], 0x36, SHA_CBLOCK-16);
 	memset(&opad[4], 0x5C, SHA_CBLOCK-16);
@@ -530,7 +530,6 @@ static void pbkdf2_sse2(int t)
 
 	// All pointers get their offset for this thread here. No further offsetting below.
 	t_crypt = &crypt[t * KEYS_PER_THREAD * 4];
-	t_sse_crypt = &sse_crypt[t * KEYS_PER_THREAD * 20];
 	t_sse_crypt1 = &sse_crypt1[t * KEYS_PER_THREAD * 20];
 	t_sse_crypt2 = &sse_crypt2[t * KEYS_PER_THREAD * 20];
 	t_sse_hash1 = &sse_hash1[t * KEYS_PER_THREAD * 80 * 4];
diff --git a/src/pkzip_fmt_plug.c b/src/pkzip_fmt_plug.c
index c44a679..2ed5676 100644
--- a/src/pkzip_fmt_plug.c
+++ b/src/pkzip_fmt_plug.c
@@ -946,7 +946,7 @@ static int isLegalUTF8_char(const u8 *source, int length) {
 }
 static int validate_ascii(const u8 *out, int inplen) {
 	int i;
-	int unicode=0, utf8=0;
+	int unicode=0;
 
 	for (i = 0; i < inplen-1; ++i) {
 		if (out[i] > 0x7E) {
@@ -967,7 +967,6 @@ static int validate_ascii(const u8 *out, int inplen) {
 					// check for utf8 BOM  \xEF \xBB \xBF
 					if (out[0] == 0xEF && out[1] == 0xBB && out[2] == 0xBF) {
 						i = 2;
-						utf8 = 1;
 						continue;
 					}
 					/* check for Unicode BOM  (FF FE for utf16le, FE FF for utf16be, FF FE 00 00 for utf32le, not sure if 00 00 FE FF is utf32be, but likely is) */
diff --git a/src/rar2john.c b/src/rar2john.c
index 505dbc6..a955bcb 100644
--- a/src/rar2john.c
+++ b/src/rar2john.c
@@ -158,7 +158,7 @@ static void process_file(const char *filename)
 		if (file_header_head_flags & 0x1000) {
 			fprintf(stderr, "! EXT_TIME present with size %d\n",
 			    EXT_TIME_SIZE);
-			fread(rejbuf, EXT_TIME_SIZE, 1, fp);
+			count = fread(rejbuf, EXT_TIME_SIZE, 1, fp);
 			assert(count == 1);
 		}
 		/* process encrypted data of size "file_header_pack_size" */
-- 
1.7.5.4

