[libdispatch-changes] [191] trunk/src

source_changes at macosforge.org source_changes at macosforge.org
Sun Oct 24 00:29:09 PDT 2010


Revision: 191
          http://trac.macosforge.org/projects/libdispatch/changeset/191
Author:   kvv at apple.com
Date:     2010-10-24 00:29:08 -0700 (Sun, 24 Oct 2010)
Log Message:
-----------
Better type casts for strict compilers.

Modified Paths:
--------------
    trunk/src/benchmark.c
    trunk/src/once.c

Modified: trunk/src/benchmark.c
===================================================================
--- trunk/src/benchmark.c	2010-10-24 07:27:39 UTC (rev 190)
+++ trunk/src/benchmark.c	2010-10-24 07:29:08 UTC (rev 191)
@@ -34,7 +34,7 @@
 static void
 _dispatch_benchmark_init(void *context)
 {
-	struct __dispatch_benchmark_data_s *bdata = context;
+	struct __dispatch_benchmark_data_s *bdata = (struct __dispatch_benchmark_data_s *)context;
 	// try and simulate performance of real benchmark as much as possible
 	// keep 'f', 'c' and 'cnt' in registers
 	register void (*f)(void *) = bdata->func;
@@ -75,8 +75,8 @@
 uint64_t
 dispatch_benchmark(size_t count, void (^block)(void))
 {
-	struct Block_basic *bb = (void *)block;
-	return dispatch_benchmark_f(count, block, (void *)bb->Block_invoke);
+	struct Block_basic *bb = (struct Block_basic *)(void *)block;
+	return dispatch_benchmark_f(count, block, (dispatch_function_t)bb->Block_invoke);
 }
 #endif
 
@@ -84,7 +84,7 @@
 dispatch_benchmark_f(size_t count, register void *ctxt, register void (*func)(void *))
 {
 	static struct __dispatch_benchmark_data_s bdata = {
-		.func = (void *)dummy_function,
+		.func = (dispatch_function_t)dummy_function,
 		.count = 10000000ul, // ten million
 	};
 	static dispatch_once_t pred;

Modified: trunk/src/once.c
===================================================================
--- trunk/src/once.c	2010-10-24 07:27:39 UTC (rev 190)
+++ trunk/src/once.c	2010-10-24 07:29:08 UTC (rev 191)
@@ -27,9 +27,9 @@
 void
 dispatch_once(dispatch_once_t *val, void (^block)(void))
 {
-	struct Block_basic *bb = (void *)block;
+	struct Block_basic *bb = (struct Block_basic *)(void *)block;
 
-	dispatch_once_f(val, block, (void *)bb->Block_invoke);
+	dispatch_once_f(val, block, (dispatch_function_t)bb->Block_invoke);
 }
 #endif
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/libdispatch-changes/attachments/20101024/4648081a/attachment.html>


More information about the libdispatch-changes mailing list