Commit bc95e5bb authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Remove unecessary macros

parent 6addd435
......@@ -29,9 +29,6 @@ static inline void fatal_error(
tao_panic();
}
#define if_likely(expr) if TAO_LIKELY(expr)
#define if_unlikely(expr) if TAO_UNLIKELY(expr)
//-----------------------------------------------------------------------------
// REGIONS OF INTEREST
......
......@@ -28,14 +28,6 @@
// acquisition buffer is set to `NULL` when the buffer is released.
#define NULLIFY_RELEASED_BUFFERS 0
#define if_likely(expr) if TAO_LIKELY(expr)
#define if_unlikely(expr) if TAO_UNLIKELY(expr)
// FIXME: check these macros
#define read_stream(dev, cmd, ptr) phx_read_stream(dev, cmd, ptr)
#define unsupported(cam, func) tao_store_error(func, TAO_UNSUPPORTED)
static void invalid_runlevel(
tao_camera* cam,
const char* func);
......@@ -349,7 +341,7 @@ static tao_status on_update_config(
assert(cam->runlevel == 1);
phnx_device* dev = (phnx_device*)cam;
if (dev->ops->update_config == NULL) {
unsupported(cam, __func__);
tao_store_error(__func__, TAO_UNSUPPORTED);
return TAO_ERROR;
}
if (dev->ops->update_config(dev, true) != TAO_OK) {
......@@ -374,7 +366,7 @@ static tao_status on_check_config(
// Call virtual method with specific settings identical to the current
// ones.
if (dev->ops->check_config == NULL) {
unsupported(cam, __func__);
tao_store_error(__func__, TAO_UNSUPPORTED);
return TAO_ERROR;
}
phnx_config fullconf;
......@@ -409,7 +401,7 @@ static tao_status on_set_config(
// Call virtual method with specific settings identical to the current
// ones.
if (dev->ops->set_config == NULL) {
unsupported(cam, __func__);
tao_store_error(__func__, TAO_UNSUPPORTED);
return TAO_ERROR;
}
phnx_config fullconf;
......@@ -1128,7 +1120,7 @@ tao_status phnx_load_configuration(
// Call virtual method.
if (dev->ops->load_config == NULL) {
unsupported(cam, __func__);
tao_store_error(__func__, TAO_UNSUPPORTED);
return TAO_ERROR;
}
if (dev->ops->load_config(dev, id) != TAO_OK) {
......@@ -1153,7 +1145,7 @@ tao_status phnx_save_configuration(
}
// Call virtual method.
if (dev->ops->save_config == NULL) {
unsupported(cam, __func__);
tao_store_error(__func__, TAO_UNSUPPORTED);
return TAO_ERROR;
}
if (dev->ops->save_config(dev, id) != TAO_OK) {
......@@ -1190,7 +1182,7 @@ tao_status phnx_set_configuration(
return TAO_ERROR;
}
if (dev->ops->set_config == NULL) {
unsupported(cam, __func__);
tao_store_error(__func__, TAO_UNSUPPORTED);
return TAO_ERROR;
}
if (dev->ops->set_config(dev, cfg) != TAO_OK) {
......@@ -1205,10 +1197,11 @@ tao_status phnx_set_configuration(
phnx_device* phnx_get_device(
tao_camera* cam)
{
if_unlikely(cam == NULL) {
if (cam == NULL) {
tao_store_error(__func__, TAO_BAD_ADDRESS);
return NULL;
}
if_unlikely(cam->ops != &ops) {
if (cam->ops != &ops) {
tao_store_error(__func__, TAO_BAD_DEVICE);
return NULL;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment