Alex Henrie : wsdapi: Turn a constant and several variables into static constants.

Alexandre Julliard julliard at winehq.org
Mon Dec 3 15:28:53 CST 2018


Module: wine
Branch: master
Commit: 133af46568ca0fac1dc37be43caa0903f2ad58ec
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=133af46568ca0fac1dc37be43caa0903f2ad58ec

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Sun Dec  2 16:06:51 2018 -0700

wsdapi: Turn a constant and several variables into static constants.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wsdapi/soap.c | 6 +++---
 dlls/wsdapi/xml.c  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/wsdapi/soap.c b/dlls/wsdapi/soap.c
index e123398..2ecc013 100644
--- a/dlls/wsdapi/soap.c
+++ b/dlls/wsdapi/soap.c
@@ -364,7 +364,7 @@ HRESULT register_namespaces(IWSDXMLContext *xml_context)
 
 static BOOL create_guid(LPWSTR buffer)
 {
-    const WCHAR formatString[] = { 'u','r','n',':','u','u','i','d',':','%','s', 0 };
+    static const WCHAR formatString[] = { 'u','r','n',':','u','u','i','d',':','%','s', 0 };
 
     WCHAR* uuidString = NULL;
     UUID uuid;
@@ -401,7 +401,7 @@ static void populate_soap_header(WSD_SOAP_HEADER *header, LPCWSTR to, LPCWSTR ac
 
 static LPWSTR ulonglong_to_string(void *parent, ULONGLONG value)
 {
-    WCHAR formatString[] = { '%','I','6','4','u', 0 };
+    static const WCHAR formatString[] = { '%','I','6','4','u', 0 };
     LPWSTR ret;
 
     ret = WSDAllocateLinkedMemory(parent, MAX_ULONGLONG_STRING_SIZE * sizeof(WCHAR));
@@ -560,7 +560,7 @@ static BOOL add_discovered_namespace(struct list *namespaces, WSDXML_NAMESPACE *
 
 static HRESULT build_types_list(LPWSTR buffer, size_t buffer_size, const WSD_NAME_LIST *list, struct list *namespaces)
 {
-    WCHAR format_string[] = { '%', 's', ':', '%', 's', 0 };
+    static const WCHAR format_string[] = { '%', 's', ':', '%', 's', 0 };
     LPWSTR current_buf_pos = buffer;
     size_t memory_needed = 0;
     const WSD_NAME_LIST *cur = list;
diff --git a/dlls/wsdapi/xml.c b/dlls/wsdapi/xml.c
index 98bdec6..727d83a 100644
--- a/dlls/wsdapi/xml.c
+++ b/dlls/wsdapi/xml.c
@@ -380,7 +380,7 @@ static BOOL is_prefix_unique(struct list *namespaces, LPCWSTR prefix)
 
 static LPWSTR generate_namespace_prefix(IWSDXMLContextImpl *impl, void *parentMemoryBlock, LPCWSTR uri)
 {
-    WCHAR formatString[] = { 'u','n','%','d', 0 };
+    static const WCHAR formatString[] = { 'u','n','%','d', 0 };
     WCHAR suggestedPrefix[7];
 
     /* Find a unique prefix */




More information about the wine-cvs mailing list