s/G_MICROSEC/G_USEC_PER_SEC/
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Wed, 6 Sep 2000 13:56:17 +0000 (13:56 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Wed, 6 Sep 2000 13:56:17 +0000 (13:56 +0000)
2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* glib.h, gtimer.c, tests/thread-test.c:
s/G_MICROSEC/G_USEC_PER_SEC/

* gthread/gthread-posix.c, gthread/gthread-solaris.c:
s/G_MICROSEC/G_USEC_PER_SEC/ and s/G_NANOSEC/G_NSEC_PER_SEC/

16 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib.h
glib/glib.h
glib/gtimer.c
gthread/ChangeLog
gthread/gthread-posix.c
gthread/gthread-solaris.c
gtimer.c
tests/thread-test.c

index 108f583153a94f7053c4aa5a0e5d98ee5baf4c81..7d401b41bfe7921119b701d419355022ae4c8658 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, gtimer.c, tests/thread-test.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/
+
        * glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
        they are really superfluous.
 
index 108f583153a94f7053c4aa5a0e5d98ee5baf4c81..7d401b41bfe7921119b701d419355022ae4c8658 100644 (file)
@@ -1,5 +1,8 @@
 2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, gtimer.c, tests/thread-test.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/
+
        * glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
        they are really superfluous.
 
index 108f583153a94f7053c4aa5a0e5d98ee5baf4c81..7d401b41bfe7921119b701d419355022ae4c8658 100644 (file)
@@ -1,5 +1,8 @@
 2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, gtimer.c, tests/thread-test.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/
+
        * glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
        they are really superfluous.
 
index 108f583153a94f7053c4aa5a0e5d98ee5baf4c81..7d401b41bfe7921119b701d419355022ae4c8658 100644 (file)
@@ -1,5 +1,8 @@
 2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, gtimer.c, tests/thread-test.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/
+
        * glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
        they are really superfluous.
 
index 108f583153a94f7053c4aa5a0e5d98ee5baf4c81..7d401b41bfe7921119b701d419355022ae4c8658 100644 (file)
@@ -1,5 +1,8 @@
 2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, gtimer.c, tests/thread-test.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/
+
        * glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
        they are really superfluous.
 
index 108f583153a94f7053c4aa5a0e5d98ee5baf4c81..7d401b41bfe7921119b701d419355022ae4c8658 100644 (file)
@@ -1,5 +1,8 @@
 2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, gtimer.c, tests/thread-test.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/
+
        * glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
        they are really superfluous.
 
index 108f583153a94f7053c4aa5a0e5d98ee5baf4c81..7d401b41bfe7921119b701d419355022ae4c8658 100644 (file)
@@ -1,5 +1,8 @@
 2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, gtimer.c, tests/thread-test.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/
+
        * glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
        they are really superfluous.
 
index 108f583153a94f7053c4aa5a0e5d98ee5baf4c81..7d401b41bfe7921119b701d419355022ae4c8658 100644 (file)
@@ -1,5 +1,8 @@
 2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
+       * glib.h, gtimer.c, tests/thread-test.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/
+
        * glib.h: Removed G_G{U}{SHORT|INT|LONG}_FORMAT from glib.h, as
        they are really superfluous.
 
diff --git a/glib.h b/glib.h
index 521cb8ff22a10cdb7c0ebec18d3b19fa200cc409..3206d59d68a307a21c0c74cc9d30823b2870d1aa 100644 (file)
--- a/glib.h
+++ b/glib.h
@@ -1636,7 +1636,8 @@ void g_blow_chunks (void);
 /* Timer
  */
 
-#define G_MICROSEC 1000000
+/* microseconds per second */
+#define G_USEC_PER_SEC 1000000
 
 GTimer* g_timer_new    (void);
 void   g_timer_destroy (GTimer  *timer);
index 521cb8ff22a10cdb7c0ebec18d3b19fa200cc409..3206d59d68a307a21c0c74cc9d30823b2870d1aa 100644 (file)
@@ -1636,7 +1636,8 @@ void g_blow_chunks (void);
 /* Timer
  */
 
-#define G_MICROSEC 1000000
+/* microseconds per second */
+#define G_USEC_PER_SEC 1000000
 
 GTimer* g_timer_new    (void);
 void   g_timer_destroy (GTimer  *timer);
index 5309ffffae412743ab089f3dfa3f502588322daf..299d638c8898124c1c81a9b4955fe71551186f74 100644 (file)
@@ -176,7 +176,7 @@ g_timer_elapsed (GTimer *timer,
 
   if (rtimer->start.tv_usec > rtimer->end.tv_usec)
     {
-      rtimer->end.tv_usec += G_MICROSEC;
+      rtimer->end.tv_usec += G_USEC_PER_SEC;
       rtimer->end.tv_sec--;
     }
 
@@ -213,12 +213,12 @@ g_usleep (gulong microseconds)
       
       g_get_current_time (&end_time);
       
-      end_time.tv_sec += microseconds / G_MICROSEC;
-      end_time.tv_usec += microseconds % G_MICROSEC;
+      end_time.tv_sec += microseconds / G_USEC_PER_SEC;
+      end_time.tv_usec += microseconds % G_USEC_PER_SEC;
       
-      if (end_time.tv_usec >= G_MICROSEC)
+      if (end_time.tv_usec >= G_USEC_PER_SEC)
        {
-         end_time.tv_usec -= G_MICROSEC;
+         end_time.tv_usec -= G_USEC_PER_SEC;
          end_time.tv_sec += 1;
        }
       
@@ -236,8 +236,8 @@ g_usleep (gulong microseconds)
   else
     {
       struct timeval tv;
-      tv.tv_sec = microseconds / G_MICROSEC;
-      tv.tv_usec = microseconds % G_MICROSEC;
+      tv.tv_sec = microseconds / G_USEC_PER_SEC;
+      tv.tv_usec = microseconds % G_USEC_PER_SEC;
       select(0, NULL, NULL, NULL, &tv);
     }
 #endif
index 4a35bfa12e2c9c569d396018b4172928d6b043ab..7abe93c3ae7c3a17cd5f6c785ea44aa494c1d5d3 100644 (file)
@@ -1,3 +1,8 @@
+2000-09-06  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthread-posix.c, gthread-solaris.c:
+       s/G_MICROSEC/G_USEC_PER_SEC/ and s/G_NANOSEC/G_NSEC_PER_SEC/    
+
 2000-09-01  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread-posix.c (g_thread_create_posix_impl): Use GError to
index 5516a296464dc28a50d9142e090203317236e492..bae02f10c8ca28cb0682bc4d90686934af60c82f 100644 (file)
@@ -142,8 +142,7 @@ g_cond_new_posix_impl (void)
    without error check then!!!!, we might want to change this
    therfore. */
 
-#define G_MICROSEC 1000000
-#define G_NANOSEC 1000000000
+#define G_NSEC_PER_SEC 1000000000
 
 static gboolean
 g_cond_timed_wait_posix_impl (GCond * cond,
@@ -164,8 +163,8 @@ g_cond_timed_wait_posix_impl (GCond * cond,
     }
 
   end_time.tv_sec = abs_time->tv_sec;
-  end_time.tv_nsec = abs_time->tv_usec * (G_NANOSEC / G_MICROSEC);
-  g_assert (end_time.tv_nsec < G_NANOSEC);
+  end_time.tv_nsec = abs_time->tv_usec * (G_NSEC_PER_SEC / G_USEC_PER_SEC);
+  g_assert (end_time.tv_nsec < G_NSEC_PER_SEC);
   result = pthread_cond_timedwait ((pthread_cond_t *) cond,
                                   (pthread_mutex_t *) entered_mutex,
                                   &end_time);
index 7cf3c6ff0a31f0312635ed9ce9d1d501c504dc34..99e5ee97ab16ae0f1e7ca972476ceef6dce16bad 100644 (file)
@@ -108,8 +108,7 @@ g_cond_new_solaris_impl ()
    without error check then!!!!, we might want to change this
    therfore. */
 
-#define G_MICROSEC 1000000
-#define G_NANOSEC 1000000000
+#define G_NSEC_PER_SEC 1000000000
 
 static gboolean
 g_cond_timed_wait_solaris_impl (GCond * cond, 
@@ -130,8 +129,8 @@ g_cond_timed_wait_solaris_impl (GCond * cond,
     }
 
   end_time.tv_sec = abs_time->tv_sec;
-  end_time.tv_nsec = abs_time->tv_usec * (G_NANOSEC / G_MICROSEC);
-  g_assert (end_time.tv_nsec < G_NANOSEC);
+  end_time.tv_nsec = abs_time->tv_usec * (G_NSEC_PER_SEC / G_USEC_PER_SEC);
+  g_assert (end_time.tv_nsec < G_NSEC_PER_SEC);
   result = cond_timedwait ((cond_t *) cond, (mutex_t *) entered_mutex,
                           &end_time);
   timed_out = (result == ETIME);
index 5309ffffae412743ab089f3dfa3f502588322daf..299d638c8898124c1c81a9b4955fe71551186f74 100644 (file)
--- a/gtimer.c
+++ b/gtimer.c
@@ -176,7 +176,7 @@ g_timer_elapsed (GTimer *timer,
 
   if (rtimer->start.tv_usec > rtimer->end.tv_usec)
     {
-      rtimer->end.tv_usec += G_MICROSEC;
+      rtimer->end.tv_usec += G_USEC_PER_SEC;
       rtimer->end.tv_sec--;
     }
 
@@ -213,12 +213,12 @@ g_usleep (gulong microseconds)
       
       g_get_current_time (&end_time);
       
-      end_time.tv_sec += microseconds / G_MICROSEC;
-      end_time.tv_usec += microseconds % G_MICROSEC;
+      end_time.tv_sec += microseconds / G_USEC_PER_SEC;
+      end_time.tv_usec += microseconds % G_USEC_PER_SEC;
       
-      if (end_time.tv_usec >= G_MICROSEC)
+      if (end_time.tv_usec >= G_USEC_PER_SEC)
        {
-         end_time.tv_usec -= G_MICROSEC;
+         end_time.tv_usec -= G_USEC_PER_SEC;
          end_time.tv_sec += 1;
        }
       
@@ -236,8 +236,8 @@ g_usleep (gulong microseconds)
   else
     {
       struct timeval tv;
-      tv.tv_sec = microseconds / G_MICROSEC;
-      tv.tv_usec = microseconds % G_MICROSEC;
+      tv.tv_sec = microseconds / G_USEC_PER_SEC;
+      tv.tv_usec = microseconds % G_USEC_PER_SEC;
       select(0, NULL, NULL, NULL, &tv);
     }
 #endif
index 1316982a8d80593e40b806b9fd3ca759bae1f0a0..1fc6b836551c421f319cdfb9f1829d2c1547cb2d 100644 (file)
@@ -28,7 +28,7 @@ test_g_mutex (void)
   thread = g_thread_create (test_g_mutex_thread, 
                            GINT_TO_POINTER (42),
                            0, TRUE, TRUE, G_THREAD_PRIORITY_NORMAL, NULL);
-  g_usleep (G_MICROSEC);
+  g_usleep (G_USEC_PER_SEC);
   test_g_mutex_int = 42;
   G_UNLOCK (test_g_mutex);
   g_mutex_unlock (test_g_mutex_mutex);
@@ -63,14 +63,14 @@ test_g_static_rec_mutex (void)
   thread = g_thread_create (test_g_static_rec_mutex_thread, 
                            GINT_TO_POINTER (42),
                            0, TRUE, TRUE, G_THREAD_PRIORITY_NORMAL, NULL);
-  g_usleep (G_MICROSEC);
+  g_usleep (G_USEC_PER_SEC);
   g_assert (g_static_rec_mutex_trylock (&test_g_static_rec_mutex_mutex));
-  g_usleep (G_MICROSEC);
+  g_usleep (G_USEC_PER_SEC);
   test_g_static_rec_mutex_int = 41;
   g_static_rec_mutex_unlock (&test_g_static_rec_mutex_mutex);
   test_g_static_rec_mutex_int = 42;  
   g_static_rec_mutex_unlock (&test_g_static_rec_mutex_mutex);
-  g_usleep (G_MICROSEC);
+  g_usleep (G_USEC_PER_SEC);
   g_static_rec_mutex_lock (&test_g_static_rec_mutex_mutex);
   test_g_static_rec_mutex_int = 0;  
   g_static_rec_mutex_unlock (&test_g_static_rec_mutex_mutex);
@@ -121,7 +121,7 @@ test_g_static_private_thread (gpointer data)
                                test_g_static_private_destructor);
        }
       *private = number;
-      g_usleep (G_MICROSEC / 5);
+      g_usleep (G_USEC_PER_SEC / 5);
       g_assert (number == *private);
     }
 }
@@ -215,7 +215,7 @@ test_g_static_rw_lock ()
                                    0, 0, TRUE, TRUE, 
                                    G_THREAD_PRIORITY_NORMAL, NULL);      
     }
-  g_usleep (G_MICROSEC);
+  g_usleep (G_USEC_PER_SEC);
   test_g_static_rw_lock_run = FALSE;
   for (i = 0; i < THREADS; i++)
     {