Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 59d286f

Browse files
committed
* Fixed duplicate pkg_config_generate() call (leading to a malformed
pkg-config file) * Renamed assert() methods to avoid conflicts by assert macro inclusions
1 parent d4fb2cb commit 59d286f

File tree

9 files changed

+27
-20
lines changed

9 files changed

+27
-20
lines changed

changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
libseekthermal (0.1-6) unstable; urgency=low
2+
3+
* Fixed duplicate pkg_config_generate() call (leading to a malformed
4+
pkg-config file)
5+
* Renamed assert() methods to avoid conflicts by assert macro inclusions
6+
7+
-- Ralf Kaestner <[email protected]> Mon, 09 Mar 2015 09:25:00 +0100
8+
19
libseekthermal (0.1-5) unstable; urgency=low
210

311
* Fixed includes in seekthermal.h

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ remake_include(
1616
)
1717

1818
remake_add_directories(lib bin)
19-
remake_pkg_config_generate()

src/lib/seekthermal/base/request.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace SeekThermal {
4545

4646
/** \brief Seek Thermal request parameter range error assertion
4747
*/
48-
template <typename T, typename U, typename V> static void assert(
48+
template <typename T, typename U, typename V> static void assertValue(
4949
const T& value, const U& minValue, const V& maxValue);
5050
};
5151

src/lib/seekthermal/base/request.tpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ template <typename T, typename U, typename V>
4040
/*****************************************************************************/
4141

4242
template <typename T, typename U, typename V>
43-
void SeekThermal::Request::ParameterRangeError::assert(const T& value,
43+
void SeekThermal::Request::ParameterRangeError::assertValue(const T& value,
4444
const U& minValue, const V& maxValue) {
4545
if ((value < minValue) || (value > maxValue))
4646
throw ParameterRangeError(value, minValue, maxValue);

src/lib/seekthermal/usb/context.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ SeekThermal::Usb::Context::DebugLevels::DebugLevels() {
5353
SeekThermal::Usb::Context::Context(DebugLevel debugLevel) :
5454
debugLevel(debugLevel),
5555
context(0) {
56-
Error::assert(libusb_init(&context));
56+
Error::assertSuccess(libusb_init(&context));
5757
libusb_set_debug(context, this->debugLevel);
5858
}
5959

6060
SeekThermal::Usb::Context::Context(const Context& src) :
6161
debugLevel(src.debugLevel),
6262
context(0) {
63-
Error::assert(libusb_init(&context));
63+
Error::assertSuccess(libusb_init(&context));
6464
libusb_set_debug(context, debugLevel);
6565
}
6666

src/lib/seekthermal/usb/error.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ bool SeekThermal::Usb::Error::operator!=(Code code) const {
114114
return (code != this->code);
115115
}
116116

117-
int SeekThermal::Usb::Error::assert(int error) {
117+
int SeekThermal::Usb::Error::assertSuccess(int error) {
118118
if (error < LIBUSB_SUCCESS)
119119
throw Error(error);
120120
else

src/lib/seekthermal/usb/error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ namespace SeekThermal {
9696

9797
/** \brief Seek Thermal USB error assertion
9898
*/
99-
static int assert(int error);
99+
static int assertSuccess(int error);
100100
protected:
101101
Code code;
102102
};

src/lib/seekthermal/usb/interface.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ SeekThermal::Usb::Interface::Interface(libusb_device* device) :
5353
libusb_ref_device(this->device);
5454

5555
descriptor = new libusb_device_descriptor();
56-
SeekThermal::Usb::Error::assert(
56+
SeekThermal::Usb::Error::assertSuccess(
5757
libusb_get_device_descriptor(this->device, descriptor));
5858

5959
std::ostringstream stream;
@@ -144,8 +144,8 @@ std::string SeekThermal::Usb::Interface::getDeviceSerialNumber() const {
144144
unsigned char data[256];
145145
size_t length;
146146

147-
length = Error::assert(libusb_get_string_descriptor_ascii(handle,
148-
descriptor->iSerialNumber, data, sizeof(data)));
147+
length = Error::assertSuccess(libusb_get_string_descriptor_ascii(
148+
handle, descriptor->iSerialNumber, data, sizeof(data)));
149149

150150
return std::string(reinterpret_cast<char*>(data), length);
151151
}
@@ -190,9 +190,9 @@ SeekThermal::Usb::Interface& SeekThermal::Usb::Interface::operator=(const
190190

191191
void SeekThermal::Usb::Interface::open() {
192192
if (!handle) {
193-
Error::assert(libusb_open(device, &handle));
194-
if (Error::assert(libusb_kernel_driver_active(handle, 0)))
195-
Error::assert(libusb_detach_kernel_driver(handle, 0));
193+
Error::assertSuccess(libusb_open(device, &handle));
194+
if (Error::assertSuccess(libusb_kernel_driver_active(handle, 0)))
195+
Error::assertSuccess(libusb_detach_kernel_driver(handle, 0));
196196
}
197197
}
198198

@@ -205,27 +205,27 @@ void SeekThermal::Usb::Interface::close() {
205205

206206
void SeekThermal::Usb::Interface::transfer(Request& request) {
207207
if (handle) {
208-
Error::assert(libusb_claim_interface(handle, 0));
208+
Error::assertSuccess(libusb_claim_interface(handle, 0));
209209
request.transfer(handle, request.data, timeout);
210-
Error::assert(libusb_release_interface(handle, 0));
210+
Error::assertSuccess(libusb_release_interface(handle, 0));
211211
}
212212
else
213213
throw OperationError();
214214
}
215215

216216
void SeekThermal::Usb::Interface::read(std::vector<unsigned char>& data) {
217217
if (handle) {
218-
Error::assert(libusb_claim_interface(handle, 0));
218+
Error::assertSuccess(libusb_claim_interface(handle, 0));
219219

220220
size_t numRead = 0;
221221
while (numRead < data.size()) {
222222
int transferred = 0;
223-
Error::assert(libusb_bulk_transfer(handle, 0x81, &data[numRead],
223+
Error::assertSuccess(libusb_bulk_transfer(handle, 0x81, &data[numRead],
224224
data.size()-numRead, &transferred, timeout*1e3));
225225
numRead += transferred;
226226
}
227227

228-
Error::assert(libusb_release_interface(handle, 0));
228+
Error::assertSuccess(libusb_release_interface(handle, 0));
229229
}
230230
else
231231
throw OperationError();

src/lib/seekthermal/usb/request.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,6 @@ void SeekThermal::Usb::Request::transfer(libusb_device_handle* handle,
197197

198198
if (requestLength)
199199
requestData = &data[0];
200-
Error::assert(libusb_control_transfer(handle, requestType, request,
201-
value, index, requestData, requestLength, timeout*1e3));
200+
Error::assertSuccess(libusb_control_transfer(handle, requestType,
201+
request, value, index, requestData, requestLength, timeout*1e3));
202202
}

0 commit comments

Comments
 (0)