aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2009-12-13 15:06:15 -0500
committerAndrea Bastoni <bastoni@cs.unc.edu>2009-12-13 15:06:15 -0500
commit120595a6d8031d740df752f32b54f4e48a11981e (patch)
tree0f8610f949d7fafc68829594379d7510fd49fe5f
parenta8e360a9c4eda23015e749110cc75c44f6925875 (diff)
Fix some compilation warnings
-rw-r--r--bin/base_mt_task.c7
-rw-r--r--bin/common.c1
2 files changed, 5 insertions, 3 deletions
diff --git a/bin/base_mt_task.c b/bin/base_mt_task.c
index a1e3731..19afb28 100644
--- a/bin/base_mt_task.c
+++ b/bin/base_mt_task.c
@@ -37,7 +37,7 @@ struct thread_context {
37/* The real-time thread program. Doesn't have to be the same for 37/* The real-time thread program. Doesn't have to be the same for
38 * all threads. Here, we only have one that will invoke job(). 38 * all threads. Here, we only have one that will invoke job().
39 */ 39 */
40void* rt_thread(struct thread_context* ctx); 40void* rt_thread(void *tcontext);
41 41
42/* Declare the periodically invoked job. 42/* Declare the periodically invoked job.
43 * Returns 1 -> task should exit. 43 * Returns 1 -> task should exit.
@@ -95,7 +95,7 @@ int main(int argc, char** argv)
95 */ 95 */
96 for (i = 0; i < NUM_THREADS; i++) { 96 for (i = 0; i < NUM_THREADS; i++) {
97 ctx[i].id = i; 97 ctx[i].id = i;
98 pthread_create(task + i, NULL, rt_thread, ctx + i); 98 pthread_create(task + i, NULL, rt_thread, (void *) (ctx + i));
99 } 99 }
100 100
101 101
@@ -118,9 +118,10 @@ int main(int argc, char** argv)
118 * real-time app. Notice, that init_rt_thread() is called to initialized per-thread 118 * real-time app. Notice, that init_rt_thread() is called to initialized per-thread
119 * data structures of the LITMUS^RT user space libary. 119 * data structures of the LITMUS^RT user space libary.
120 */ 120 */
121void* rt_thread(struct thread_context* ctx) 121void* rt_thread(void *tcontext)
122{ 122{
123 int do_exit; 123 int do_exit;
124 struct thread_context *ctx = (struct thread_context *) tcontext;
124 125
125 /* Make presence visible. */ 126 /* Make presence visible. */
126 printf("RT Thread %d active.\n", ctx->id); 127 printf("RT Thread %d active.\n", ctx->id);
diff --git a/bin/common.c b/bin/common.c
index 0a5f5c5..452b882 100644
--- a/bin/common.c
+++ b/bin/common.c
@@ -1,4 +1,5 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stdlib.h>
2#include <errno.h> 3#include <errno.h>
3 4
4#include "common.h" 5#include "common.h"