Ticket #805: opensync-hidden-parameters

File opensync-hidden-parameters, 1.9 KB (added by microe, 5 months ago)

removes in function declaration in favor of the function parameter

Line 
1The declaration of *error hides the error that was given as a function
2parameter. Removing the declaration and reworking the given type fixes
3this problem.
4
5Signed-off-by: Erik Hovland <erik@hovland.org>
6
7---
8
9 opensync/engine/opensync_mapping_engine.c |    6 ++----
10 1 files changed, 2 insertions(+), 4 deletions(-)
11
12diff --git a/opensync/engine/opensync_mapping_engine.c b/opensync/engine/opensync_mapping_engine.c
13index dd9e538..d37367b 100644
14--- a/opensync/engine/opensync_mapping_engine.c
15+++ b/opensync/engine/opensync_mapping_engine.c
16@@ -551,8 +551,7 @@ osync_bool osync_mapping_engine_solve(OSyncMappingEngine *engine, OSyncChange *c
17        engine->parent->conflicts = g_list_remove(engine->parent->conflicts, engine);
18       
19        if (osync_engine_check_get_changes(engine->parent->parent) && osync_bitcount(engine->parent->sink_errors | engine->parent->sink_get_changes) == g_list_length(engine->parent->sink_engines)) {
20-               OSyncError *error = NULL;
21-               if (!osync_obj_engine_command(engine->parent, OSYNC_ENGINE_COMMAND_WRITE, &error))
22+               if (!osync_obj_engine_command(engine->parent, OSYNC_ENGINE_COMMAND_WRITE, error))
23                        goto error;
24        } else
25                osync_trace(TRACE_INTERNAL, "Not triggering write. didnt receive all reads yet");
26@@ -587,8 +586,7 @@ osync_bool osync_mapping_engine_ignore(OSyncMappingEngine *engine, OSyncError **
27        engine->parent->conflicts = g_list_remove(engine->parent->conflicts, engine);
28       
29        if (osync_engine_check_get_changes(engine->parent->parent) && osync_bitcount(engine->parent->sink_errors | engine->parent->sink_get_changes) == g_list_length(engine->parent->sink_engines)) {
30-               OSyncError *error = NULL;
31-               if (!osync_obj_engine_command(engine->parent, OSYNC_ENGINE_COMMAND_WRITE, &error))
32+               if (!osync_obj_engine_command(engine->parent, OSYNC_ENGINE_COMMAND_WRITE, error))
33                        goto error;
34        } else
35                osync_trace(TRACE_INTERNAL, "Not triggering write. didnt receive all reads yet");