Commit 86c6f74a79ef61582b636d478a9852ae54d87e2e

Vicent Martí 2013-05-15T08:31:37

Merge pull request #1583 from linquize/whitespace Unify whitespaces to tabs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
diff --git a/include/git2/attr.h b/include/git2/attr.h
index f099245..0d8a910 100644
--- a/include/git2/attr.h
+++ b/include/git2/attr.h
@@ -141,7 +141,7 @@ GIT_EXTERN(git_attr_t) git_attr_value(const char *attr);
  */
 GIT_EXTERN(int) git_attr_get(
 	const char **value_out,
-    git_repository *repo,
+	git_repository *repo,
 	uint32_t flags,
 	const char *path,
 	const char *name);
diff --git a/include/git2/config.h b/include/git2/config.h
index 724788a..8d1a1a5 100644
--- a/include/git2/config.h
+++ b/include/git2/config.h
@@ -190,9 +190,9 @@ GIT_EXTERN(int) git_config_open_ondisk(git_config **out, const char *path);
  * multi-level parent config, or an error code
  */
 GIT_EXTERN(int) git_config_open_level(
-    git_config **out,
-    const git_config *parent,
-    unsigned int level);
+	git_config **out,
+	const git_config *parent,
+	unsigned int level);
 
 /**
  * Open the global/XDG configuration file according to git's rules
@@ -459,11 +459,11 @@ GIT_EXTERN(int) git_config_foreach_match(
  * @return 0 on success, error code otherwise
  */
 GIT_EXTERN(int) git_config_get_mapped(
-      int *out,
-      const git_config *cfg,
-      const char *name,
-      const git_cvar_map *maps,
-      size_t map_n);
+	int *out,
+	const git_config *cfg,
+	const char *name,
+	const git_cvar_map *maps,
+	size_t map_n);
 
 /**
  * Maps a string value to an integer constant
diff --git a/include/git2/inttypes.h b/include/git2/inttypes.h
index 7160842..17364c7 100644
--- a/include/git2/inttypes.h
+++ b/include/git2/inttypes.h
@@ -283,18 +283,18 @@ _inline
 #endif // STATIC_IMAXDIV ]
 imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
 {
-   imaxdiv_t result;
+	imaxdiv_t result;
 
-   result.quot = numer / denom;
-   result.rem = numer % denom;
+	result.quot = numer / denom;
+	result.rem = numer % denom;
 
-   if (numer < 0 && result.rem > 0) {
-      // did division wrong; must fix up
-      ++result.quot;
-      result.rem -= denom;
-   }
+	if (numer < 0 && result.rem > 0) {
+		// did division wrong; must fix up
+		++result.quot;
+		result.rem -= denom;
+	}
 
-   return result;
+	return result;
 }
 
 // 7.8.2.3 The strtoimax and strtoumax functions
diff --git a/include/git2/merge.h b/include/git2/merge.h
index 8ca90b9..738d8e0 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -54,7 +54,7 @@ typedef struct {
 	 */
 	unsigned int target_limit;
 
-    /** Pluggable similarity metric; pass NULL to use internal metric */
+	/** Pluggable similarity metric; pass NULL to use internal metric */
 	git_diff_similarity_metric *metric;
 	
 	/** Flags for automerging content. */
diff --git a/include/git2/repository.h b/include/git2/repository.h
index e0464c6..bb2b3db 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -545,11 +545,11 @@ GIT_EXTERN(int) git_repository_mergehead_foreach(git_repository *repo,
  *             applied when calculating the hash.
  */
 GIT_EXTERN(int) git_repository_hashfile(
-    git_oid *out,
-    git_repository *repo,
-    const char *path,
-    git_otype type,
-    const char *as_path);
+	git_oid *out,
+	git_repository *repo,
+	const char *path,
+	git_otype type,
+	const char *as_path);
 
 /**
  * Make the repository HEAD point to the specified reference.
diff --git a/include/git2/reset.h b/include/git2/reset.h
index c7c9519..c367817 100644
--- a/include/git2/reset.h
+++ b/include/git2/reset.h
@@ -72,9 +72,9 @@ GIT_EXTERN(int) git_reset(
  * @return 0 on success or an error code < 0
  */
 GIT_EXTERN(int) git_reset_default(
-    git_repository *repo,
-    git_object *target,
-    git_strarray* pathspecs);
+	git_repository *repo,
+	git_object *target,
+	git_strarray* pathspecs);
 
 /** @} */
 GIT_END_DECL
