Skip to content

Commit ca86365

Browse files
committed
Merge branch 'master' of https://github.com/openlightingproject/ola into fix-tagset-compile
2 parents 07a5ef8 + ec76778 commit ca86365

File tree

11 files changed

+100
-56
lines changed

11 files changed

+100
-56
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ jobs:
9999
# Env var name DISTCHECK_CONFIGURE_FLAGS must be used, see #1881 and #1883
100100
run: |
101101
echo "DISTCHECK_CONFIGURE_FLAGS=${{ matrix.configure-args }}" >> $GITHUB_ENV
102-
- name: Set additional Linux configure arguments
103-
if: runner.os == 'Linux'
104-
# Silence all deprecated declarations on Linux due to auto_ptr making the build log too long
105-
run: |
106-
echo "DISTCHECK_CONFIGURE_FLAGS=$DISTCHECK_CONFIGURE_FLAGS CPPFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV
107102
- name: Print configure command
108103
run: echo "./configure $DISTCHECK_CONFIGURE_FLAGS"
109104
- name: Configure

.travis-ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ else
294294
# Env var name DISTCHECK_CONFIGURE_FLAGS must be used, see #1881 and #1883
295295
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
296296
# Silence all deprecated declarations on Linux due to auto_ptr making the build log too long
297-
export DISTCHECK_CONFIGURE_FLAGS='--enable-rdm-tests --enable-java-libs --enable-ja-rule --enable-e133 CPPFLAGS=-Wno-deprecated-declarations'
297+
export DISTCHECK_CONFIGURE_FLAGS='--enable-rdm-tests --enable-java-libs --enable-ja-rule --enable-e133'
298298
else
299299
export DISTCHECK_CONFIGURE_FLAGS='--enable-rdm-tests --enable-java-libs --enable-ja-rule --enable-e133'
300300
fi

Makefile.am

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,10 @@ if ! USING_WIN32
6565
if FATAL_WARNINGS
6666
COMMON_CXXFLAGS += -Werror
6767
COMMON_PROTOBUF_CXXFLAGS += -Werror -Wno-error=unused-parameter \
68-
-Wno-error=deprecated-declarations \
6968
-Wno-error=sign-compare \
7069
-Wno-error=ignored-qualifiers
7170
COMMON_TESTING_FLAGS += -Werror
72-
COMMON_TESTING_PROTOBUF_FLAGS += -Werror -Wno-error=unused-parameter \
73-
-Wno-error=deprecated-declarations
74-
75-
if GNU_PLUS_PLUS_11_DEPRECATIONS
76-
# We have to use gnu++11 for some reason, so stop it complaining about
77-
# auto_ptr
78-
COMMON_CXXFLAGS += -Wno-error=deprecated-declarations
79-
COMMON_TESTING_FLAGS += -Wno-error=deprecated-declarations
80-
endif
71+
COMMON_TESTING_PROTOBUF_FLAGS += -Werror -Wno-error=unused-parameter
8172
endif
8273
endif
8374

common/rdm/ResponderHelper.cpp

Lines changed: 72 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "ola/network/MACAddress.h"
3535
#include "ola/network/NetworkUtils.h"
3636
#include "ola/rdm/RDMEnums.h"
37+
#include "ola/rdm/ResponderEndpointManager.h"
3738
#include "ola/rdm/ResponderHelper.h"
3839
#include "ola/rdm/ResponderSensor.h"
3940
#include "ola/strings/Utils.h"
@@ -81,7 +82,7 @@ bool ResponderHelper::ExtractUInt32(const RDMRequest *request,
8182
}
8283

