[xiph-cvs] cvs commit: timing timing.c timing.h
Jack Moffitt
jack at xiph.org
Fri Oct 19 22:03:25 PDT 2001
jack 01/10/19 22:03:25
Modified: . timing.c timing.h
Log:
Change long long to the more standard uint64_t. This will need to be
typedefed for some platforms.
Revision Changes Path
1.2 +5 -4 timing/timing.c
Index: timing.c
===================================================================
RCS file: /usr/local/cvsroot/timing/timing.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- timing.c 2001/09/10 02:29:35 1.1
+++ timing.c 2001/10/20 05:03:24 1.2
@@ -3,6 +3,7 @@
*/
#include <stdlib.h>
+#include <stdint.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
@@ -16,7 +17,7 @@
/*
* Returns milliseconds no matter what.
*/
-long long timing_get_time(void)
+uint64_t timing_get_time(void)
{
#ifdef _WIN32
return timeGetTime();
@@ -25,16 +26,16 @@
gettimeofday(&mtv, NULL);
- return (long long)(mtv.tv_sec) * 1000 + (long long)(mtv.tv_usec) / 1000;
+ return (uint64_t)(mtv.tv_sec) * 1000 + (uint64_t)(mtv.tv_usec) / 1000;
#endif
}
-void timing_sleep(long long sleeptime)
+void timing_sleep(uint64_t sleeptime)
{
struct timeval sleeper;
sleeper.tv_sec = 0;
sleeper.tv_usec = sleeptime * 1000;
- select(0, NULL, NULL, NULL, &sleeper);
+ select(1, NULL, NULL, NULL, &sleeper);
}
1.2 +4 -2 timing/timing.h
Index: timing.h
===================================================================
RCS file: /usr/local/cvsroot/timing/timing.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- timing.h 2001/09/10 02:29:36 1.1
+++ timing.h 2001/10/20 05:03:24 1.2
@@ -1,7 +1,9 @@
#ifndef __TIMING_H__
#define __TIMING_H__
-long long timing_get_time(void);
-void timing_sleep(long long sleeptime);
+#include <stdint.h>
+
+uint64_t timing_get_time(void);
+void timing_sleep(uint64_t sleeptime);
#endif /* __TIMING_H__ */
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list