celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From griccia...@apache.org
Subject celix git commit: Fixed minor Coverity issues
Date Wed, 04 Oct 2017 06:30:31 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 64491416f -> f7951b2bc


Fixed minor Coverity issues


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

Branch: refs/heads/develop
Commit: f7951b2bc679897e912bca77635b1b48b0fd5928
Parents: 6449141
Author: gricciardi <gricciardi@apache.org>
Authored: Wed Oct 4 08:30:16 2017 +0200
Committer: gricciardi <gricciardi@apache.org>
Committed: Wed Oct 4 08:30:16 2017 +0200

----------------------------------------------------------------------
 pubsub/examples/mp_pubsub/publisher/private/src/mp_publisher.c  | 4 ++--
 pubsub/examples/pubsub/publisher/private/src/pubsub_publisher.c | 2 +-
 pubsub/pubsub_admin_udp_mc/private/src/large_udp.c              | 4 ++--
 pubsub/pubsub_admin_udp_mc/private/src/topic_publication.c      | 2 +-
 pubsub/pubsub_admin_zmq/private/src/topic_publication.c         | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/f7951b2b/pubsub/examples/mp_pubsub/publisher/private/src/mp_publisher.c
----------------------------------------------------------------------
diff --git a/pubsub/examples/mp_pubsub/publisher/private/src/mp_publisher.c b/pubsub/examples/mp_pubsub/publisher/private/src/mp_publisher.c
index 851d9c1..fa53487 100644
--- a/pubsub/examples/mp_pubsub/publisher/private/src/mp_publisher.c
+++ b/pubsub/examples/mp_pubsub/publisher/private/src/mp_publisher.c
@@ -43,12 +43,12 @@ static bool stop=false;
 static celix_thread_t tid;
 
 static double randDouble(double min, double max){
-	double ret = min + (((double)rand()) / (((double)RAND_MAX)/(max-min))) ;
+	double ret = min + (((double)random()) / (((double)RAND_MAX)/(max-min))) ;
 	return ret;
 }
 
 static unsigned int randInt(unsigned int min, unsigned int max){
-	double scaled = ((double)rand())/((double)RAND_MAX);
+	double scaled = ((double)random())/((double)RAND_MAX);
 	return (max - min +1)*scaled + min;
 }
 

http://git-wip-us.apache.org/repos/asf/celix/blob/f7951b2b/pubsub/examples/pubsub/publisher/private/src/pubsub_publisher.c
----------------------------------------------------------------------
diff --git a/pubsub/examples/pubsub/publisher/private/src/pubsub_publisher.c b/pubsub/examples/pubsub/publisher/private/src/pubsub_publisher.c
index b78a6c5..7e7602e 100644
--- a/pubsub/examples/pubsub/publisher/private/src/pubsub_publisher.c
+++ b/pubsub/examples/pubsub/publisher/private/src/pubsub_publisher.c
@@ -41,7 +41,7 @@ static bool stop=false;
 
 static double randCoordinate(double min, double max){
 
-	double ret = min + (((double)rand()) / (((double)RAND_MAX)/(max-min))) ;
+	double ret = min + (((double)random()) / (((double)RAND_MAX)/(max-min))) ;
 
 	return ret;
 

http://git-wip-us.apache.org/repos/asf/celix/blob/f7951b2b/pubsub/pubsub_admin_udp_mc/private/src/large_udp.c
----------------------------------------------------------------------
diff --git a/pubsub/pubsub_admin_udp_mc/private/src/large_udp.c b/pubsub/pubsub_admin_udp_mc/private/src/large_udp.c
index f9e167b..7455925 100644
--- a/pubsub/pubsub_admin_udp_mc/private/src/large_udp.c
+++ b/pubsub/pubsub_admin_udp_mc/private/src/large_udp.c
@@ -132,7 +132,7 @@ int largeUdp_sendmsg(largeUdp_pt handle, int fd, struct iovec *largeMsg_iovec,
i
 	msg_part_header_t header;
 
 	int written = 0;
-	header.msg_ident = rand();
+	header.msg_ident = (unsigned int)random();
 	header.total_msg_size = 0;
 	for(n = 0; n < len ;n++) {
 		header.total_msg_size += largeMsg_iovec[n].iov_len;
@@ -206,7 +206,7 @@ int largeUdp_sendto(largeUdp_pt handle, int fd, void *buf, size_t count,
int fla
 	msg_part_header_t header;
 
 	int written = 0;
-	header.msg_ident = rand();
+	header.msg_ident = (unsigned int)random();
 	header.total_msg_size = count;
 	char *databuf = buf;
 

http://git-wip-us.apache.org/repos/asf/celix/blob/f7951b2b/pubsub/pubsub_admin_udp_mc/private/src/topic_publication.c
----------------------------------------------------------------------
diff --git a/pubsub/pubsub_admin_udp_mc/private/src/topic_publication.c b/pubsub/pubsub_admin_udp_mc/private/src/topic_publication.c
index 982c8fc..e43ec29 100644
--- a/pubsub/pubsub_admin_udp_mc/private/src/topic_publication.c
+++ b/pubsub/pubsub_admin_udp_mc/private/src/topic_publication.c
@@ -372,7 +372,7 @@ static int pubsub_localMsgTypeIdForUUID(void* handle, const char* msgType,
unsig
 
 static unsigned int rand_range(unsigned int min, unsigned int max){
 
-	double scaled = (double)(((double)rand())/((double)RAND_MAX));
+	double scaled = (double)(((double)random())/((double)RAND_MAX));
 	return (max-min+1)*scaled + min;
 
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/f7951b2b/pubsub/pubsub_admin_zmq/private/src/topic_publication.c
----------------------------------------------------------------------
diff --git a/pubsub/pubsub_admin_zmq/private/src/topic_publication.c b/pubsub/pubsub_admin_zmq/private/src/topic_publication.c
index 2adb1af..34c25b3 100644
--- a/pubsub/pubsub_admin_zmq/private/src/topic_publication.c
+++ b/pubsub/pubsub_admin_zmq/private/src/topic_publication.c
@@ -561,7 +561,7 @@ static int pubsub_localMsgTypeIdForUUID(void* handle, const char* msgType,
unsig
 
 static unsigned int rand_range(unsigned int min, unsigned int max){
 
-	double scaled = (double)(((double)rand())/((double)RAND_MAX));
+	double scaled = (double)(((double)random())/((double)RAND_MAX));
 	return (max-min+1)*scaled + min;
 
 }


Mime
View raw message