diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
commit | 29e6158507a0758192075ac6ece7ba8e75ddc49a (patch) | |
tree | b91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/conversation | |
parent | 5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff) | |
download | gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip |
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/conversation')
-rw-r--r-- | src/conversation/gnunet-conversation-test.c | 8 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation.c | 8 | ||||
-rw-r--r-- | src/conversation/gnunet-service-conversation.c | 4 | ||||
-rw-r--r-- | src/conversation/test_conversation_api.c | 9 | ||||
-rw-r--r-- | src/conversation/test_conversation_api_reject.c | 3 | ||||
-rw-r--r-- | src/conversation/test_conversation_api_twocalls.c | 9 |
6 files changed, 12 insertions, 29 deletions
diff --git a/src/conversation/gnunet-conversation-test.c b/src/conversation/gnunet-conversation-test.c index 1c8fe74e6..fe6eae925 100644 --- a/src/conversation/gnunet-conversation-test.c +++ b/src/conversation/gnunet-conversation-test.c | |||
@@ -96,11 +96,9 @@ static struct Recording *rec_tail; | |||
96 | * Terminate test. | 96 | * Terminate test. |
97 | * | 97 | * |
98 | * @param cls NULL | 98 | * @param cls NULL |
99 | * @param tc unused | ||
100 | */ | 99 | */ |
101 | static void | 100 | static void |
102 | do_shutdown (void *cls, | 101 | do_shutdown (void *cls) |
103 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
104 | { | 102 | { |
105 | struct Recording *rec; | 103 | struct Recording *rec; |
106 | 104 | ||
@@ -126,11 +124,9 @@ do_shutdown (void *cls, | |||
126 | * Terminate recording process and switch to playback. | 124 | * Terminate recording process and switch to playback. |
127 | * | 125 | * |
128 | * @param cls NULL | 126 | * @param cls NULL |
129 | * @param tc unused | ||
130 | */ | 127 | */ |
131 | static void | 128 | static void |
132 | switch_to_speaker (void *cls, | 129 | switch_to_speaker (void *cls) |
133 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
134 | { | 130 | { |
135 | struct Recording *rec; | 131 | struct Recording *rec; |
136 | 132 | ||
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index 3b50c8043..9000bcf3f 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c | |||
@@ -1020,11 +1020,9 @@ do_help (const char *args) | |||
1020 | * Task run during shutdown. | 1020 | * Task run during shutdown. |
1021 | * | 1021 | * |
1022 | * @param cls NULL | 1022 | * @param cls NULL |
1023 | * @param tc unused | ||
1024 | */ | 1023 | */ |
1025 | static void | 1024 | static void |
1026 | do_stop_task (void *cls, | 1025 | do_stop_task (void *cls) |
1027 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1028 | { | 1026 | { |
1029 | #ifdef WINDOWS | 1027 | #ifdef WINDOWS |
1030 | if (NULL != stdin_hlp) | 1028 | if (NULL != stdin_hlp) |
@@ -1132,11 +1130,9 @@ console_reader_chars (void *cls, | |||
1132 | * Task to handle commands from the terminal. | 1130 | * Task to handle commands from the terminal. |
1133 | * | 1131 | * |
1134 | * @param cls NULL | 1132 | * @param cls NULL |
1135 | * @param tc scheduler context | ||
1136 | */ | 1133 | */ |
1137 | static void | 1134 | static void |
1138 | handle_command (void *cls, | 1135 | handle_command (void *cls) |
1139 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1140 | { | 1136 | { |
1141 | char message[MAX_MESSAGE_LENGTH + 1]; | 1137 | char message[MAX_MESSAGE_LENGTH + 1]; |
1142 | 1138 | ||
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index 8761ed5e1..fdaa2999c 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c | |||
@@ -1463,11 +1463,9 @@ handle_client_disconnect (void *cls, | |||
1463 | * Shutdown nicely | 1463 | * Shutdown nicely |
1464 | * | 1464 | * |
1465 | * @param cls closure, NULL | 1465 | * @param cls closure, NULL |
1466 | * @param tc the task context | ||
1467 | */ | 1466 | */ |
1468 | static void | 1467 | static void |
1469 | do_shutdown (void *cls, | 1468 | do_shutdown (void *cls) |
1470 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1471 | { | 1469 | { |
1472 | struct Line *line; | 1470 | struct Line *line; |
1473 | struct Channel *ch; | 1471 | struct Channel *ch; |
diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c index 317818c8e..f8159115b 100644 --- a/src/conversation/test_conversation_api.c +++ b/src/conversation/test_conversation_api.c | |||
@@ -73,8 +73,7 @@ static struct GNUNET_SCHEDULER_Task * call_task; | |||
73 | 73 | ||
74 | 74 | ||
75 | static void | 75 | static void |
76 | phone_send (void *cls, | 76 | phone_send (void *cls) |
77 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
78 | { | 77 | { |
79 | static unsigned int i; | 78 | static unsigned int i; |
80 | char buf[32]; | 79 | char buf[32]; |
@@ -88,8 +87,7 @@ phone_send (void *cls, | |||
88 | 87 | ||
89 | 88 | ||
90 | static void | 89 | static void |
91 | call_send (void *cls, | 90 | call_send (void *cls) |
92 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
93 | { | 91 | { |
94 | static unsigned int i; | 92 | static unsigned int i; |
95 | char buf[32]; | 93 | char buf[32]; |
@@ -272,10 +270,9 @@ static struct GNUNET_MICROPHONE_Handle phone_mic = { | |||
272 | * Signature of the main function of a task. | 270 | * Signature of the main function of a task. |
273 | * | 271 | * |
274 | * @param cls closure | 272 | * @param cls closure |
275 | * @param tc context information (why was this task triggered now) | ||
276 | */ | 273 | */ |
277 | static void | 274 | static void |
278 | end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 275 | end_test (void *cls) |
279 | { | 276 | { |
280 | GNUNET_SCHEDULER_shutdown (); | 277 | GNUNET_SCHEDULER_shutdown (); |
281 | if (NULL != op) | 278 | if (NULL != op) |
diff --git a/src/conversation/test_conversation_api_reject.c b/src/conversation/test_conversation_api_reject.c index 13dfcd3d5..5f1f836f7 100644 --- a/src/conversation/test_conversation_api_reject.c +++ b/src/conversation/test_conversation_api_reject.c | |||
@@ -130,10 +130,9 @@ static struct GNUNET_MICROPHONE_Handle call_mic = { | |||
130 | * Signature of the main function of a task. | 130 | * Signature of the main function of a task. |
131 | * | 131 | * |
132 | * @param cls closure | 132 | * @param cls closure |
133 | * @param tc context information (why was this task triggered now) | ||
134 | */ | 133 | */ |
135 | static void | 134 | static void |
136 | end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 135 | end_test (void *cls) |
137 | { | 136 | { |
138 | GNUNET_SCHEDULER_shutdown (); | 137 | GNUNET_SCHEDULER_shutdown (); |
139 | if (NULL != op) | 138 | if (NULL != op) |
diff --git a/src/conversation/test_conversation_api_twocalls.c b/src/conversation/test_conversation_api_twocalls.c index 5d7e56d95..17a12eb4f 100644 --- a/src/conversation/test_conversation_api_twocalls.c +++ b/src/conversation/test_conversation_api_twocalls.c | |||
@@ -124,8 +124,7 @@ static struct MicContext call2_mic_ctx; | |||
124 | 124 | ||
125 | 125 | ||
126 | static void | 126 | static void |
127 | phone_send (void *cls, | 127 | phone_send (void *cls) |
128 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
129 | { | 128 | { |
130 | char buf[32]; | 129 | char buf[32]; |
131 | 130 | ||
@@ -138,8 +137,7 @@ phone_send (void *cls, | |||
138 | 137 | ||
139 | 138 | ||
140 | static void | 139 | static void |
141 | call_send (void *cls, | 140 | call_send (void *cls) |
142 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
143 | { | 141 | { |
144 | struct MicContext *mc = cls; | 142 | struct MicContext *mc = cls; |
145 | char buf[32]; | 143 | char buf[32]; |
@@ -343,10 +341,9 @@ static struct GNUNET_MICROPHONE_Handle phone_mic = { | |||
343 | * Signature of the main function of a task. | 341 | * Signature of the main function of a task. |
344 | * | 342 | * |
345 | * @param cls closure | 343 | * @param cls closure |
346 | * @param tc context information (why was this task triggered now) | ||
347 | */ | 344 | */ |
348 | static void | 345 | static void |
349 | end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 346 | end_test (void *cls) |
350 | { | 347 | { |
351 | GNUNET_SCHEDULER_shutdown (); | 348 | GNUNET_SCHEDULER_shutdown (); |
352 | if (NULL != op) | 349 | if (NULL != op) |