Joris Huizer : crypt32: Remove helper variable i (Clang).

Alexandre Julliard julliard at winehq.org
Tue Feb 8 17:23:49 CST 2011


Module: wine
Branch: master
Commit: 4d41bdd1074dc77029336d7170aa9f17500f5a12
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4d41bdd1074dc77029336d7170aa9f17500f5a12

Author: Joris Huizer <joris_huizer at yahoo.com>
Date:   Sat Feb  5 15:04:39 2011 +0100

crypt32: Remove helper variable i (Clang).

---

 dlls/crypt32/base64.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c
index 7a23dd9..5d0d604 100644
--- a/dlls/crypt32/base64.c
+++ b/dlls/crypt32/base64.c
@@ -498,14 +498,13 @@ static inline BYTE decodeBase64Byte(int c)
 static LONG decodeBase64Block(const char *in_buf, int in_len,
  const char **nextBlock, PBYTE out_buf, DWORD *out_len)
 {
-    int len = in_len, i;
+    int len = in_len;
     const char *d = in_buf;
     int  ip0, ip1, ip2, ip3;
 
     if (len < 4)
         return ERROR_INVALID_DATA;
 
-    i = 0;
     if (d[2] == '=')
     {
         if ((ip0 = decodeBase64Byte(d[0])) > 63)
@@ -514,8 +513,8 @@ static LONG decodeBase64Block(const char *in_buf, int in_len,
             return ERROR_INVALID_DATA;
 
         if (out_buf)
-            out_buf[i] = (ip0 << 2) | (ip1 >> 4);
-        i++;
+            out_buf[0] = (ip0 << 2) | (ip1 >> 4);
+        *out_len = 1;
     }
     else if (d[3] == '=')
     {
@@ -528,10 +527,10 @@ static LONG decodeBase64Block(const char *in_buf, int in_len,
 
         if (out_buf)
         {
-            out_buf[i + 0] = (ip0 << 2) | (ip1 >> 4);
-            out_buf[i + 1] = (ip1 << 4) | (ip2 >> 2);
+            out_buf[0] = (ip0 << 2) | (ip1 >> 4);
+            out_buf[1] = (ip1 << 4) | (ip2 >> 2);
         }
-        i += 2;
+        *out_len = 2;
     }
     else
     {
@@ -546,11 +545,11 @@ static LONG decodeBase64Block(const char *in_buf, int in_len,
 
         if (out_buf)
         {
-            out_buf[i + 0] = (ip0 << 2) | (ip1 >> 4);
-            out_buf[i + 1] = (ip1 << 4) | (ip2 >> 2);
-            out_buf[i + 2] = (ip2 << 6) |  ip3;
+            out_buf[0] = (ip0 << 2) | (ip1 >> 4);
+            out_buf[1] = (ip1 << 4) | (ip2 >> 2);
+            out_buf[2] = (ip2 << 6) |  ip3;
         }
-        i += 3;
+        *out_len = 3;
     }
     if (len >= 6 && d[4] == '\r' && d[5] == '\n')
         *nextBlock = d + 6;
@@ -560,7 +559,6 @@ static LONG decodeBase64Block(const char *in_buf, int in_len,
         *nextBlock = d + 4;
     else
         *nextBlock = NULL;
-    *out_len = i;
     return ERROR_SUCCESS;
 }
 




More information about the wine-cvs mailing list