Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[datapipe] Drop unused DATAPIPE_USE_CACHED enumeration value. JB#22475
Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Sep 19, 2018
1 parent afeda87 commit e0fdd17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
30 changes: 15 additions & 15 deletions datapipe.c
Expand Up @@ -468,8 +468,7 @@ datapipe_value(datapipe_t *const datapipe)
*
* @param datapipe The datapipe to execute
* @param indata The input data to run through the datapipe
* @param use_cache DATAPIPE_USE_CACHED to use data from cache,
* DATAPIPE_USE_INDATA to use indata
* @param use_cache DATAPIPE_USE_INDATA to use indata
* @param cache_indata DATAPIPE_CACHE_INDATA to cache the indata,
* DATAPIPE_CACHE_NOTHING to keep the old data
*/
Expand All @@ -478,6 +477,8 @@ datapipe_exec_input_triggers(datapipe_t *const datapipe,
gpointer const indata,
const datapipe_use_t use_cache)
{
(void)use_cache; // TODO: remove

void (*trigger)(gconstpointer const input);
gpointer data;
gint i;
Expand All @@ -490,7 +491,7 @@ datapipe_exec_input_triggers(datapipe_t *const datapipe,
goto EXIT;
}

data = (use_cache == DATAPIPE_USE_CACHED) ? datapipe->dp_cached_data : indata;
data = indata;

for (i = 0; (trigger = g_slist_nth_data(datapipe->dp_input_triggers,
i)) != NULL; i++) {
Expand All @@ -506,15 +507,16 @@ datapipe_exec_input_triggers(datapipe_t *const datapipe,
*
* @param datapipe The datapipe to execute
* @param indata The input data to run through the datapipe
* @param use_cache DATAPIPE_USE_CACHED to use data from cache,
* DATAPIPE_USE_INDATA to use indata
* @param use_cache DATAPIPE_USE_INDATA to use indata
* @return The processed data
*/
static gconstpointer
datapipe_exec_filters(datapipe_t *const datapipe,
gpointer indata,
const datapipe_use_t use_cache)
{
(void)use_cache; // TODO: remove

gpointer (*filter)(gpointer input);
gpointer data;
gconstpointer retval = NULL;
Expand All @@ -527,7 +529,7 @@ datapipe_exec_filters(datapipe_t *const datapipe,
goto EXIT;
}

data = (use_cache == DATAPIPE_USE_CACHED) ? datapipe->dp_cached_data : indata;
data = indata;

for (i = 0; (filter = g_slist_nth_data(datapipe->dp_filters,
i)) != NULL; i++) {
Expand Down Expand Up @@ -556,13 +558,14 @@ datapipe_exec_filters(datapipe_t *const datapipe,
*
* @param datapipe The datapipe to execute
* @param indata The input data to run through the datapipe
* @param use_cache DATAPIPE_USE_CACHED to use data from cache,
* DATAPIPE_USE_INDATA to use indata
* @param use_cache DATAPIPE_USE_INDATA to use indata
*/
void datapipe_exec_output_triggers(const datapipe_t *const datapipe,
gconstpointer indata,
const datapipe_use_t use_cache)
{
(void)use_cache; // TODO: remove

void (*trigger)(gconstpointer input);
gconstpointer data;
gint i;
Expand All @@ -574,7 +577,7 @@ void datapipe_exec_output_triggers(const datapipe_t *const datapipe,
goto EXIT;
}

data = (use_cache == DATAPIPE_USE_CACHED) ? datapipe->dp_cached_data : indata;
data = indata;

for (i = 0; (trigger = g_slist_nth_data(datapipe->dp_output_triggers,
i)) != NULL; i++) {
Expand All @@ -590,8 +593,7 @@ void datapipe_exec_output_triggers(const datapipe_t *const datapipe,
*
* @param datapipe The datapipe to execute
* @param indata The input data to run through the datapipe
* @param use_cache DATAPIPE_USE_CACHED to use data from cache,
* DATAPIPE_USE_INDATA to use indata
* @param use_cache DATAPIPE_USE_INDATA to use indata
* @param cache_indata DATAPIPE_CACHE_INDATA to cache the indata,
* DATAPIPE_CACHE_NOTHING to keep the old data
* @return The processed data
Expand All @@ -601,6 +603,8 @@ gconstpointer datapipe_exec_full(datapipe_t *const datapipe,
const datapipe_use_t use_cache,
const datapipe_cache_t cache_indata)
{
(void)use_cache; // TODO: remove

gconstpointer outdata = NULL;

if (datapipe == NULL) {
Expand All @@ -610,10 +614,6 @@ gconstpointer datapipe_exec_full(datapipe_t *const datapipe,
goto EXIT;
}

/* Determine input value */
if( use_cache == DATAPIPE_USE_CACHED )
indata = datapipe->dp_cached_data;

/* Optionally cache the value at the input stage */
if( cache_indata & (DATAPIPE_CACHE_INDATA|DATAPIPE_CACHE_OUTDATA) ) {
if( datapipe->dp_free_cache == DATAPIPE_DATA_DYNAMIC &&
Expand Down
1 change: 0 additions & 1 deletion datapipe.h
Expand Up @@ -80,7 +80,6 @@ typedef enum {
*/
typedef enum {
DATAPIPE_USE_INDATA = FALSE, /**< Use the indata as data source */
DATAPIPE_USE_CACHED = TRUE, /**< Use the cache as data source */
} datapipe_use_t;

/**
Expand Down

0 comments on commit e0fdd17

Please sign in to comment.