[Pcsclite-cvs-commit] r4403 - in /trunk/PCSC/src: utils.c utils.h winscard.c winscard_clnt.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue Sep 29 13:17:40 UTC 2009
Author: rousseau
Date: Tue Sep 29 13:17:40 2009
New Revision: 4403
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4403
Log:
move time_sub() in utils.c
Modified:
trunk/PCSC/src/utils.c
trunk/PCSC/src/utils.h
trunk/PCSC/src/winscard.c
trunk/PCSC/src/winscard_clnt.c
Modified: trunk/PCSC/src/utils.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/utils.c?rev=4403&op=diff
==============================================================================
--- trunk/PCSC/src/utils.c (original)
+++ trunk/PCSC/src/utils.c Tue Sep 29 13:17:40 2009
@@ -211,3 +211,21 @@
return 0;
} /* CheckForOpenCT */
+/**
+ * return the difference (as long int) in µs between 2 struct timeval
+ * r = a - b
+ */
+long int time_sub(struct timeval *a, struct timeval *b)
+{
+ struct timeval r;
+ r.tv_sec = a -> tv_sec - b -> tv_sec;
+ r.tv_usec = a -> tv_usec - b -> tv_usec;
+ if (r.tv_usec < 0)
+ {
+ r.tv_sec--;
+ r.tv_usec += 1000000;
+ }
+
+ return r.tv_sec * 1000000 + r.tv_usec;
+} /* time_sub */
+
Modified: trunk/PCSC/src/utils.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/utils.h?rev=4403&op=diff
==============================================================================
--- trunk/PCSC/src/utils.h (original)
+++ trunk/PCSC/src/utils.h Tue Sep 29 13:17:40 2009
@@ -26,5 +26,7 @@
int CheckForOpenCT(void);
+long int time_sub(struct timeval *a, struct timeval *b);
+
#endif
Modified: trunk/PCSC/src/winscard.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard.c?rev=4403&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Tue Sep 29 13:17:40 2009
@@ -141,21 +141,6 @@
gettimeofday(&profile_time_start, NULL);
} /* profile_start */
-
-/* r = a - b */
-static long int time_sub(struct timeval *a, struct timeval *b)
-{
- struct timeval r;
- r.tv_sec = a -> tv_sec - b -> tv_sec;
- r.tv_usec = a -> tv_usec - b -> tv_usec;
- if (r.tv_usec < 0)
- {
- r.tv_sec--;
- r.tv_usec += 1000000;
- }
-
- return r.tv_sec * 1000000 + r.tv_usec;
-} /* time_sub */
static void profile_end(const char *f, int line)
Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=4403&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Tue Sep 29 13:17:40 2009
@@ -49,21 +49,6 @@
#define TRUE 1
#define FALSE 0
#endif
-
-/* r = a - b */
-static long int time_sub(struct timeval *a, struct timeval *b)
-{
- struct timeval r;
- r.tv_sec = a -> tv_sec - b -> tv_sec;
- r.tv_usec = a -> tv_usec - b -> tv_usec;
- if (r.tv_usec < 0)
- {
- r.tv_sec--;
- r.tv_usec += 1000000;
- }
-
- return r.tv_sec * 1000000 + r.tv_usec;
-} /* time_sub */
#undef DO_PROFILE
More information about the Pcsclite-cvs-commit
mailing list