celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject celix git commit: CELIX-272: Fix locking example. change uint to unsigned int for clang
Date Thu, 19 Nov 2015 19:22:34 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 254d7bf1f -> 4b85f425a


CELIX-272: Fix locking example. change uint to unsigned int for clang


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/4b85f425
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/4b85f425
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/4b85f425

Branch: refs/heads/develop
Commit: 4b85f425adf91922510d227f61eb3c2b6c95829d
Parents: 254d7bf
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Thu Nov 19 20:22:37 2015 +0100
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Thu Nov 19 20:22:37 2015 +0100

----------------------------------------------------------------------
 .../benchmark/public/include/benchmark_result.h   |  2 +-
 .../private/src/provider_activator.c              | 18 +++++++++---------
 .../mutex_benchmark/private/src/mutex_benchmark.c |  4 ++--
 examples/locking/services/frequency_service.h     |  4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/4b85f425/examples/locking/benchmark/public/include/benchmark_result.h
----------------------------------------------------------------------
diff --git a/examples/locking/benchmark/public/include/benchmark_result.h b/examples/locking/benchmark/public/include/benchmark_result.h
index e7f32d0..aba7761 100644
--- a/examples/locking/benchmark/public/include/benchmark_result.h
+++ b/examples/locking/benchmark/public/include/benchmark_result.h
@@ -11,7 +11,7 @@
 typedef struct benchmark_result {
 		unsigned int nrOfThreads;
 		unsigned int nrOfsamples;
-		uint requestedNrOfSamples;
+		unsigned int requestedNrOfSamples;
 		unsigned int result;
 		unsigned int skips;
 		double averageCallTimeInNanoseconds;

http://git-wip-us.apache.org/repos/asf/celix/blob/4b85f425/examples/locking/math_provider/private/src/provider_activator.c
----------------------------------------------------------------------
diff --git a/examples/locking/math_provider/private/src/provider_activator.c b/examples/locking/math_provider/private/src/provider_activator.c
index 3c0b2d7..58069d0 100644
--- a/examples/locking/math_provider/private/src/provider_activator.c
+++ b/examples/locking/math_provider/private/src/provider_activator.c
@@ -50,21 +50,21 @@ typedef struct activator {
 	service_registration_pt registration;
 
 	double updateFrequency;
-	uint nrOfThreads;
+	unsigned int nrOfThreads;
 	pthread_t *threads;
 
 
-	uint counter;
+	unsigned int counter;
 } activator_t;
 
 static int calc(int arg1, int arg2)  __attribute__((unused));
 static void* run(void *data);
 static void setFrequency(activator_t *activator, double freq);
-static void setNrOfThreads(activator_t *activator, uint nrOfThreads);
+static void setNrOfThreads(activator_t *activator, unsigned int nrOfThreads);
 static void resetCounter(activator_t *activator);
 static void stopThreads(activator_t *activator);
-static void startThreads(activator_t *activator, uint nrOfThreads);
-static uint getCounter(activator_t *activator);
+static void startThreads(activator_t *activator, unsigned int nrOfThreads);
+static unsigned int getCounter(activator_t *activator);
 static void setBenchmarkName(activator_t *activator, char *benchmark);
 static math_service_pt registerMath(activator_t *activator, service_registration_pt *reg);
 
@@ -146,7 +146,7 @@ static void stopThreads(activator_t *activator) {
 	}
 }
 
-static void startThreads(activator_t *activator, uint nrOfThreads) {
+static void startThreads(activator_t *activator, unsigned int nrOfThreads) {
     activator->isRunning = true;
 	activator->threads = malloc(sizeof(pthread_t) * nrOfThreads);
 	for (int i = 0 ; i < nrOfThreads ; i += 1) {
@@ -164,7 +164,7 @@ static void* run(void *data) {
 	math_service_pt prev = NULL;
 
 	while (activator->isRunning) {
- 		uint delayInMicroseconds =  activator->updateFrequency == 0 ? 0 : (1000 * 1000) / activator->updateFrequency;
+ 		unsigned int delayInMicroseconds =  activator->updateFrequency == 0 ? 0 : (1000 * 1000)
/ activator->updateFrequency;
 		if (delayInMicroseconds > 0) {
 			prevReg = currentReg;
 			prev = current;
@@ -213,7 +213,7 @@ static void setFrequency(activator_t *activator, double freq) {
 	activator->updateFrequency = freq;
 }
 
-static void setNrOfThreads(activator_t *activator, uint nrOfThreads) {
+static void setNrOfThreads(activator_t *activator, unsigned int nrOfThreads) {
     printf("Setting nr of update Threads to %d\n", nrOfThreads);
     stopThreads(activator);
 	startThreads(activator, nrOfThreads);
@@ -223,6 +223,6 @@ static void resetCounter(activator_t *activator) {
 	activator->counter = 0;
 }
 
-static uint getCounter(activator_t *activator) {
+static unsigned int getCounter(activator_t *activator) {
 	return activator->counter;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/4b85f425/examples/locking/mutex_benchmark/private/src/mutex_benchmark.c
----------------------------------------------------------------------
diff --git a/examples/locking/mutex_benchmark/private/src/mutex_benchmark.c b/examples/locking/mutex_benchmark/private/src/mutex_benchmark.c
index 740361f..f4fe678 100644
--- a/examples/locking/mutex_benchmark/private/src/mutex_benchmark.c
+++ b/examples/locking/mutex_benchmark/private/src/mutex_benchmark.c
@@ -27,7 +27,7 @@ typedef struct thread_info {
 	unsigned int result;
 	struct timeval begin;
 	struct timeval end;
-	uint skips;
+	unsigned int skips;
 } thread_info_t;
 
 static void benchmark_thread(thread_info_t *info);
@@ -67,7 +67,7 @@ benchmark_result_t benchmark_run(benchmark_pt benchmark, int nrOfThreads,
int nr
 		result.skips += infos[i].skips;
 	}
 
-    uint actualSamples = (nrOfSamples * nrOfThreads) - result.skips;
+    unsigned int actualSamples = (nrOfSamples * nrOfThreads) - result.skips;
 	result.averageCallTimeInNanoseconds = actualSamples == 0 ? NAN : ((double)elapsedTime *
1000) / (nrOfSamples * nrOfThreads);
 	result.callFrequencyInMhz = ((double)(actualSamples * nrOfThreads) / elapsedTime);
 	result.nrOfThreads = nrOfThreads;

http://git-wip-us.apache.org/repos/asf/celix/blob/4b85f425/examples/locking/services/frequency_service.h
----------------------------------------------------------------------
diff --git a/examples/locking/services/frequency_service.h b/examples/locking/services/frequency_service.h
index ceca17e..8f4ad12 100644
--- a/examples/locking/services/frequency_service.h
+++ b/examples/locking/services/frequency_service.h
@@ -37,9 +37,9 @@ struct frequency_service {
 	frequence_handler_t *handle;
 	void (*setFrequency)(frequence_handler_t *handle, double freq);
 	void (*resetCounter)(frequence_handler_t *handle);
-	uint (*getCounter)(frequence_handler_t *handle);
+	unsigned int (*getCounter)(frequence_handler_t *handle);
 	void (*setBenchmarkName)(frequence_handler_t *handle, char *name);
-	void (*setNrOfThreads)(frequence_handler_t *handle, uint nrOfThreads);
+	void (*setNrOfThreads)(frequence_handler_t *handle, unsigned int nrOfThreads);
 };
 
 typedef struct frequency_service * frequency_service_pt;


Mime
View raw message