Merge pull request #25959 from neo1973/TagLib_deprecation_warnings
[xbmc.git] / lib / libUPnP / patches / 0049-libUPnP-fix-no-permissive-build.patch
blobb6b255c7c2bd533792a9b719949a3a0be32b3705
1 diff --git a/lib/libUPnP/Neptune/Source/System/Bsd/NptBsdSockets.cpp b/lib/libUPnP/Neptune/Source/System/Bsd/NptBsdSockets.cpp
2 index 638446d776..063be46a7d 100644
3 --- a/lib/libUPnP/Neptune/Source/System/Bsd/NptBsdSockets.cpp
4 +++ b/lib/libUPnP/Neptune/Source/System/Bsd/NptBsdSockets.cpp
5 @@ -564,8 +564,10 @@ static int
6 socketpair(int, int, int, SOCKET sockets[2]) // we ignore the first two params: we only use this for a strictly limited case
8 int result = 0;
9 + socklen_t name_length = 0;
10 + int reuse = 1;
12 - // initialize with default values
13 + // initialize with default values
14 sockets[0] = INVALID_SOCKET;
15 sockets[1] = INVALID_SOCKET;
17 @@ -578,15 +580,14 @@ socketpair(int, int, int, SOCKET sockets[2]) // we ignore the first two params:
18 memset(&inet_address, 0, sizeof(inet_address));
19 inet_address.sin_family = AF_INET;
20 inet_address.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
21 - int reuse = 1;
22 setsockopt(listener, SOL_SOCKET, SO_REUSEADDR, (const char*)&reuse, sizeof(reuse));
23 result = bind(listener, (const sockaddr*)&inet_address, sizeof(inet_address));
24 if (result != 0) goto fail;
25 listen(listener, 1);
27 // read the port that was assigned to the listener socket
28 - socklen_t name_length = sizeof(inet_address);
29 - result = getsockname(listener, (struct sockaddr*)&inet_address, &name_length);
30 + name_length = sizeof(inet_address);
31 + result = getsockname(listener, (struct sockaddr*)&inet_address, &name_length);
32 if (result != 0) goto fail;
34 // create the first socket
35 diff --git a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp
36 index 8f3c6b7a0d..3ab979ad3b 100644
37 --- a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp
38 +++ b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp
39 @@ -441,7 +441,7 @@ NPT_Win32Thread::NPT_Win32Thread(NPT_Thread* delegator,
40 m_Delegator(delegator),
41 m_Target(target),
42 m_Detached(detached),
43 - m_ThreadHandle(0),
44 + m_ThreadHandle(nullptr),
45 m_ThreadId(0)
48 @@ -567,7 +567,7 @@ NPT_Win32Thread::EntryPoint(void* argument)
49 NPT_Result
50 NPT_Win32Thread::Start()
52 - if (m_ThreadHandle > 0) {
53 + if (m_ThreadHandle != nullptr) {
54 // failed
55 NPT_LOG_WARNING("thread already started !");
56 return NPT_ERROR_INVALID_STATE;
57 diff --git a/lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp b/lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp
58 index bae654572c..7d476d1806 100644
59 --- a/lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp
60 +++ b/lib/libUPnP/Platinum/Source/Core/PltCtrlPoint.cpp
61 @@ -805,8 +805,9 @@ PLT_CtrlPoint::ProcessEventNotification(PLT_EventSubscriberReference subscriber,
62 var = service->FindStateVariable(property->GetTag());
63 if (var == NULL) continue;
65 - if (NPT_FAILED(var->SetValue(property->GetText()?*property->GetText():""))) {
66 - NPT_CHECK_LABEL_WARNING(NPT_FAILURE, failure);
67 + if (NPT_FAILED(var->SetValue(property->GetText() ? property->GetText()->GetChars() : "")))
68 + {
69 + NPT_CHECK_LABEL_WARNING(NPT_FAILURE, failure);
72 vars.Add(var);
73 @@ -1662,12 +1663,11 @@ PLT_CtrlPoint::ProcessSubscribeResponse(NPT_Result res,
74 goto remove_sub;
76 failure:
77 - NPT_LOG_SEVERE_4("%subscription failed of sub \"%s\" for service \"%s\" of device \"%s\"",
78 - (const char*)subscription?"S":"Uns",
79 - (const char*)(sid?*sid:"Unknown"),
80 - (const char*)service->GetServiceID(),
81 - (const char*)service->GetDevice()->GetFriendlyName());
82 - res = NPT_FAILED(res)?res:NPT_FAILURE;
83 + NPT_LOG_SEVERE_4(
84 + "%subscription failed of sub \"%s\" for service \"%s\" of device \"%s\"",
85 + (const char*)subscription ? "S" : "Uns", (const char*)(sid ? sid->GetChars() : "Unknown"),
86 + (const char*)service->GetServiceID(), (const char*)service->GetDevice()->GetFriendlyName());
87 + res = NPT_FAILED(res) ? res : NPT_FAILURE;
89 remove_sub:
90 // in case it was a renewal look for the subscriber with that service and remove it from the list
91 @@ -1814,7 +1814,8 @@ PLT_CtrlPoint::ProcessActionResponse(NPT_Result res,
92 NPT_XmlElementNode* child = (*args)->AsElementNode();
93 if (!child) continue;
95 - action->SetArgumentValue(child->GetTag(), child->GetText()?*child->GetText():"");
96 + action->SetArgumentValue(child->GetTag(),
97 + child->GetText() ? child->GetText()->GetChars() : "");
98 if (NPT_FAILED(res)) goto failure;
101 diff --git a/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp b/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
102 index b6de5c202d..6f5f09f9cf 100644
103 --- a/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
104 +++ b/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
105 @@ -305,11 +305,12 @@ PLT_DeviceHost::Announce(PLT_DeviceData* device,
106 break;
108 PLT_UPnPMessageHelper::SetNTS(req, nts);
110 - NPT_LOG_FINER_3("Sending SSDP NOTIFY (%s) Request to %s (%s)",
111 - nts.GetChars(),
113 + NPT_LOG_FINER_3("Sending SSDP NOTIFY (%s) Request to %s (%s)", nts.GetChars(),
114 (const char*)req.GetUrl().ToString(),
115 - (const char*)(PLT_UPnPMessageHelper::GetLocation(req)?*PLT_UPnPMessageHelper::GetLocation(req):""));
116 + (const char*)(PLT_UPnPMessageHelper::GetLocation(req)
117 + ? PLT_UPnPMessageHelper::GetLocation(req)->GetChars()
118 + : ""));
120 // upnp:rootdevice
121 if (device->m_ParentUUID.IsEmpty()) {
122 @@ -585,14 +586,13 @@ PLT_DeviceHost::ProcessHttpPostRequest(NPT_HttpRequest& request,
123 name = "ObjectID";
126 - res = action->SetArgumentValue(
127 - name,
128 - child->GetText()?*child->GetText():"");
129 + res = action->SetArgumentValue(name, child->GetText() ? child->GetText()->GetChars() : "");
131 - // test if value was correct
132 - if (res == NPT_ERROR_INVALID_PARAMETERS) {
133 - action->SetError(701, "Invalid Name");
134 - goto error;
135 + // test if value was correct
136 + if (res == NPT_ERROR_INVALID_PARAMETERS)
138 + action->SetError(701, "Invalid Name");
139 + goto error;
143 diff --git a/lib/libUPnP/Platinum/Source/Core/PltUtilities.h b/lib/libUPnP/Platinum/Source/Core/PltUtilities.h
144 index bdc1340173..4677f5be0e 100644
145 --- a/lib/libUPnP/Platinum/Source/Core/PltUtilities.h
146 +++ b/lib/libUPnP/Platinum/Source/Core/PltUtilities.h
147 @@ -140,7 +140,8 @@ public:
149 const NPT_String* text = child->GetText();
150 // DLNA 7.3.17
151 - value = text?text->SubString(0, max_size):"";
152 + if (text)
153 + value = text->SubString(0, max_size);
154 return NPT_SUCCESS;
157 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaServer.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaServer.cpp
158 index feeb537648..8686aa9294 100644
159 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaServer.cpp
160 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaServer.cpp
161 @@ -401,7 +401,7 @@ PLT_MediaServer::ParseTagList(const NPT_String& updates, NPT_Map<NPT_String,NPT_
162 NPT_XmlElementNode* child = (*children)->AsElementNode();
163 if (!child) continue;
164 const NPT_String *txt = child->GetText();
165 - tags[child->GetTag()] = txt ? *txt : "";
166 + tags[child->GetTag()] = txt ? txt->GetChars() : "";
169 return NPT_SUCCESS;
170 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.cpp
171 index 27d81fae86..794b56be17 100644
172 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.cpp
173 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.cpp
174 @@ -245,7 +245,7 @@ PLT_SyncMediaBrowser::OnMSStateVariablesChanged(PLT_Service* se
175 if (value.GetLength()) {
176 index = value.Find(',');
177 update_id = (index<0)?value:value.Left(index);
178 - value = (index<0)?"":value.SubString(index+1);
179 + value = (index < 0) ? "" : value.SubString(index + 1).GetChars();
181 // clear cache for that device
182 if (m_UseCache) m_Cache.Clear(device->GetUUID(), item_id);