]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
CHG: the "indent" software warns about some assingments. I've tried to fix them.
authoriceman1001 <iceman@iuse.se>
Mon, 26 Sep 2016 08:37:00 +0000 (10:37 +0200)
committericeman1001 <iceman@iuse.se>
Mon, 26 Sep 2016 08:37:00 +0000 (10:37 +0200)
client/cmddata.c
client/cmdhf15.c
client/mifarehost.c
client/pm3_binlib.c

index eb12fc8496a8354bc9b20e600bed67a92d98acd8..acb1359e8c13d93c7e29f89176542c18418c66fa 100644 (file)
@@ -969,17 +969,17 @@ int CmdUndec(const char *Cmd)
 //shift graph zero up or down based on input + or -
 int CmdGraphShiftZero(const char *Cmd)
 {
-       int shift=0;
+       int shift = 0, shiftedVal = 0;
        //set options from parameters entered with the command
        sscanf(Cmd, "%i", &shift);
-       int shiftedVal=0;
+
        for(int i = 0; i<GraphTraceLen; i++){
                shiftedVal=GraphBuffer[i]+shift;
-               if (shiftedVal>127) 
-                       shiftedVal=127;
-               else if (shiftedVal<-127) 
-                       shiftedVal=-127;
-               GraphBuffer[i]= shiftedVal;
+               if (shiftedVal > 127) 
+                       shiftedVal = 127;
+               else if (shiftedVal < -127) 
+                       shiftedVal = -127;
+               GraphBuffer[i] = shiftedVal;
        }
        CmdNorm("");
        return 0;
index e6cd3e1a86f698fbfb349291dbaea732ea2eb86d..d17e7cd1f6ffcaea4da07b51d68bd30e70b23117 100644 (file)
@@ -207,23 +207,22 @@ int getUID(uint8_t *buf)
        UsbCommand resp;
        uint8_t *recv;
        UsbCommand c = {CMD_ISO_15693_COMMAND, {0, 1, 1}}; // len,speed,recv?
-       uint8_t *req=c.d.asBytes;
-       int reqlen=0;
+       uint8_t *req = c.d.asBytes;
+       int reqlen = 0;
        
-       for (int retry=0;retry<3; retry++) { // don't give up the at the first try              
+       for (int retry = 0; retry <3; retry++) { // don't give up the at the first try          
                
-               req[0]= ISO15_REQ_SUBCARRIER_SINGLE | ISO15_REQ_DATARATE_HIGH | 
-                       ISO15_REQ_INVENTORY | ISO15_REQINV_SLOT1;
-               req[1]=ISO15_CMD_INVENTORY;
-               req[2]=0; // mask length
-               reqlen=AddCrc(req,3);
-               c.arg[0]=reqlen;
+               req[0] = ISO15_REQ_SUBCARRIER_SINGLE | ISO15_REQ_DATARATE_HIGH | ISO15_REQ_INVENTORY | ISO15_REQINV_SLOT1;
+               req[1] = ISO15_CMD_INVENTORY;
+               req[2] = 0; // mask length
+               reqlen = AddCrc(req, 3);
+               c.arg[0] = reqlen;
        
                SendCommand(&c);
                
-               if (WaitForResponseTimeout(CMD_ACK,&resp,1000)) {
+               if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
                        recv = resp.d.asBytes;
-                       if (resp.arg[0]>=12 && ISO15_CRC_CHECK==Crc(recv,12)) {
+                       if (resp.arg[0] >= 12 && ISO15_CRC_CHECK == Crc(recv,12)) {
                           memcpy(buf,&recv[2],8);
                           return 1;
                        } 
@@ -238,16 +237,16 @@ int getUID(uint8_t *buf)
 //             uid[8]  tag uid
 // returns description of the best match       
 static char* getTagInfo(uint8_t *uid) {
-       uint64_t myuid,mask;
-       int i=0, best=-1;       
-       memcpy(&myuid,uid,sizeof(uint64_t));
-       while (uidmapping[i].mask>0) {
-               mask=(~0LL) <<(64-uidmapping[i].mask);
+       uint64_t myuid, mask;
+       int i = 0, best = -1;   
+       memcpy(&myuid, uid, sizeof(uint64_t));
+       while (uidmapping[i].mask > 0) {
+               mask = (~0LL) << (64-uidmapping[i].mask);
                if ((myuid & mask) == uidmapping[i].uid) {
-                       if (best==-1) { 
-                               best=i;
+                       if (best == -1) { 
+                               best = i;
                        } else {
-                               if (uidmapping[i].mask>uidmapping[best].mask) {
+                               if (uidmapping[i].mask > uidmapping[best].mask) {
                                        best=i;
                                }
                        }                                       
@@ -255,8 +254,8 @@ static char* getTagInfo(uint8_t *uid) {
                i++;
        } 
 
-       if (best>=0) return uidmapping[best].desc;
-       
+       if (best >= 0)
+               return uidmapping[best].desc;
        return uidmapping[i].desc; 
 }
 
index 35054d25543374159f86745373cc06785708160f..b41c368702e6cbb4c94e82ee519ff9f2b5e7c8f5 100644 (file)
@@ -125,8 +125,8 @@ int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo
        p4->even = 0; p4->odd = 0;\r
        statelists[0].len = p3 - statelists[0].head.slhead;\r
        statelists[1].len = p4 - statelists[1].head.slhead;\r
-       statelists[0].tail.sltail=--p3;\r
-       statelists[1].tail.sltail=--p4;\r
+       statelists[0].tail.sltail = --p3;\r
+       statelists[1].tail.sltail = --p4;\r
 \r
        // the statelists now contain possible keys. The key we are searching for must be in the\r
        // intersection of both lists. Create the intersection:\r
index 88cb289f39d09b3f658b2e3fd4a6ceb5c5143c2e..6360cb28f7e93e7e226fdb7f4d2852e1f3942d54 100644 (file)
@@ -48,8 +48,8 @@ static void badcode(lua_State *L, int c)
 
 static int doendian(int c)
 {
- int x=1;
- int e=*(char*)&x;
+ int x = 1;
+ int e = *(char*)&x;
  if (c==OP_LITTLEENDIAN) return !e;
  if (c==OP_BIGENDIAN) return e;
  if (c==OP_NATIVE) return 0;
@@ -60,7 +60,7 @@ static void doswap(int swap, void *p, size_t n)
 {
  if (swap)
  {
-  char *a=(char*)p;
+  char *a = (char*)p;
   int i,j;
   for (i=0, j=n-1, n=n/2; n--; i++, j--)
   {
@@ -87,14 +87,14 @@ static void doswap(int swap, void *p, size_t n)
    case OP:                            \
    {                                   \
     T l;                               \
-    int m=sizeof(l);                   \
-    if (i+m>len) { done = 1;   break; }        \
-    memcpy(&l,s+i,m);                  \
+    int m = sizeof(l);                 \
+    if (i + m > len) { done = 1;       break; }        \
+    memcpy(&l, s+i, m);                        \
     doswap(swap,&l,m);                 \
-    if (i+m+l>len) { done = 1; break;}         \
-    i+=m;                              \
+    if (i + m + l > len) { done = 1; break;}           \
+    i += m;                            \
     lua_pushlstring(L,s+i,l);          \
-    i+=l;                              \
+    i += l;                            \
     ++n;                               \
     break;                             \
    }
Impressum, Datenschutz