diff --git a/include/git2/strarray.h b/include/git2/strarray.h
index d338eb7..86fa25f 100644
--- a/include/git2/strarray.h
+++ b/include/git2/strarray.h
@@ -20,8 +20,8 @@ GIT_BEGIN_DECL
 
 /** Array of strings */
 typedef struct git_strarray {
-    char **strings;
-    size_t count;
+	char **strings;
+	size_t count;
 } git_strarray;
 
 /**
diff --git a/include/git2/sys/refdb_backend.h b/include/git2/sys/refdb_backend.h
index 8dbf38c..548597f 100644
--- a/include/git2/sys/refdb_backend.h
+++ b/include/git2/sys/refdb_backend.h
@@ -39,7 +39,7 @@ struct git_reference_iterator {
 
 /** An instance for a custom backend */
 struct git_refdb_backend {
-    unsigned int version;
+	unsigned int version;
 
 	/**
 	 * Queries the refdb backend to determine if the given ref_name
diff --git a/src/attr.c b/src/attr.c
index 6dd2c7e..9fe4471 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -36,7 +36,7 @@ static int collect_attr_files(
 
 int git_attr_get(
 	const char **value,
-    git_repository *repo,
+	git_repository *repo,
 	uint32_t flags,
 	const char *pathname,
 	const char *name)
@@ -88,10 +88,10 @@ typedef struct {
 
 int git_attr_get_many(
 	const char **values,
-    git_repository *repo,
+	git_repository *repo,
 	uint32_t flags,
 	const char *pathname,
-    size_t num_attr,
+	size_t num_attr,
 	const char **names)
 {
 	int error;
@@ -151,7 +151,7 @@ cleanup:
 
 
 int git_attr_foreach(
-    git_repository *repo,
+	git_repository *repo,
 	uint32_t flags,
 	const char *pathname,
 	int (*callback)(const char *name, const char *value, void *payload),
diff --git a/src/attr_file.h b/src/attr_file.h
index d8abcda..15bba1c 100644
--- a/src/attr_file.h
+++ b/src/attr_file.h
@@ -47,14 +47,14 @@ typedef struct {
 typedef struct {
 	git_refcount unused;
 	const char *name;
-    uint32_t name_hash;
+	uint32_t name_hash;
 } git_attr_name;
 
 typedef struct {
 	git_refcount rc;		/* for macros */
 	char *name;
-    uint32_t name_hash;
-    const char *value;
+	uint32_t name_hash;
+	const char *value;
 } git_attr_assignment;
 
 typedef struct {
diff --git a/src/checkout.c b/src/checkout.c
index 6835db0..68028df 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -770,7 +770,7 @@ static int blob_content_to_link(
 	int error;
 
 	if ((error = git_futils_mkpath2file(path, dir_mode)) < 0)
-        return error;
+		return error;
 	
 	if ((error = git_blob__getbuf(&linktarget, blob)) < 0)
 		return error;
diff --git a/src/config.c b/src/config.c
index bd629f7..dc8c702 100644
--- a/src/config.c
+++ b/src/config.c
@@ -236,9 +236,9 @@ int git_config_open_global(git_config **cfg_out, git_config *cfg)
 }
 
 int git_config_open_level(
-    git_config **cfg_out,
-    const git_config *cfg_parent,
-    unsigned int level)
+	git_config **cfg_out,
+	const git_config *cfg_parent,
+	unsigned int level)
 {
 	git_config *cfg;
 	file_internal *internal;
diff --git a/src/date.c b/src/date.c
index ce1721a..48841e4 100644
--- a/src/date.c
+++ b/src/date.c
@@ -823,8 +823,8 @@ static void pending_number(struct tm *tm, int *num)
 }
 
 static git_time_t approxidate_str(const char *date,
-                                  const struct timeval *tv,
-                                  int *error_ret)
+									const struct timeval *tv,
+									int *error_ret)
 {
 	int number = 0;
 	int touched = 0;
@@ -866,7 +866,7 @@ int git__date_parse(git_time_t *out, const char *date)
 	int offset, error_ret=0;
 
 	if (!parse_date_basic(date, &timestamp, &offset)) {
-      *out = timestamp;
+		*out = timestamp;
 		return 0;
 	}
 
diff --git a/src/diff_output.c b/src/diff_output.c
index 07fcf47..be1ff56 100644
--- a/src/diff_output.c
+++ b/src/diff_output.c
@@ -1712,12 +1712,12 @@ notfound:
 }
 
 static int print_to_buffer_cb(
-    const git_diff_delta *delta,
-    const git_diff_range *range,
-    char line_origin,
-    const char *content,
-    size_t content_len,
-    void *payload)
+	const git_diff_delta *delta,
+	const git_diff_range *range,
+	char line_origin,
+	const char *content,
+	size_t content_len,
+	void *payload)
 {
 	git_buf *output = payload;
 	GIT_UNUSED(delta); GIT_UNUSED(range); GIT_UNUSED(line_origin);
@@ -1797,16 +1797,16 @@ int git_diff__paired_foreach(
 	i_max = idx2head ? idx2head->deltas.length : 0;
 	j_max = wd2idx   ? wd2idx->deltas.length   : 0;
 
-   /* Get appropriate strcmp function */
-   strcomp = idx2head ? idx2head->strcomp : wd2idx ? wd2idx->strcomp : NULL;
+	/* Get appropriate strcmp function */
+	strcomp = idx2head ? idx2head->strcomp : wd2idx ? wd2idx->strcomp : NULL;
 
-   /* Assert both iterators use matching ignore-case. If this function ever
-    * supports merging diffs that are not sorted by the same function, then
-    * it will need to spool and sort on one of the results before merging
-    */
-   if (idx2head && wd2idx) {
-       assert(idx2head->strcomp == wd2idx->strcomp);
-   }
+	/* Assert both iterators use matching ignore-case. If this function ever
+	* supports merging diffs that are not sorted by the same function, then
+	* it will need to spool and sort on one of the results before merging
+	*/
+	if (idx2head && wd2idx) {
+		assert(idx2head->strcomp == wd2idx->strcomp);
+	}
 
 	for (i = 0, j = 0; i < i_max || j < j_max; ) {
 		i2h = idx2head ? GIT_VECTOR_GET(&idx2head->deltas,i) : NULL;
diff --git a/src/hash/hash_generic.h b/src/hash/hash_generic.h
index b731de8..6b60c98 100644
--- a/src/hash/hash_generic.h
+++ b/src/hash/hash_generic.h
@@ -11,9 +11,9 @@
 #include "hash.h"
 
 struct git_hash_ctx {
-    unsigned long long size;
-    unsigned int H[5];
-    unsigned int W[16];
+	unsigned long long size;
+	unsigned int H[5];
+	unsigned int W[16];
 };
 
 #define git_hash_global_init() 0
diff --git a/src/hash/hash_win32.h b/src/hash/hash_win32.h
index daa769b..2eee5ca 100644
--- a/src/hash/hash_win32.h
+++ b/src/hash/hash_win32.h
@@ -48,10 +48,10 @@ struct hash_cryptoapi_prov {
 
 /* Function declarations for CNG */
 typedef NTSTATUS (WINAPI *hash_win32_cng_open_algorithm_provider_fn)(
-    HANDLE /* BCRYPT_ALG_HANDLE */ *phAlgorithm,
-    LPCWSTR pszAlgId,
-    LPCWSTR pszImplementation,
-    DWORD dwFlags);
+	HANDLE /* BCRYPT_ALG_HANDLE */ *phAlgorithm,
+	LPCWSTR pszAlgId,
+	LPCWSTR pszImplementation,
+	DWORD dwFlags);
 
 typedef NTSTATUS (WINAPI *hash_win32_cng_get_property_fn)(
 	HANDLE /* BCRYPT_HANDLE */ hObject,
diff --git a/src/merge.h b/src/merge.h
index 6307d15..da1fdf4 100644
--- a/src/merge.h
+++ b/src/merge.h
@@ -70,41 +70,41 @@ typedef enum {
 
 
 typedef struct {
-    git_repository *repo;
-    git_pool pool;
+	git_repository *repo;
+	git_pool pool;
 	
-    /* Vector of git_index_entry that represent the merged items that
+	/* Vector of git_index_entry that represent the merged items that
 	 * have been staged, either because only one side changed, or because
 	 * the two changes were non-conflicting and mergeable.  These items
 	 * will be written as staged entries in the main index.
 	 */
-    git_vector staged;
+	git_vector staged;
 	
-    /* Vector of git_merge_diff entries that represent the conflicts that
+	/* Vector of git_merge_diff entries that represent the conflicts that
 	 * have not been automerged.  These items will be written to high-stage
 	 * entries in the main index.
 	 */
-    git_vector conflicts;
+	git_vector conflicts;
 	
-    /* Vector of git_merge_diff that have been automerged.  These items
+	/* Vector of git_merge_diff that have been automerged.  These items
 	 * will be written to the REUC when the index is produced.
 	 */
-    git_vector resolved;
+	git_vector resolved;
 } git_merge_diff_list;
 
 /**
  * Description of changes to one file across three trees.
  */
 typedef struct {
-    git_merge_diff_type_t type;
+	git_merge_diff_type_t type;
 	
-    git_index_entry ancestor_entry;
+	git_index_entry ancestor_entry;
 	
-    git_index_entry our_entry;
-    git_delta_t our_status;
+	git_index_entry our_entry;
+	git_delta_t our_status;
 	
-    git_index_entry their_entry;
-    git_delta_t their_status;
+	git_index_entry their_entry;
+	git_delta_t their_status;
 } git_merge_diff;
 
 int git_merge__bases_many(
diff --git a/src/notes.c b/src/notes.c
index 4ca2aaa..3e3db58 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -579,30 +579,30 @@ cleanup:
 }
 
 int git_note_foreach(
-    git_repository *repo,
-    const char *notes_ref,
-    git_note_foreach_cb note_cb,
-    void *payload)
+	git_repository *repo,
+	const char *notes_ref,
+	git_note_foreach_cb note_cb,
+	void *payload)
 {
-    int error;
-    git_note_iterator *iter = NULL;
-    git_oid note_id, annotated_id;
+	int error;
+	git_note_iterator *iter = NULL;
+	git_oid note_id, annotated_id;
 
-    if ((error = git_note_iterator_new(&iter, repo, notes_ref)) < 0)
-        return error;
+	if ((error = git_note_iterator_new(&iter, repo, notes_ref)) < 0)
+		return error;
 
-    while (!(error = git_note_next(&note_id, &annotated_id, iter))) {
-        if (note_cb(&note_id, &annotated_id, payload)) {
-            error = GIT_EUSER;
-            break;
-        }
-    }
+	while (!(error = git_note_next(&note_id, &annotated_id, iter))) {
+		if (note_cb(&note_id, &annotated_id, payload)) {
+			error = GIT_EUSER;
+			break;
+		}
+	}
 
-    if (error == GIT_ITEROVER)
-        error = 0;
+	if (error == GIT_ITEROVER)
+		error = 0;
 
-    git_note_iterator_free(iter);
-    return error;
+	git_note_iterator_free(iter);
+	return error;
 }
 
 
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index c462a42..b9df83f 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -257,8 +257,8 @@ static int packed_load(refdb_fs_backend *backend)
 			if (packed_parse_peel(ref, &buffer_start, buffer_end) < 0)
 				goto parse_failed;
 		} else if (backend->peeling_mode == PEELING_FULL ||
-                           (backend->peeling_mode == PEELING_STANDARD &&
-                            git__prefixcmp(ref->name, GIT_REFS_TAGS_DIR) == 0)) {
+							(backend->peeling_mode == PEELING_STANDARD &&
+							git__prefixcmp(ref->name, GIT_REFS_TAGS_DIR) == 0)) {
 			ref->flags |= PACKREF_CANNOT_PEEL;
 		}
 
diff --git a/src/repository.c b/src/repository.c
index 4ab3921..9957f32 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1636,11 +1636,11 @@ int git_repository_message_remove(git_repository *repo)
 }
 
 int git_repository_hashfile(
-    git_oid *out,
-    git_repository *repo,
-    const char *path,
-    git_otype type,
-    const char *as_path)
+	git_oid *out,
+	git_repository *repo,
+	const char *path,
+	git_otype type,
+	const char *as_path)
 {
 	int error;
 	git_vector filters = GIT_VECTOR_INIT;
diff --git a/src/transports/local.c b/src/transports/local.c
index bd3bf93..2530a84 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -495,7 +495,7 @@ static int local_download_pack(
 			/* Tag or some other wanted object. Add it on its own */
 			error = git_packbuilder_insert(pack, &rhead->oid, rhead->name);
 		}
-      git_object_free(obj);
+		git_object_free(obj);
 	}
 
 	/* Walk the objects, building a packfile */
diff --git a/src/util.h b/src/util.h
index 687afe0..6f876d0 100644
--- a/src/util.h
+++ b/src/util.h
@@ -262,22 +262,22 @@ GIT_INLINE(size_t) git__size_t_powerof2(size_t v)
 
 GIT_INLINE(bool) git__isupper(int c)
 {
-    return (c >= 'A' && c <= 'Z');
+	return (c >= 'A' && c <= 'Z');
 }
 
 GIT_INLINE(bool) git__isalpha(int c)
 {
-    return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
+	return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
 }
 
 GIT_INLINE(bool) git__isdigit(int c)
 {
-    return (c >= '0' && c <= '9');
+	return (c >= '0' && c <= '9');
 }
 
 GIT_INLINE(bool) git__isspace(int c)
 {
-    return (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r' || c == '\v' || c == 0x85 /* Unicode CR+LF */);
+	return (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r' || c == '\v' || c == 0x85 /* Unicode CR+LF */);
 }
 
 GIT_INLINE(bool) git__iswildcard(int c)
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index 52eb463..b911583 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -479,29 +479,29 @@ int p_send(GIT_SOCKET socket, const void *buffer, size_t length, int flags)
  * Borrowed from http://old.nabble.com/Porting-localtime_r-and-gmtime_r-td15282276.html
  * On Win32, `gmtime_r` doesn't exist but `gmtime` is threadsafe, so we can use that
  */
-struct tm * 
-p_localtime_r (const time_t *timer, struct tm *result) 
-{ 
-   struct tm *local_result; 
-   local_result = localtime (timer); 
-
-   if (local_result == NULL || result == NULL) 
-      return NULL; 
-
-   memcpy (result, local_result, sizeof (struct tm)); 
-   return result; 
-} 
-struct tm * 
-p_gmtime_r (const time_t *timer, struct tm *result) 
-{ 
-   struct tm *local_result; 
-   local_result = gmtime (timer); 
-
-   if (local_result == NULL || result == NULL) 
-      return NULL; 
-
-   memcpy (result, local_result, sizeof (struct tm)); 
-   return result; 
+struct tm *
+p_localtime_r (const time_t *timer, struct tm *result)
+{
+	struct tm *local_result;
+	local_result = localtime (timer);
+
+	if (local_result == NULL || result == NULL)
+		return NULL;
+
+	memcpy (result, local_result, sizeof (struct tm));
+	return result;
+}
+struct tm *
+p_gmtime_r (const time_t *timer, struct tm *result)
+{
+	struct tm *local_result;
+	local_result = gmtime (timer);
+
+	if (local_result == NULL || result == NULL)
+		return NULL;
+
+	memcpy (result, local_result, sizeof (struct tm));
+	return result;
 }
 
 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
@@ -514,44 +514,44 @@ p_gmtime_r (const time_t *timer, struct tm *result)
 #define _TIMEZONE_DEFINED
 struct timezone 
 {
-   int  tz_minuteswest; /* minutes W of Greenwich */
-   int  tz_dsttime;     /* type of dst correction */
+	int  tz_minuteswest; /* minutes W of Greenwich */
+	int  tz_dsttime;     /* type of dst correction */
 };
 #endif
- 
+
 int p_gettimeofday(struct timeval *tv, struct timezone *tz)
 {
-   FILETIME ft;
-   unsigned __int64 tmpres = 0;
-   static int tzflag;
- 
-   if (NULL != tv)
-      {
-         GetSystemTimeAsFileTime(&ft);
- 
-         tmpres |= ft.dwHighDateTime;
-         tmpres <<= 32;
-         tmpres |= ft.dwLowDateTime;
- 
-         /*converting file time to unix epoch*/
-         tmpres /= 10;  /*convert into microseconds*/
-         tmpres -= DELTA_EPOCH_IN_MICROSECS; 
-         tv->tv_sec = (long)(tmpres / 1000000UL);
-         tv->tv_usec = (long)(tmpres % 1000000UL);
-      }
- 
-   if (NULL != tz)
-      {
-         if (!tzflag)
-            {
-               _tzset();
-               tzflag++;
-            }
-         tz->tz_minuteswest = _timezone / 60;
-         tz->tz_dsttime = _daylight;
-      }
- 
-   return 0;
+	FILETIME ft;
+	unsigned __int64 tmpres = 0;
+	static int tzflag;
+
+	if (NULL != tv)
+	{
+		GetSystemTimeAsFileTime(&ft);
+
+		tmpres |= ft.dwHighDateTime;
+		tmpres <<= 32;
+		tmpres |= ft.dwLowDateTime;
+
+		/*converting file time to unix epoch*/
+		tmpres /= 10;  /*convert into microseconds*/
+		tmpres -= DELTA_EPOCH_IN_MICROSECS; 
+		tv->tv_sec = (long)(tmpres / 1000000UL);
+		tv->tv_usec = (long)(tmpres % 1000000UL);
+	}
+
+	if (NULL != tz)
+	{
+		 if (!tzflag)
+		{
+			_tzset();
+			tzflag++;
+		}
+		tz->tz_minuteswest = _timezone / 60;
+		tz->tz_dsttime = _daylight;
+	}
+
+	return 0;
 }
 
 int p_inet_pton(int af, const char* src, void* dst)