8384
bool ResponderHelper::ExtractString(const RDMRequest *request,
84-
std::string *output,
85+
string *output,
8586
uint8_t max_length) {
8687
if (request->ParamDataSize() > max_length) {
8788
return false;
@@ -965,7 +966,7 @@ RDMResponse *ResponderHelper::GetParamDescription(
965966
uint32_t min_value,
966967
uint32_t default_value,
967968
uint32_t max_value,
968-
const string description,
969+
const string &description,
969970
uint8_t queued_message_count) {
970971
PACK(
971972
struct parameter_description_s {
@@ -1016,11 +1017,11 @@ RDMResponse *ResponderHelper::GetParamDescription(
10161017
}
10171018

10181019
RDMResponse *ResponderHelper::GetASCIIParamDescription(
1019-
const RDMRequest *request,
1020-
uint16_t pid,
1021-
rdm_command_class command_class,
1022-
const string description,
1023-
uint8_t queued_message_count) {
1020+
const RDMRequest *request,
1021+
uint16_t pid,
1022+
rdm_command_class command_class,
1023+
const string &description,
1024+
uint8_t queued_message_count) {
10241025
return GetParamDescription(
10251026
request,
10261027
pid,
@@ -1037,12 +1038,12 @@ RDMResponse *ResponderHelper::GetASCIIParamDescription(
10371038
}
10381039

10391040
RDMResponse *ResponderHelper::GetBitFieldParamDescription(
1040-
const RDMRequest *request,
1041-
uint16_t pid,
1042-
uint8_t pdl_size,
1043-
rdm_command_class command_class,
1044-
const string description,
1045-
uint8_t queued_message_count) {
1041+
const RDMRequest *request,
1042+
uint16_t pid,
1043+
uint8_t pdl_size,
1044+
rdm_command_class command_class,
1045+
const string &description,
1046+
uint8_t queued_message_count) {
10461047
return GetParamDescription(
10471048
request,
10481049
pid,
@@ -1273,7 +1274,7 @@ RDMResponse *ResponderHelper::GetMetadataParameterVersion(
12731274
RDMResponse *ResponderHelper::GetMetadataJSON(
12741275
const RDMRequest *request,
12751276
uint16_t pid,
1276-
const string json,
1277+
const string &json,
12771278
uint8_t queued_message_count) {
12781279
PACK(
12791280
struct metadata_json_s {
@@ -1302,6 +1303,55 @@ RDMResponse *ResponderHelper::GetMetadataJSON(
13021303
queued_message_count);
13031304
}
13041305

1306+
RDMResponse *ResponderHelper::GetEndpointList(
1307+
const RDMRequest *request,
1308+
const ola::rdm::EndpointManager *endpoint_manager,
1309+
uint8_t queued_message_count) {
1310+
PACK(
1311+
struct endpoint_info_s {
1312+
uint16_t endpoint_id;
1313+
uint8_t endpoint_type;
1314+
});
1315+
STATIC_ASSERT(sizeof(endpoint_info_s) == 3);
1316+
1317+
PACK(
1318+
struct endpoint_list_s {
1319+
uint32_t list_change_number;
1320+
endpoint_info_s endpoints[5];
1321+
});
1322+
STATIC_ASSERT(sizeof(endpoint_list_s) == (4 + (sizeof(endpoint_info_s) * 5)));
1323+
1324+
struct endpoint_list_s endpoint_list;
1325+
endpoint_list.list_change_number = HostToNetwork(endpoint_manager->list_change_number());
1326+
1327+
vector<uint16_t> endpoints;
1328+
1329+
endpoint_manager->EndpointIDs(&endpoints);
1330+
for (unsigned int i = 0; i < endpoints.size(); i++) {
1331+
endpoint_list.endpoints[i].endpoint_id = HostToNetwork(endpoints[i]);
1332+
}
1333+
1334+
unsigned int param_data_size = (
1335+
sizeof(endpoint_list) -
1336+
sizeof(endpoint_list.endpoints) + (sizeof(endpoint_info_s) * endpoints.size()));
1337+
1338+
return GetResponseFromData(
1339+
request,
1340+
reinterpret_cast<uint8_t*>(&endpoint_list),
1341+
param_data_size,
1342+
RDM_ACK,
1343+
queued_message_count);
1344+
}
1345+
1346+
RDMResponse *ResponderHelper::GetEndpointListChange(
1347+
const RDMRequest *request,
1348+
const ola::rdm::EndpointManager *endpoint_manager,
1349+
uint8_t queued_message_count) {
1350+
return GetUInt32Value(request,
1351+
NetworkToHost(endpoint_manager->list_change_number()),
1352+
queued_message_count);
1353+
}
1354+
13051355

13061356
/**
13071357
* @brief Handle a request that returns a string
@@ -1361,8 +1411,8 @@ RDMResponse *ResponderHelper::SetString(
13611411
}
13621412

13631413
RDMResponse *ResponderHelper::GetBoolValue(const RDMRequest *request,
1364-
bool value,
1365-
uint8_t queued_message_count) {
1414+
bool value,
1415+
uint8_t queued_message_count) {
13661416
if (request->ParamDataSize()) {
13671417
return NackWithReason(request, NR_FORMAT_ERROR, queued_message_count);
13681418
}
@@ -1373,8 +1423,8 @@ RDMResponse *ResponderHelper::GetBoolValue(const RDMRequest *request,
13731423
}
13741424

13751425
RDMResponse *ResponderHelper::SetBoolValue(const RDMRequest *request,
1376-
bool *value,
1377-
uint8_t queued_message_count) {
1426+
bool *value,
1427+
uint8_t queued_message_count) {
13781428
uint8_t arg;
13791429
if (!ResponderHelper::ExtractUInt8(request, &arg)) {
13801430
return NackWithReason(request, NR_FORMAT_ERROR, queued_message_count);
@@ -1390,8 +1440,8 @@ RDMResponse *ResponderHelper::SetBoolValue(const RDMRequest *request,
13901440

13911441
template<typename T>
13921442
static RDMResponse *GenericGetIntValue(const RDMRequest *request,
1393-
T value,
1394-
uint8_t queued_message_count = 0) {
1443+
T value,
1444+
uint8_t queued_message_count = 0) {
13951445
if (request->ParamDataSize()) {
13961446
return NackWithReason(request, NR_FORMAT_ERROR, queued_message_count);
13971447
}
@@ -1427,8 +1477,8 @@ RDMResponse *ResponderHelper::GetUInt32Value(
14271477

14281478
template<typename T>
14291479
static RDMResponse *GenericSetIntValue(const RDMRequest *request,
1430-
T *value,
1431-
uint8_t queued_message_count = 0) {
1480+
T *value,
1481+
uint8_t queued_message_count = 0) {
14321482
if (!GenericExtractValue(request, value)) {
14331483
return NackWithReason(request, NR_FORMAT_ERROR, queued_message_count);
14341484
}

common/utils/StringUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,12 @@ bool HexStringToInt(const string &value, int64_t *output) {
454454

455455
void ToLower(string *s) {
456456
std::transform(s->begin(), s->end(), s->begin(),
457-
std::ptr_fun<int, int>(std::tolower));
457+
[](int value){return std::tolower(value);});
458458
}
459459

460460
void ToUpper(string *s) {
461461
std::transform(s->begin(), s->end(), s->begin(),
462-
std::ptr_fun<int, int>(std::toupper));
462+
[](int value){return std::toupper(value);});
463463
}
464464

465465
void CapitalizeLabel(string *s) {

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ AS_IF([test "x$ac_cv_gnu_plus_plus_11" = xyes],
132132
])
133133
AS_IF([test "x$require_gnu_plus_plus_11" = xyes],
134134
[CXXFLAGS="$CXXFLAGS -std=gnu++11"])
135-
AM_CONDITIONAL([GNU_PLUS_PLUS_11_DEPRECATIONS], [test "x$require_gnu_plus_plus_11" = xyes])
136135

137136
# Checks for header files.
138137
AC_HEADER_DIRENT

debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export VERBOSE=1
1414
dh $@ --parallel --with autotools_dev,autoreconf,bash_completion,python3
1515

1616
override_dh_auto_configure:
17-
dh_auto_configure -- --enable-python-libs --enable-rdm-tests CXXFLAGS='-Wno-error=deprecated-declarations -Wno-error=unused-parameter' pythondir='/usr/lib/python3/dist-packages'
17+
dh_auto_configure -- --enable-python-libs --enable-rdm-tests CXXFLAGS='-Wno-error=unused-parameter' pythondir='/usr/lib/python3/dist-packages'
1818

1919
override_dh_installinit:
2020
dh_installinit -p ola --name=olad

include/ola/ExportMap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ class BaseVariable {
7777
std::string m_name;
7878
};
7979

80-
struct VariableLessThan: public std::binary_function<BaseVariable*,
81-
BaseVariable*, bool> {
80+
struct VariableLessThan {
8281
bool operator()(BaseVariable *x, BaseVariable *y) {
8382
return x->Name() < y->Name();
8483
}

include/ola/rdm/ResponderHelper.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,20 @@ class ResponderHelper {
152152
uint32_t min_value,
153153
uint32_t default_value,
154154
uint32_t max_value,
155-
const std::string description,
155+
const std::string &description,
156156
uint8_t queued_message_count = 0);
157157
static RDMResponse *GetASCIIParamDescription(
158158
const RDMRequest *request,
159159
uint16_t pid,
160160
rdm_command_class command_class,
161-
const std::string description,
161+
const std::string &description,
162162
uint8_t queued_message_count = 0);
163163
static RDMResponse *GetBitFieldParamDescription(
164164
const RDMRequest *request,
165165
uint16_t pid,
166166
uint8_t pdl_size,
167167
rdm_command_class command_class,
168-
const std::string description,
168+
const std::string &description,
169169
uint8_t queued_message_count = 0);
170170

171171
static RDMResponse *GetRealTimeClock(
@@ -271,7 +271,18 @@ class ResponderHelper {
271271
static RDMResponse *GetMetadataJSON(
272272
const RDMRequest *request,
273273
uint16_t pid,
274-
const std::string json,
274+
const std::string &json,
275+
uint8_t queued_message_count = 0);
276+
277+
// E1.37-7 Helpers
278+
static RDMResponse *GetEndpointList(
279+
const RDMRequest *request,
280+
const ola::rdm::EndpointManager *endpoint_manager,
281+
uint8_t queued_message_count = 0);
282+
283+
static RDMResponse *GetEndpointListChange(
284+
const RDMRequest *request,
285+
const ola::rdm::EndpointManager *endpoint_manager,
275286
uint8_t queued_message_count = 0);
276287

277288
// Generic Helpers.

include/olad/Plugin.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ class AbstractPlugin {
107107
};
108108

109109

110-
struct PluginLessThan: public std::binary_function<AbstractPlugin*,
111-
AbstractPlugin*, bool> {
110+
struct PluginLessThan {
112111
bool operator()(AbstractPlugin *x, AbstractPlugin *y) {
113112
return x->Id() < y->Id();
114113
}

0 commit comments

Comments
 (0)