summaryrefslogtreecommitdiff
path: root/rpmio/rpmsw.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-04-02 21:16:26 +0000
committerjbj <devnull@localhost>2003-04-02 21:16:26 +0000
commit95f01d39a57c3c3d8ebf80cfd78e67c550dc32e5 (patch)
treed8eaa0d6c4bb93c5c12a18a3e066de0d68e3aae2 /rpmio/rpmsw.c
parent1f366d6a00d1cf8dc08a40fe789a1b68b4b80a5a (diff)
downloadlibrpm-tizen-95f01d39a57c3c3d8ebf80cfd78e67c550dc32e5.tar.gz
librpm-tizen-95f01d39a57c3c3d8ebf80cfd78e67c550dc32e5.tar.bz2
librpm-tizen-95f01d39a57c3c3d8ebf80cfd78e67c550dc32e5.zip
Splint clean.
CVS patchset: 6729 CVS date: 2003/04/02 21:16:26
Diffstat (limited to 'rpmio/rpmsw.c')
-rw-r--r--rpmio/rpmsw.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/rpmio/rpmsw.c b/rpmio/rpmsw.c
index 6c6d9af7c..4d521deb2 100644
--- a/rpmio/rpmsw.c
+++ b/rpmio/rpmsw.c
@@ -8,8 +8,10 @@
#if defined(__LCLINT__)
/*@-exportheader@*/
-extern int nanosleep(const struct timespec *req, /*@out@*/ struct timespec *rem)
- /*@modifies rem @*/;
+extern int nanosleep(const struct timespec *__requested_time,
+ /*@out@*/ /*@null@*/ struct timespec *__remaining)
+ /*@globals errno @*/
+ /*@modifies *__remaining, errno @*/;
/*@=exportheader@*/
#endif
@@ -153,7 +155,9 @@ static rpmtime_t rpmswCalibrate(void)
int rc;
int i;
+/*@-uniondef@*/
(void) rpmswNow(&begin);
+/*@=uniondef@*/
req.tv_sec = 0;
req.tv_nsec = 20 * 1000 * 1000;
for (i = 0; i < 100; i++) {
@@ -166,7 +170,9 @@ static rpmtime_t rpmswCalibrate(void)
break;
req = rem; /* structure assignment */
}
+/*@-uniondef@*/
ticks = rpmswDiff(rpmswNow(&end), &begin);
+/*@=uniondef@*/
return ticks;
}
@@ -199,7 +205,9 @@ rpmtime_t rpmswInit(void)
/* Start wall clock. */
rpmsw_type = 0;
+/*@-uniondef@*/
(void) rpmswNow(&begin);
+/*@=uniondef@*/
/* Get no. of cycles in 20ms nanosleep */
rpmsw_type = 1;
@@ -209,7 +217,9 @@ rpmtime_t rpmswInit(void)
/* Compute wall clock delta in usecs. */
rpmsw_type = 0;
+/*@-uniondef@*/
usecs = rpmswDiff(rpmswNow(&end), &begin);
+/*@=uniondef@*/
rpmsw_type = 1;
@@ -224,8 +234,10 @@ rpmtime_t rpmswInit(void)
#endif
/* Calculate timing overhead in usecs. */
+/*@-uniondef@*/
(void) rpmswNow(&begin);
usecs = rpmswDiff(rpmswNow(&end), &begin);
+/*@=uniondef@*/
rpmsw_overhead *= i;
rpmsw_overhead += usecs;
@@ -241,7 +253,9 @@ rpmtime_t rpmswInit(void)
int rpmswEnter(rpmop op)
{
op->count++;
+/*@-uniondef@*/
(void) rpmswNow(&op->begin);
+/*@=uniondef@*/
return 0;
}
@@ -249,7 +263,9 @@ int rpmswExit(rpmop op, ssize_t rc)
{
struct rpmsw_s end;
+/*@-uniondef@*/
op->usecs += rpmswDiff(rpmswNow(&end), &op->begin);
+/*@=uniondef@*/
if (rc > 0)
op->bytes += rc;
return 0;