Skip to content

Commit

Permalink
Fix build on older distributions (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
manup committed Jun 10, 2024
1 parent 83d94b3 commit a5889ca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <cmath>
#include "alarm_system_device_table.h"
#include "database.h"
#include "deconz/u_assert.h"
#include "device_ddf_init.h"
#include "device_descriptions.h"
#include "device_tick.h"
Expand Down Expand Up @@ -16547,11 +16548,11 @@ Resource *DEV_AddResource(const LightNode &lightNode)
*/
void DEV_AllocateGroup(const Device *device, Resource *rsub, ResourceItem *item)
{
assert(device);
assert(rsub);
assert(rsub->item(RAttrId));
assert(item);
assert(item->descriptor().suffix == RConfigGroup);
U_ASSERT(device);
U_ASSERT(rsub);
U_ASSERT(rsub->item(RAttrId));
U_ASSERT(item);
U_ASSERT(item->descriptor().suffix == RConfigGroup);

if (!device || !rsub || !rsub->item(RAttrId) || !item || item->descriptor().suffix != RConfigGroup)
{
Expand Down
2 changes: 1 addition & 1 deletion device_ddf_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static ResourceItem *DEV_InitDeviceDescriptionItem(const DeviceDescription::Item
}
}

assert(ddfItem.handle != DeviceDescription::Item::InvalidItemHandle);
U_ASSERT(ddfItem.handle != DeviceDescription::Item::InvalidItemHandle);
item->setDdfItemHandle(ddfItem.handle);

// check updates
Expand Down
2 changes: 1 addition & 1 deletion device_descriptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ const DeviceDescription::SubDevice &DeviceDescriptions::getSubDevice(const Resou
for (int i = 0; i < resource->itemCount(); i++)
{
const ResourceItem *item = resource->itemForIndex(size_t(i));
assert(item);
U_ASSERT(item);

h.handle = item->ddfItemHandle();
if (h.handle == DeviceDescription::Item::InvalidItemHandle)
Expand Down
2 changes: 1 addition & 1 deletion rest_devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ bool ddfSerializeV1(JsonDoc &doc, const DeviceDescription &ddf, char *buf, size_
{
sz = serializeJson(doc, buf, bufsize);
}
assert(sz < bufsize);
U_ASSERT(sz < bufsize);

DBG_Printf(DBG_INFO, "JSON serialized size %d\n", int(sz));

Expand Down

0 comments on commit a5889ca

Please sign in to comment.