[evolution-patches] e-d-s: replace gettimeofday() with g_get_current_time()



gettimeofday() doesn't exist in Windows. g_get_current_time() is a
wrapper for the same functionality (modulo the timezone parameter,
which isn't used in e-d-s). OK to apply?

--tml

Index: addressbook/backends/groupwise/e-book-backend-groupwise.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/backends/groupwise/e-book-backend-groupwise.c,v
retrieving revision 1.66
diff -p -u -2 -r1.66 e-book-backend-groupwise.c
--- addressbook/backends/groupwise/e-book-backend-groupwise.c	5 Aug 2005 11:12:21 -0000	1.66
+++ addressbook/backends/groupwise/e-book-backend-groupwise.c	16 Aug 2005 22:27:47 -0000
@@ -2046,5 +2046,5 @@ book_view_thread (gpointer data)
 	gboolean is_auto_completion = FALSE;
 	char *search_string = NULL;
-	struct timeval start, end;
+	GTimeVal start, end;
 	unsigned long diff;
 
@@ -2117,5 +2117,5 @@ book_view_thread (gpointer data)
 
 		if (enable_debug)
-			gettimeofday(&start, NULL);
+			g_get_current_time(&start);
 
 		filter = e_book_backend_groupwise_build_gw_filter (gwb, query, &is_auto_completion, &search_string);
@@ -2172,5 +2172,5 @@ book_view_thread (gpointer data)
 				bonobo_object_unref (book_view);
 				if (enable_debug) {
-					gettimeofday(&end, NULL);
+					g_get_current_time(&end);
 					diff = end.tv_sec * 1000 + end.tv_usec/1000;
 					diff -= start.tv_sec * 1000 + start.tv_usec/1000;
@@ -2259,5 +2259,5 @@ book_view_thread (gpointer data)
 
 		if (enable_debug) {
-			gettimeofday(&end, NULL);
+			g_get_current_time(&end);
 			diff = end.tv_sec * 1000 + end.tv_usec/1000;
 			diff -= start.tv_sec * 1000 + start.tv_usec/1000;
@@ -2433,10 +2433,10 @@ build_cache (EBookBackendGroupwise *ebgw
 	GroupwiseBackendSearchClosure *closure;
 	char *status_msg;
-	struct timeval start, end;
-	struct timeval tstart, tend;
+	GTimeVal start, end;
+	GTimeVal tstart, tend;
 	unsigned long diff;
 
 	if (enable_debug) {
-		gettimeofday(&start, NULL);
+		g_get_current_time(&start);
 		printf("Building the cache for %s \n", ebgw->priv->book_name);
 	}
@@ -2464,10 +2464,10 @@ build_cache (EBookBackendGroupwise *ebgw
 
 		if (enable_debug) 
-			gettimeofday(&tstart, NULL);
+			g_get_current_time(&tstart);
 		status = e_gw_connection_read_cursor (priv->cnc, priv->container_id, 
 						      cursor, TRUE, CURSOR_ITEM_LIMIT, 
 						      position, &gw_items);
 		if (enable_debug) {
-			gettimeofday(&tend, NULL);
+			g_get_current_time(&tend);
 			diff = tend.tv_sec * 1000 + tend.tv_usec/1000;
 			diff -= tstart.tv_sec * 1000 + tstart.tv_usec/1000;
@@ -2523,5 +2523,5 @@ build_cache (EBookBackendGroupwise *ebgw
 
 	if (enable_debug) {
-		gettimeofday(&end, NULL);
+		g_get_current_time(&end);
 		diff = end.tv_sec * 1000 + end.tv_usec/1000;
 		diff -= start.tv_sec * 1000 + start.tv_usec/1000;
@@ -2537,9 +2537,9 @@ build_summary (EBookBackendGroupwisePriv
 	gchar *query_string;
 	GList *contacts, *temp_list = NULL;
-	struct timeval start, end;
+	GTimeVal start, end;
 	unsigned long diff;
 
 	if (enable_debug) {
-		gettimeofday(&start, NULL);
+		g_get_current_time(&start);
 		printf ("summary file not found or not up-to-date, building summary for %s\n", 
 			priv->book_name);
@@ -2563,5 +2563,5 @@ build_summary (EBookBackendGroupwisePriv
 	
 	if (enable_debug) {
-		gettimeofday(&end, NULL);
+		g_get_current_time(&end);
 		diff = end.tv_sec * 1000 + end.tv_usec/1000;
 		diff -= start.tv_sec * 1000 + start.tv_usec/1000;
@@ -2585,9 +2585,9 @@ update_cache (EBookBackendGroupwise *ebg
 	EDataBookView *book_view;
 	GroupwiseBackendSearchClosure *closure;
-	struct timeval start, end;
+	GTimeVal start, end;
 	unsigned long diff;
 
 	if (enable_debug) {
-		gettimeofday(&start, NULL);
+		g_get_current_time(&start);
 		printf("updating cache for %s\n", ebgw->priv->book_name);
 	}
@@ -2672,5 +2672,5 @@ update_cache (EBookBackendGroupwise *ebg
 
 	if (enable_debug) {
-		gettimeofday(&end, NULL);
+		g_get_current_time(&end);
 		diff = end.tv_sec * 1000 + end.tv_usec/1000;
 		diff -= start.tv_sec * 1000 + start.tv_usec/1000;
@@ -2743,5 +2743,5 @@ update_address_book_deltas (EBookBackend
 	}
 
-	struct timeval start, end;
+	GTimeVal start, end;
 	unsigned long diff;
 	const char *cache_file_name;
@@ -2750,5 +2750,5 @@ update_address_book_deltas (EBookBackend
 
 	if (enable_debug)
-		gettimeofday(&start, NULL);
+		g_get_current_time(&start);
 
 	book_view = find_book_view (ebgw);
@@ -2889,5 +2889,5 @@ update_address_book_deltas (EBookBackend
 
 	if (enable_debug) {
-		gettimeofday(&end, NULL);
+		g_get_current_time(&end);
 		diff = end.tv_sec * 1000 + end.tv_usec/1000;
 		diff -= start.tv_sec * 1000 + start.tv_usec/1000;
Index: camel/camel-operation.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-operation.c,v
retrieving revision 1.22
diff -p -u -2 -r1.22 camel-operation.c
--- camel/camel-operation.c	20 Dec 2004 09:00:06 -0000	1.22
+++ camel/camel-operation.c	16 Aug 2005 22:28:04 -0000
@@ -567,7 +567,7 @@ camel_operation_start_transient (CamelOp
 static unsigned int stamp(void)
 {
-	struct timeval tv;
+	GTimeVal tv;
 
-	gettimeofday(&tv, NULL);
+	g_get_current_time(&tv);
 	/* update 4 times/second */
 	return (tv.tv_sec * 4) + tv.tv_usec / (1000000/4);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]