Browse code

acc(k): Rename '*_timeval' variables to '*_time' to decouple name from type.

Timo Reimann authored on 27/09/2011 22:02:53
Showing 1 changed files
... ...
@@ -244,8 +244,8 @@ static struct timeval time_from_string( str* time_value)
244 244
 /* set the duration in the dialog struct */
245 245
 static int set_duration( struct dlg_cell* dialog)
246 246
 {
247
-    struct timeval start_timeval = time_error;
248
-    struct timeval end_timeval = time_error;
247
+    struct timeval start_time = time_error;
248
+    struct timeval end_time = time_error;
249 249
     int milliseconds = -1;
250 250
     int seconds = -1;
251 251
     char buffer[ time_buffer_length];
... ...
@@ -258,35 +258,35 @@ static int set_duration( struct dlg_cell* dialog)
258 258
         return -1;
259 259
     }
260 260
 
261
-    start_timeval = time_from_string( dlgb.get_dlg_var( dialog, (str*)&start_id));
262
-    end_timeval  = time_from_string( dlgb.get_dlg_var( dialog, (str*)&end_id));
261
+    start_time = time_from_string( dlgb.get_dlg_var( dialog, (str*)&start_id));
262
+    end_time  = time_from_string( dlgb.get_dlg_var( dialog, (str*)&end_id));
263 263
 
264
-    if( is_time_equal( start_timeval, time_error) ||
265
-        is_time_equal( end_timeval, time_error))
264
+    if( is_time_equal( start_time, time_error) ||
265
+        is_time_equal( end_time, time_error))
266 266
     {
267 267
         LM_ERR( "failed to extract time from start or/and end-time\n");
268 268
         return -1;
269 269
     }
270 270
 
271
-    if( start_timeval.tv_usec >= milliseconds_max ||
272
-        end_timeval.tv_usec >= milliseconds_max)
271
+    if( start_time.tv_usec >= milliseconds_max ||
272
+        end_time.tv_usec >= milliseconds_max)
273 273
     {
274 274
         LM_ERR( "start-(%d) or/and end-time(%d) is out of the maximum of %d\n",
275
-                start_timeval.tv_usec,
276
-                end_timeval.tv_usec,
275
+                start_time.tv_usec,
276
+                end_time.tv_usec,
277 277
                 milliseconds_max);
278 278
         return -1;
279 279
     }
280 280
 
281
-    milliseconds = end_timeval.tv_usec < start_timeval.tv_usec ?
281
+    milliseconds = end_time.tv_usec < start_time.tv_usec ?
282 282
                                 ( milliseconds_max +
283
-                                  end_timeval.tv_usec -
284
-                                  start_timeval.tv_usec) :
285
-                                ( end_timeval.tv_usec - start_timeval.tv_usec);
283
+                                  end_time.tv_usec -
284
+                                  start_time.tv_usec) :
285
+                                ( end_time.tv_usec - start_time.tv_usec);
286 286
 
287
-    seconds = end_timeval.tv_sec -
288
-              start_timeval.tv_sec -
289
-              ( end_timeval.tv_usec < start_timeval.tv_usec ? 1 : 0);
287
+    seconds = end_time.tv_sec -
288
+              start_time.tv_sec -
289
+              ( end_time.tv_usec < start_time.tv_usec ? 1 : 0);
290 290
 
291 291
     if( seconds < 0)
292 292
     {