Proxmark developers community

Research, development and trades concerning the powerful Proxmark3 device!

You are not logged in.

#1 2012-05-11 15:16:38

dnet
Member
From: Budapest, Hungary
Registered: 2012-05-11
Posts: 2
Website

Removed unused variables and added missing header

I removed most of the unused or set-but-never-used variables form the client code, and added a missing header reference to it, thus eliminating the noise of warnings throughout compilation, and reducing code clutter. Below is the output of svn diff ran on my working copy after checking out revision 528. If you prefer another format of submitting patches, just tell me in a comment.

Index: cmdhfmf.c
===================================================================
--- cmdhfmf.c	(revision 528)
+++ cmdhfmf.c	(working copy)
@@ -259,15 +259,10 @@
 {
 	int i, j;
 	
-	uint8_t keyType = 0;
-	uint8_t c[3][4];
 	uint8_t keyA[16][6];
 	uint8_t keyB[16][6];
 	uint8_t rights[16][4];
 	
-	uint8_t isOK  = 0;
-	uint8_t *data  = NULL;
-
 	FILE *fin;
 	FILE *fout;
 	
Index: cmdhf15.c
===================================================================
--- cmdhf15.c	(revision 528)
+++ cmdhf15.c	(working copy)
@@ -111,7 +111,7 @@
 //		uid[8] 	tag uid
 // returns description of the best match	
 static char* getTagInfo(uint8_t *uid) {
-	uint64_t myuid,mask,t;
+	uint64_t myuid,mask;
 	int i=0, best=-1;	
 	memcpy(&myuid,uid,sizeof(uint64_t));
 	while (uidmapping[i].mask>0) {
Index: mifarehost.c
===================================================================
--- mifarehost.c	(revision 528)
+++ mifarehost.c	(working copy)
@@ -10,6 +10,7 @@
 
 #include <stdio.h>
 #include <stdlib.h> 
+#include <string.h>
 #include "mifarehost.h"
 
 
Index: cmdlfem4x.c
===================================================================
--- cmdlfem4x.c	(revision 528)
+++ cmdlfem4x.c	(working copy)
@@ -275,13 +275,12 @@
  */
 int CmdEM4x50Read(const char *Cmd)
 {
-  int i, j, startblock, clock, skip, block, start, end, low, high;
+  int i, j, startblock, skip, block, start, end, low, high;
   bool complete= false;
   int tmpbuff[MAX_GRAPH_TRACE_LEN / 64];
   char tmp[6];
 
   high= low= 0;
-  clock= 64;
   memset(tmpbuff, 0, MAX_GRAPH_TRACE_LEN / 64);
 
   /* first get high and low values */

Offline

#2 2012-05-12 11:23:41

rule
Administrator
Registered: 2008-05-21
Posts: 410

Re: Removed unused variables and added missing header

If you would like to commit the changes yourself, please email me your google account, then I could give you SVN access.

Offline

#3 2012-05-14 16:02:17

dnet
Member
From: Budapest, Hungary
Registered: 2012-05-11
Posts: 2
Website

Re: Removed unused variables and added missing header

Thanks, committed as r529.

Offline

Board footer

Powered by FluxBB