Dmitry Timoshkov : Avoid non-portable WCHAR[] constructs.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jul 6 06:08:41 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 081563e7ec75cb747973e2f12482d4464d5d2891
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=081563e7ec75cb747973e2f12482d4464d5d2891

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Mon Jul  3 19:54:10 2006 +0900

Avoid non-portable WCHAR[] constructs.

---

 dlls/crypt32/protectdata.c |    6 +++---
 dlls/msi/table.c           |    1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/crypt32/protectdata.c b/dlls/crypt32/protectdata.c
index 6b12f2d..4b7cfc9 100644
--- a/dlls/crypt32/protectdata.c
+++ b/dlls/crypt32/protectdata.c
@@ -107,7 +107,7 @@ struct protect_data_t
 };
 
 /* this is used to check if an incoming structure was built by Wine */
-static const char * crypt_magic_str = "Wine Crypt32 ok";
+static const char crypt_magic_str[] = "Wine Crypt32 ok";
 
 /* debugging tool to print strings of hex chars */
 static const char *
@@ -835,8 +835,8 @@ BOOL WINAPI CryptProtectData(DATA_BLOB* 
                              DWORD dwFlags,
                              DATA_BLOB* pDataOut)
 {
+    static const WCHAR empty_str[1];
     BOOL rc = FALSE;
-
     HCRYPTPROV hProv;
     struct protect_data_t protect_data;
     HCRYPTHASH hHash;
@@ -861,7 +861,7 @@ BOOL WINAPI CryptProtectData(DATA_BLOB* 
     /* Windows appears to create an empty szDataDescr instead of maintaining
      * a NULL */
     if (!szDataDescr)
-        szDataDescr=(WCHAR[]){'\0'};
+        szDataDescr = empty_str;
 
     /* get crypt context */
     if (!CryptAcquireContextW(&hProv,NULL,NULL,CRYPT32_PROTECTDATA_PROV,CRYPT_VERIFYCONTEXT))
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 96623df..810cbb8 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -1680,7 +1680,6 @@ static void dump_table( string_table *st
     for( i=0; i<(rawsize/2); i++ )
     {
         sval = msi_string_lookup_id( st, rawdata[i] );
-        if( !sval ) sval = (WCHAR[]) {0};
         MESSAGE(" %04x %s\n", rawdata[i], debugstr_w(sval) );
     }
 }




More information about the wine-cvs mailing list