Commit 2510268a269cd79e5cfa68ce8f56e540131f3b6d

Edward Thomson 2018-07-14T14:00:26

Merge pull request #4700 from pks-t/pks/std-c90 C90 standard compliance

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
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d411751..fd84666 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,7 +196,7 @@ ELSE ()
 	ENABLE_WARNINGS(extra)
 
 	IF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
-		SET(CMAKE_C_FLAGS "-std=c99 -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS ${CMAKE_C_FLAGS}")
+		SET(CMAKE_C_FLAGS "-D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS ${CMAKE_C_FLAGS}")
 	ENDIF()
 
 	SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -O0")
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index ca7515e..49edaec 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,7 +1,10 @@
 INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDES})
+INCLUDE_DIRECTORIES(SYSTEM ${LIBGIT2_SYSTEM_INCLUDES})
 
 FILE(GLOB_RECURSE SRC_EXAMPLE_GIT2 network/*.c network/*.h common.?)
 ADD_EXECUTABLE(cgit2 ${SRC_EXAMPLE_GIT2})
+SET_TARGET_PROPERTIES(cgit2 PROPERTIES C_STANDARD 90)
+
 IF(WIN32 OR ANDROID)
 	TARGET_LINK_LIBRARIES(cgit2 git2)
 ELSE()
@@ -14,5 +17,6 @@ FOREACH(src_app ${SRC_EXAMPLE_APPS})
 	IF(NOT ${app_name} STREQUAL "common")
 		ADD_EXECUTABLE(${app_name} ${src_app} "common.c")
 		TARGET_LINK_LIBRARIES(${app_name} git2)
+		SET_TARGET_PROPERTIES(${app_name} PROPERTIES C_STANDARD 90)
 	ENDIF()
 ENDFOREACH()
diff --git a/examples/general.c b/examples/general.c
index 0780d3d..15b415a 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -145,11 +145,13 @@ static void oid_parsing(git_oid *oid)
 	 */
 	git_oid_fromstr(oid, hex);
 
-	// Once we've converted the string into the oid value, we can get the raw
-	// value of the SHA by accessing `oid.id`
-
-	// Next we will convert the 20 byte raw SHA1 value to a human readable 40
-	// char hex value.
+	/*
+	 * Once we've converted the string into the oid value, we can get the raw
+	 * value of the SHA by accessing `oid.id`
+	 *
+	 * Next we will convert the 20 byte raw SHA1 value to a human readable 40
+	 * char hex value.
+	 */
 	printf("\n*Raw to Hex*\n");
 	out[GIT_OID_HEXSZ] = '\0';
 
diff --git a/examples/network/clone.c b/examples/network/clone.c
index 540000b..ce4b6ae 100644
--- a/examples/network/clone.c
+++ b/examples/network/clone.c
@@ -48,7 +48,7 @@ static void print_progress(const progress_data *pd)
 
 static int sideband_progress(const char *str, int len, void *payload)
 {
-	(void)payload; // unused
+	(void)payload; /* unused */
 
 	printf("remote: %.*s", len, str);
 	fflush(stdout);
@@ -82,15 +82,15 @@ int do_clone(git_repository *repo, int argc, char **argv)
 	const char *path = argv[2];
 	int error;
 
-	(void)repo; // unused
+	(void)repo; /* unused */
 
-	// Validate args
+	/* Validate args */
 	if (argc < 3) {
 		printf ("USAGE: %s <url> <path>\n", argv[0]);
 		return -1;
 	}
 
-	// Set up options
+	/* Set up options */
 	checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE;
 	checkout_opts.progress_cb = checkout_progress;
 	checkout_opts.progress_payload = &pd;
@@ -100,7 +100,7 @@ int do_clone(git_repository *repo, int argc, char **argv)
 	clone_opts.fetch_opts.callbacks.credentials = cred_acquire_cb;
 	clone_opts.fetch_opts.callbacks.payload = &pd;
 
-	// Do the clone
+	/* Do the clone */
 	error = git_clone(&cloned_repo, url, path, &clone_opts);
 	printf("\n");
 	if (error != 0) {
diff --git a/examples/network/index-pack.c b/examples/network/index-pack.c
index 314f211..e926102 100644
--- a/examples/network/index-pack.c
+++ b/examples/network/index-pack.c
@@ -19,8 +19,10 @@
 #endif
 #include "common.h"
 
-// This could be run in the main loop whilst the application waits for
-// the indexing to finish in a worker thread
+/*
+ * This could be run in the main loop whilst the application waits for
+ * the indexing to finish in a worker thread
+ */
 static int index_cb(const git_transfer_progress *stats, void *data)
 {
 	(void)data;
diff --git a/examples/network/ls-remote.c b/examples/network/ls-remote.c
index 9329da5..fb258ac 100644
--- a/examples/network/ls-remote.c
+++ b/examples/network/ls-remote.c
@@ -12,7 +12,7 @@ static int use_remote(git_repository *repo, char *name)
 	size_t refs_len, i;
 	git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
 
-	// Find the remote by name
+	/* Find the remote by name */
 	error = git_remote_lookup(&remote, repo, name);
 	if (error < 0) {
 		error = git_remote_create_anonymous(&remote, repo, name);
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2deed5f..be733cc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,6 +16,7 @@ SET(LIBGIT2_INCLUDES
 	"${CMAKE_CURRENT_BINARY_DIR}"
 	"${libgit2_SOURCE_DIR}/src"
 	"${libgit2_SOURCE_DIR}/include")
+SET(LIBGIT2_SYSTEM_INCLUDES "")
 SET(LIBGIT2_LIBS "")
 
 # Installation paths
@@ -94,7 +95,7 @@ ADD_FEATURE_INFO(threadsafe THREADSAFE "threadsafe support")
 
 IF (WIN32 AND EMBED_SSH_PATH)
 	FILE(GLOB SRC_SSH "${EMBED_SSH_PATH}/src/*.c")
-	LIST(APPEND LIBGIT2_INCLUDES "${EMBED_SSH_PATH}/include")
+	LIST(APPEND LIBGIT2_SYSTEM_INCLUDES "${EMBED_SSH_PATH}/include")
 	FILE(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"")
 	SET(GIT_SSH 1)
 ENDIF()
@@ -107,7 +108,7 @@ IF (WIN32 AND WINHTTP)
 	IF (MINGW)
 		ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/winhttp" "${libgit2_BINARY_DIR}/deps/winhttp")
 		LIST(APPEND LIBGIT2_LIBS winhttp)
-		LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/winhttp")
+		LIST(APPEND LIBGIT2_SYSTEM_INCLUDES "${libgit2_SOURCE_DIR}/deps/winhttp")
 	ELSE()
 		LIST(APPEND LIBGIT2_LIBS "winhttp")
 		LIST(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
@@ -121,7 +122,7 @@ ELSE ()
 	ENDIF ()
 	IF (CURL_FOUND)
 		SET(GIT_CURL 1)
-		LIST(APPEND LIBGIT2_INCLUDES ${CURL_INCLUDE_DIRS})
+		LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${CURL_INCLUDE_DIRS})
 		LIST(APPEND LIBGIT2_LIBS ${CURL_LIBRARIES})
 		LIST(APPEND LIBGIT2_PC_LIBS ${CURL_LDFLAGS})
 	ENDIF()
@@ -174,7 +175,7 @@ IF (USE_HTTPS)
 		ENDIF()
 
 		SET(GIT_SECURE_TRANSPORT 1)
-		LIST(APPEND LIBGIT2_INCLUDES ${SECURITY_INCLUDE_DIR})
+		LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${SECURITY_INCLUDE_DIR})
 		LIST(APPEND LIBGIT2_LIBS ${COREFOUNDATION_LIBRARIES} ${SECURITY_LIBRARIES})
 		LIST(APPEND LIBGIT2_PC_LIBS ${COREFOUNDATION_LDFLAGS} ${SECURITY_LDFLAGS})
 	ELSEIF (HTTPS_BACKEND STREQUAL "OpenSSL")
@@ -183,7 +184,7 @@ IF (USE_HTTPS)
 		ENDIF()
 
 		SET(GIT_OPENSSL 1)
-		LIST(APPEND LIBGIT2_INCLUDES ${OPENSSL_INCLUDE_DIR})
+		LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${OPENSSL_INCLUDE_DIR})
 		LIST(APPEND LIBGIT2_LIBS ${OPENSSL_LIBRARIES})
 		LIST(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS})
 		LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
@@ -230,7 +231,7 @@ IF (USE_HTTPS)
 		ENDIF()
 
 		SET(GIT_MBEDTLS 1)
-		LIST(APPEND LIBGIT2_INCLUDES ${MBEDTLS_INCLUDE_DIR})
+		LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR})
 		LIST(APPEND LIBGIT2_LIBS ${MBEDTLS_LIBRARIES})
 		# mbedTLS has no pkgconfig file, hence we can't require it
 		# https://github.com/ARMmbed/mbedtls/issues/228
@@ -285,7 +286,7 @@ ELSEIF (SHA1_BACKEND STREQUAL "mbedTLS")
 	ADD_FEATURE_INFO(SHA ON "using mbedTLS")
 	SET(GIT_SHA1_MBEDTLS 1)
 	FILE(GLOB SRC_SHA1 hash/hash_mbedtls.c)
-	LIST(APPEND LIBGIT2_INCLUDES ${MBEDTLS_INCLUDE_DIR})
+	LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR})
 	LIST(APPEND LIBGIT2_LIBS ${MBEDTLS_LIBRARIES})
 	# mbedTLS has no pkgconfig file, hence we can't require it
 	# https://github.com/ARMmbed/mbedtls/issues/228
@@ -298,21 +299,21 @@ ENDIF()
 # Include POSIX regex when it is required
 IF(WIN32 OR AMIGA OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
 	ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/regex" "${libgit2_BINARY_DIR}/deps/regex")
-	LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/regex")
+	LIST(APPEND LIBGIT2_SYSTEM_INCLUDES "${libgit2_SOURCE_DIR}/deps/regex")
 	LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:regex>)
 ENDIF()
 
 # Optional external dependency: http-parser
 FIND_PACKAGE(HTTP_Parser)
 IF (USE_EXT_HTTP_PARSER AND HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
-	LIST(APPEND LIBGIT2_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS})
+	LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS})
 	LIST(APPEND LIBGIT2_LIBS ${HTTP_PARSER_LIBRARIES})
 	LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
 	ADD_FEATURE_INFO(http-parser ON "http-parser support")
 ELSE()
 	MESSAGE(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.")
 	ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/http-parser" "${libgit2_BINARY_DIR}/deps/http-parser")
-	LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/http-parser")
+	LIST(APPEND LIBGIT2_SYSTEM_INCLUDES "${libgit2_SOURCE_DIR}/deps/http-parser")
 	LIST(APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:http-parser>")
 	ADD_FEATURE_INFO(http-parser ON "http-parser support (bundled)")
 ENDIF()
@@ -321,7 +322,7 @@ ENDIF()
 IF(NOT USE_BUNDLED_ZLIB)
 	FIND_PACKAGE(ZLIB)
 	IF(ZLIB_FOUND)
-		LIST(APPEND LIBGIT2_INCLUDES ${ZLIB_INCLUDE_DIRS})
+		LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ZLIB_INCLUDE_DIRS})
 		LIST(APPEND LIBGIT2_LIBS ${ZLIB_LIBRARIES})
 		IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
 			LIST(APPEND LIBGIT2_LIBS "z")
@@ -336,7 +337,7 @@ IF(NOT USE_BUNDLED_ZLIB)
 ENDIF()
 IF(USE_BUNDLED_ZLIB OR NOT ZLIB_FOUND)
 	ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/zlib" "${libgit2_BINARY_DIR}/deps/zlib")
-	LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/zlib")
+	LIST(APPEND LIBGIT2_SYSTEM_INCLUDES "${libgit2_SOURCE_DIR}/deps/zlib")
 	LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
 	ADD_FEATURE_INFO(zlib ON "using bundled zlib")
 ENDIF()
@@ -347,7 +348,7 @@ IF (USE_SSH)
 ENDIF()
 IF (LIBSSH2_FOUND)
 	SET(GIT_SSH 1)
-	LIST(APPEND LIBGIT2_INCLUDES ${LIBSSH2_INCLUDE_DIRS})
+	LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${LIBSSH2_INCLUDE_DIRS})
 	LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES})
 	LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
 
@@ -376,7 +377,7 @@ IF (USE_ICONV)
 ENDIF()
 IF (ICONV_FOUND)
 	SET(GIT_USE_ICONV 1)
-	LIST(APPEND LIBGIT2_INCLUDES ${ICONV_INCLUDE_DIR})
+	LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ICONV_INCLUDE_DIR})
 	LIST(APPEND LIBGIT2_LIBS ${ICONV_LIBRARIES})
 	LIST(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
 ENDIF()
@@ -449,19 +450,24 @@ CONFIGURE_FILE(features.h.in git2/sys/features.h)
 SET(LIBGIT2_SOURCES ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_SSH} ${SRC_SHA1})
 
 ADD_LIBRARY(git2internal OBJECT ${LIBGIT2_SOURCES})
+SET_TARGET_PROPERTIES(git2internal PROPERTIES C_STANDARD 90)
 IDE_SPLIT_SOURCES(git2internal)
 LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:git2internal>)
 
 IF (${CMAKE_VERSION} VERSION_LESS 2.8.12)
 	INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDES})
+	INCLUDE_DIRECTORIES(SYSTEM ${LIBGIT2_SYSTEM_INCLUDES})
 ELSE()
 	TARGET_INCLUDE_DIRECTORIES(git2internal
 	    PRIVATE ${LIBGIT2_INCLUDES}
 	    PUBLIC ${libgit2_SOURCE_DIR}/include)
+	TARGET_INCLUDE_DIRECTORIES(git2internal
+	    SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
 ENDIF()
 
 SET(LIBGIT2_OBJECTS ${LIBGIT2_OBJECTS} PARENT_SCOPE)
 SET(LIBGIT2_INCLUDES ${LIBGIT2_INCLUDES} PARENT_SCOPE)
+SET(LIBGIT2_SYSTEM_INCLUDES ${LIBGIT2_SYSTEM_INCLUDES} PARENT_SCOPE)
 SET(LIBGIT2_LIBS ${LIBGIT2_LIBS} PARENT_SCOPE)
 
 IF(XCODE_VERSION)
@@ -475,6 +481,7 @@ ENDIF()
 ADD_LIBRARY(git2 ${WIN_RC} ${LIBGIT2_OBJECTS})
 TARGET_LINK_LIBRARIES(git2 ${LIBGIT2_LIBS})
 
+SET_TARGET_PROPERTIES(git2 PROPERTIES C_STANDARD 90)
 SET_TARGET_PROPERTIES(git2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
 SET_TARGET_PROPERTIES(git2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
 SET_TARGET_PROPERTIES(git2 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
diff --git a/src/common.h b/src/common.h
index 44063be..cb980c1 100644
--- a/src/common.h
+++ b/src/common.h
@@ -17,8 +17,10 @@
 /** Declare a function as always inlined. */
 #if defined(_MSC_VER)
 # define GIT_INLINE(type) static __inline type
+#elif defined(__GNUC__)
+# define GIT_INLINE(type) static __inline__ type
 #else
-# define GIT_INLINE(type) static inline type
+# define GIT_INLINE(type) static type
 #endif
 
 /** Support for gcc/clang __has_builtin intrinsic */
diff --git a/src/khash.h b/src/khash.h
index 71eb583..40e2d18 100644
--- a/src/khash.h
+++ b/src/khash.h
@@ -146,8 +146,10 @@ typedef unsigned long long khint64_t;
 #ifndef kh_inline
 #ifdef _MSC_VER
 #define kh_inline __inline
+#elif defined(__GNUC__)
+#define kh_inline __inline__
 #else
-#define kh_inline inline
+#define kh_inline
 #endif
 #endif /* kh_inline */
 
diff --git a/src/notes.c b/src/notes.c
index b4c0122..ebab0cd 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -285,7 +285,7 @@ static int note_write(
 	git_oid oid;
 	git_tree *tree = NULL;
 
-	// TODO: should we apply filters?
+	/* TODO: should we apply filters? */
 	/* create note object */
 	if ((error = git_blob_create_frombuffer(&oid, repo, note, strlen(note))) < 0)
 		goto cleanup;
diff --git a/src/refspec.c b/src/refspec.c
index aa6682b..f429776 100644
--- a/src/refspec.c
+++ b/src/refspec.c
@@ -16,7 +16,7 @@
 
 int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
 {
-	// Ported from https://github.com/git/git/blob/f06d47e7e0d9db709ee204ed13a8a7486149f494/remote.c#L518-636
+	/* Ported from https://github.com/git/git/blob/f06d47e7e0d9db709ee204ed13a8a7486149f494/remote.c#L518-636 */
 
 	size_t llen;
 	int is_glob = 0;
diff --git a/src/signature.c b/src/signature.c
index cd68523..286d0a6 100644
--- a/src/signature.c
+++ b/src/signature.c
@@ -247,7 +247,7 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
 
 			if ((tz_start[0] != '-' && tz_start[0] != '+') ||
 				git__strtol32(&offset, tz_start + 1, &tz_end, 10) < 0) {
-				//malformed timezone, just assume it's zero
+				/* malformed timezone, just assume it's zero */
 				offset = 0;
 			}
 
diff --git a/src/streams/mbedtls.c b/src/streams/mbedtls.c
index 0a49a36..7cecb2a 100644
--- a/src/streams/mbedtls.c
+++ b/src/streams/mbedtls.c
@@ -26,12 +26,23 @@
 #define GIT_DEFAULT_CERT_LOCATION NULL
 #endif
 
+/* Work around C90-conformance issues */
+#if defined(_MSC_VER)
+# define inline __inline
+#elif defined(__GNUC__)
+# define inline __inline__
+#else
+# define inline
+#endif
+
 #include <mbedtls/config.h>
 #include <mbedtls/ssl.h>
 #include <mbedtls/error.h>
 #include <mbedtls/entropy.h>
 #include <mbedtls/ctr_drbg.h>
 
+#undef inline
+
 mbedtls_ssl_config *git__ssl_conf;
 mbedtls_entropy_context *mbedtls_entropy;
 
diff --git a/src/trailer.c b/src/trailer.c
index 24c8847..dc8d1ab 100644
--- a/src/trailer.c
+++ b/src/trailer.c
@@ -36,7 +36,7 @@ static const char *next_line(const char *str)
 	if (nl) {
 		return nl + 1;
 	} else {
-		// return pointer to the NUL terminator:
+		/* return pointer to the NUL terminator: */
 		return str + strlen(str);
 	}
 }
@@ -310,12 +310,12 @@ int git_message_trailers(git_message_trailer_array *trailer_arr, const char *mes
 				}
 
 				if (isalnum(*ptr) || *ptr == '-') {
-					// legal key character
+					/* legal key character */
 					NEXT(S_KEY);
 				}
 
 				if (*ptr == ' ' || *ptr == '\t') {
-					// optional whitespace before separator
+					/* optional whitespace before separator */
 					*ptr = 0;
 					NEXT(S_KEY_WS);
 				}
@@ -325,7 +325,7 @@ int git_message_trailers(git_message_trailer_array *trailer_arr, const char *mes
 					NEXT(S_SEP_WS);
 				}
 
-				// illegal character
+				/* illegal character */
 				GOTO(S_IGNORE);
 			}
 			case S_KEY_WS: {
@@ -341,7 +341,7 @@ int git_message_trailers(git_message_trailer_array *trailer_arr, const char *mes
 					NEXT(S_SEP_WS);
 				}
 
-				// illegal character
+				/* illegal character */
 				GOTO(S_IGNORE);
 			}
 			case S_SEP_WS: {
@@ -369,7 +369,7 @@ int git_message_trailers(git_message_trailer_array *trailer_arr, const char *mes
 			}
 			case S_VALUE_NL: {
 				if (*ptr == ' ') {
-					// continuation;
+					/* continuation; */
 					NEXT(S_VALUE);
 				}
 
diff --git a/src/transports/smart.c b/src/transports/smart.c
index 619a81f..69c129b 100644
--- a/src/transports/smart.c
+++ b/src/transports/smart.c
@@ -82,7 +82,7 @@ static bool is_malformed_http_header(const char *http_header)
 	const char *c;
 	int name_len;
 
-	// Disallow \r and \n
+	/* Disallow \r and \n */
 	c = strchr(http_header, '\r');
 	if (c)
 		return true;
@@ -90,7 +90,7 @@ static bool is_malformed_http_header(const char *http_header)
 	if (c)
 		return true;
 
-	// Require a header name followed by :
+	/* Require a header name followed by : */
 	name_len = http_header_name_length(http_header);
 	if (name_len < 1)
 		return true;
@@ -112,7 +112,7 @@ static bool is_forbidden_custom_header(const char *custom_header)
 	unsigned long i;
 	int name_len = http_header_name_length(custom_header);
 
-	// Disallow headers that we set
+	/* Disallow headers that we set */
 	for (i = 0; i < ARRAY_SIZE(forbidden_custom_headers); i++)
 		if (strncmp(forbidden_custom_headers[i], custom_header, name_len) == 0)
 			return true;
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index f51e1e5..8617e45 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -832,7 +832,7 @@ int p_mkstemp(char *tmp_path)
 		return -1;
 #endif
 
-	return p_open(tmp_path, O_RDWR | O_CREAT | O_EXCL, 0744); //-V536
+	return p_open(tmp_path, O_RDWR | O_CREAT | O_EXCL, 0744); /* -V536 */
 }
 
 int p_access(const char* path, mode_t mode)
diff --git a/src/xdiff/xdiffi.c b/src/xdiff/xdiffi.c
index 3a71ef6..97db054 100644
--- a/src/xdiff/xdiffi.c
+++ b/src/xdiff/xdiffi.c
@@ -33,8 +33,10 @@
 /** Declare a function as always inlined. */
 #if defined(_MSC_VER)
 # define XDL_INLINE(type) static __inline type
+#elif defined(__GNUC__)
+# define XDL_INLINE(type) static __inline__ type
 #else
-# define XDL_INLINE(type) static inline type
+#define XDG_INLINE(type) static type
 #endif
 
 typedef struct s_xdpsplit {
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 82bf6d0..d75114b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -32,9 +32,11 @@ SET_SOURCE_FILES_PROPERTIES(
 	PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clar.suite)
 
 INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDES})
+INCLUDE_DIRECTORIES(SYSTEM ${LIBGIT2_SYSTEM_INCLUDES})
 
 ADD_EXECUTABLE(libgit2_clar ${SRC_CLAR} ${SRC_TEST} ${LIBGIT2_OBJECTS})
 
+SET_TARGET_PROPERTIES(libgit2_clar PROPERTIES C_STANDARD 90)
 SET_TARGET_PROPERTIES(libgit2_clar PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
 
 IF (${CMAKE_VERSION} VERSION_LESS 2.8.12)
diff --git a/tests/checkout/index.c b/tests/checkout/index.c
index a649d85..69252e3 100644
--- a/tests/checkout/index.c
+++ b/tests/checkout/index.c
@@ -146,7 +146,7 @@ void test_checkout_index__honor_coresymlinks_default(void)
 	const char *url = git_repository_path(g_repo);
 
 	cl_assert(getcwd(cwd, sizeof(cwd)) != NULL);
-	cl_assert_equal_i(0, p_mkdir("readonly", 0555)); // Read-only directory
+	cl_assert_equal_i(0, p_mkdir("readonly", 0555)); /* Read-only directory */
 	cl_assert_equal_i(0, chdir("readonly"));
 	cl_git_pass(git_repository_init(&repo, "../symlink.git", true));
 	cl_assert_equal_i(0, chdir(cwd));
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c
index a78bf82..a69574b 100644
--- a/tests/checkout/tree.c
+++ b/tests/checkout/tree.c
@@ -915,7 +915,7 @@ void test_checkout_tree__target_directory_from_bare(void)
 
 void test_checkout_tree__extremely_long_file_name(void)
 {
-	// A utf-8 string with 83 characters, but 249 bytes.
+	/* A utf-8 string with 83 characters, but 249 bytes. */
 	const char *longname = "\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97";
 	char path[1024];
 
diff --git a/tests/cherrypick/workdir.c b/tests/cherrypick/workdir.c
index d83f54b..e43bb08 100644
--- a/tests/cherrypick/workdir.c
+++ b/tests/cherrypick/workdir.c
@@ -12,7 +12,7 @@
 static git_repository *repo;
 static git_index *repo_index;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_cherrypick_workdir__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/commit/parse.c b/tests/commit/parse.c
index e61589d..47ec6dd 100644
--- a/tests/commit/parse.c
+++ b/tests/commit/parse.c
@@ -3,7 +3,7 @@
 #include "commit.h"
 #include "signature.h"
 
-// Fixture setup
+/* Fixture setup */
 static git_repository *g_repo;
 void test_commit_parse__initialize(void)
 {
@@ -15,7 +15,7 @@ void test_commit_parse__cleanup(void)
 }
 
 
-// Header parsing
+/* Header parsing */
 typedef struct {
 	const char *line;
 	const char *header;
@@ -70,7 +70,7 @@ void test_commit_parse__header(void)
 }
 
 
-// Signature parsing
+/* Signature parsing */
 typedef struct {
 	const char *string;
 	const char *header;
@@ -89,27 +89,27 @@ passing_signature_test_case passing_signature_cases[] = {
 	{"committer Vicent Marti <tanoku@gmail.com> 123456 +0000 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 0},
 	{"committer Vicent Marti <tanoku@gmail.com> 123456 +0100 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 60},
 	{"committer Vicent Marti <tanoku@gmail.com> 123456 -0100 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, -60},
-	// Parse a signature without an author field
+	/* Parse a signature without an author field */
 	{"committer <tanoku@gmail.com> 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60},
-	// Parse a signature without an author field
+	/* Parse a signature without an author field */
 	{"committer  <tanoku@gmail.com> 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60},
-	// Parse a signature with an empty author field
+	/* Parse a signature with an empty author field */
 	{"committer   <tanoku@gmail.com> 123456 -0100 \n", "committer ", "", "tanoku@gmail.com", 123456, -60},
-	// Parse a signature with an empty email field
+	/* Parse a signature with an empty email field */
 	{"committer Vicent Marti <> 123456 -0100 \n", "committer ", "Vicent Marti", "", 123456, -60},
-	// Parse a signature with an empty email field
+	/* Parse a signature with an empty email field */
 	{"committer Vicent Marti < > 123456 -0100 \n", "committer ", "Vicent Marti", "", 123456, -60},
-	// Parse a signature with empty name and email
+	/* Parse a signature with empty name and email */
 	{"committer <> 123456 -0100 \n", "committer ", "", "", 123456, -60},
-	// Parse a signature with empty name and email
+	/* Parse a signature with empty name and email */
 	{"committer  <> 123456 -0100 \n", "committer ", "", "", 123456, -60},
-	// Parse a signature with empty name and email
+	/* Parse a signature with empty name and email */
 	{"committer  < > 123456 -0100 \n", "committer ", "", "", 123456, -60},
-	// Parse an obviously invalid signature
+	/* Parse an obviously invalid signature */
 	{"committer foo<@bar> 123456 -0100 \n", "committer ", "foo", "@bar", 123456, -60},
-	// Parse an obviously invalid signature
+	/* Parse an obviously invalid signature */
 	{"committer    foo<@bar> 123456 -0100 \n", "committer ", "foo", "@bar", 123456, -60},
-	// Parse an obviously invalid signature
+	/* Parse an obviously invalid signature */
 	{"committer <>\n", "committer ", "", "", 0, 0},
 	{"committer Vicent Marti <tanoku@gmail.com> 123456 -1500 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 0},
 	{"committer Vicent Marti <tanoku@gmail.com> 123456 +0163 \n", "committer ", "Vicent Marti", "tanoku@gmail.com", 123456, 0},
@@ -173,65 +173,65 @@ void test_commit_parse__signature(void)
 
 
 static char *failing_commit_cases[] = {
-// empty commit
+/* empty commit */
 "",
-// random garbage
+/* random garbage */
 "asd97sa9du902e9a0jdsuusad09as9du098709aweu8987sd\n",
-// broken endlines 1
+/* broken endlines 1 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\r\n\
 parent 05452d6349abcd67aa396dfb28660d765d8b2a36\r\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\
 committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\
 \r\n\
 a test commit with broken endlines\r\n",
-// broken endlines 2
+/* broken endlines 2 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\
 parent 05452d6349abcd67aa396dfb28660d765d8b2a36\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\
 committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\
 \
 another test commit with broken endlines",
-// starting endlines
+/* starting endlines */
 "\ntree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 \n\
 a test commit with a starting endline\n",
-// corrupted commit 1
+/* corrupted commit 1 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent 05452d6349abcd67aa396df",
-// corrupted commit 2
+/* corrupted commit 2 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent ",
-// corrupted commit 3
+/* corrupted commit 3 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent ",
-// corrupted commit 4
+/* corrupted commit 4 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 par",
 };
 
 
 static char *passing_commit_cases[] = {
-// simple commit with no message
+/* simple commit with no message */
 "tree 1810dff58d8a660512d4832e740f692884338ccd\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 \n",
-// simple commit, no parent
+/* simple commit, no parent */
 "tree 1810dff58d8a660512d4832e740f692884338ccd\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 \n\
 a simple commit which works\n",
-// simple commit, no parent, no newline in message
+/* simple commit, no parent, no newline in message */
 "tree 1810dff58d8a660512d4832e740f692884338ccd\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 \n\
 a simple commit which works",
-// simple commit, 1 parent
+/* simple commit, 1 parent */
 "tree 1810dff58d8a660512d4832e740f692884338ccd\n\
 parent e90810b8df3e80c413d903f631643c716887138d\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
@@ -317,7 +317,7 @@ void test_commit_parse__entire_commit(void)
 }
 
 
-// query the details on a parsed commit
+/* query the details on a parsed commit */
 void test_commit_parse__details0(void) {
 	static const char *commit_ids[] = {
 		"a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */
@@ -365,7 +365,7 @@ void test_commit_parse__details0(void) {
 			old_parent = parent;
 			cl_git_pass(git_commit_parent(&parent, commit, p));
 			cl_assert(parent != NULL);
-			cl_assert(git_commit_author(parent) != NULL); // is it really a commit?
+			cl_assert(git_commit_author(parent) != NULL); /* is it really a commit? */
 		}
 		git_commit_free(old_parent);
 		git_commit_free(parent);
diff --git a/tests/commit/signature.c b/tests/commit/signature.c
index 286079f..78ddbbe 100644
--- a/tests/commit/signature.c
+++ b/tests/commit/signature.c
@@ -59,7 +59,7 @@ void test_commit_signature__angle_brackets_in_email_are_not_supported(void)
 
 void test_commit_signature__create_empties(void)
 {
-   // can not create a signature with empty name or email
+	/* can not create a signature with empty name or email */
 	cl_git_pass(try_build_signature("nulltoken", "emeric.fermas@gmail.com", 1234567890, 60));
 
 	cl_git_fail(try_build_signature("", "emeric.fermas@gmail.com", 1234567890, 60));
@@ -70,19 +70,19 @@ void test_commit_signature__create_empties(void)
 
 void test_commit_signature__create_one_char(void)
 {
-   // creating a one character signature
+	/* creating a one character signature */
 	assert_name_and_email("x", "foo@bar.baz", "x", "foo@bar.baz");
 }
 
 void test_commit_signature__create_two_char(void)
 {
-   // creating a two character signature
+	/* creating a two character signature */
 	assert_name_and_email("xx", "foo@bar.baz", "xx", "foo@bar.baz");
 }
 
 void test_commit_signature__create_zero_char(void)
 {
-   // creating a zero character signature
+	/* creating a zero character signature */
 	git_signature *sign;
 	cl_git_fail(git_signature_new(&sign, "", "x@y.z", 1234567890, 60));
 	cl_assert(sign == NULL);
diff --git a/tests/commit/write.c b/tests/commit/write.c
index 7b0af8c..2ba74ca 100644
--- a/tests/commit/write.c
+++ b/tests/commit/write.c
@@ -15,7 +15,7 @@ static char *head_old;
 static git_reference *head, *branch;
 static git_commit *commit;
 
-// Fixture setup
+/* Fixture setup */
 static git_repository *g_repo;
 void test_commit_write__initialize(void)
 {
@@ -42,7 +42,7 @@ void test_commit_write__cleanup(void)
 }
 
 
-// write a new commit object from memory to disk
+/* write a new commit object from memory to disk */
 void test_commit_write__from_memory(void)
 {
    git_oid tree_id, parent_id, commit_id;
@@ -137,7 +137,7 @@ This is a root commit\n\
 	git_signature_free(committer);
 }
 
-// create a root commit
+/* create a root commit */
 void test_commit_write__root(void)
 {
 	git_oid tree_id, commit_id;
diff --git a/tests/config/write.c b/tests/config/write.c
index cffa54e..521dcb0 100644
--- a/tests/config/write.c
+++ b/tests/config/write.c
@@ -365,7 +365,7 @@ void test_config_write__add_value_at_specific_level(void)
 	int64_t l, expected = +9223372036854775803;
 	git_buf buf = GIT_BUF_INIT;
 
-	// open config15 as global level config file
+	/* open config15 as global level config file */
 	cl_git_pass(git_config_new(&cfg));
 	cl_git_pass(git_config_add_file_ondisk(cfg, "config9",
 		GIT_CONFIG_LEVEL_LOCAL, NULL, 0));
@@ -381,7 +381,7 @@ void test_config_write__add_value_at_specific_level(void)
 	git_config_free(cfg_specific);
 	git_config_free(cfg);
 
-	// open config15 as local level config file
+	/* open config15 as local level config file */
 	cl_git_pass(git_config_open_ondisk(&cfg, "config15"));
 
 	cl_git_pass(git_config_get_int32(&i, cfg, "core.int32global"));
diff --git a/tests/core/filebuf.c b/tests/core/filebuf.c
index 51d8a01..8d1952f 100644
--- a/tests/core/filebuf.c
+++ b/tests/core/filebuf.c
@@ -8,7 +8,7 @@ void test_core_filebuf__0(void)
 	int fd;
 	char test[] = "test", testlock[] = "test.lock";
 
-	fd = p_creat(testlock, 0744); //-V536
+	fd = p_creat(testlock, 0744); /* -V536 */
 
 	cl_must_pass(fd);
 	cl_must_pass(p_close(fd));
diff --git a/tests/core/futils.c b/tests/core/futils.c
index c69c210..fce4848 100644
--- a/tests/core/futils.c
+++ b/tests/core/futils.c
@@ -1,7 +1,7 @@
 #include "clar_libgit2.h"
 #include "fileops.h"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_core_futils__initialize(void)
 {
 	cl_must_pass(p_mkdir("futils", 0777));
diff --git a/tests/core/vector.c b/tests/core/vector.c
index c2e5d3f..4e6f6fc 100644
--- a/tests/core/vector.c
+++ b/tests/core/vector.c
@@ -18,13 +18,13 @@ void test_core_vector__0(void)
 void test_core_vector__1(void)
 {
 	git_vector x;
-	// make initial capacity exact for our insertions.
+	/* make initial capacity exact for our insertions. */
 	git_vector_init(&x, 3, NULL);
 	git_vector_insert(&x, (void*) 0xabc);
 	git_vector_insert(&x, (void*) 0xdef);
 	git_vector_insert(&x, (void*) 0x123);
 
-	git_vector_remove(&x, 0); // used to read past array bounds.
+	git_vector_remove(&x, 0); /* used to read past array bounds. */
 	git_vector_free(&x);
 }
 
diff --git a/tests/date/rfc2822.c b/tests/date/rfc2822.c
index eda475a..d98c1f0 100644
--- a/tests/date/rfc2822.c
+++ b/tests/date/rfc2822.c
@@ -31,7 +31,7 @@ void test_date_rfc2822__format_rfc2822_negative_offset(void)
 
 void test_date_rfc2822__format_rfc2822_buffer_too_small(void)
 {
-	// "Wed, 10 Apr 2014 08:21:03 +0000"
+	/* "Wed, 10 Apr 2014 08:21:03 +0000" */
 	git_time t = {1397031663 + 86400, 0};
 	char buf[GIT_DATE_RFC2822_SZ-1];
 
diff --git a/tests/describe/t6120.c b/tests/describe/t6120.c
index 6df397e..65e8582 100644
--- a/tests/describe/t6120.c
+++ b/tests/describe/t6120.c
@@ -2,7 +2,7 @@
 #include "describe_helpers.h"
 #include "repository.h"
 
-// Ported from https://github.com/git/git/blob/adfc1857bdb090786fd9d22c1acec39371c76048/t/t6120-describe.sh
+/* Ported from https://github.com/git/git/blob/adfc1857bdb090786fd9d22c1acec39371c76048/t/t6120-describe.sh */
 
 static git_repository *repo;
 
diff --git a/tests/index/conflicts.c b/tests/index/conflicts.c
index cabef88..367d5b5 100644
--- a/tests/index/conflicts.c
+++ b/tests/index/conflicts.c
@@ -9,7 +9,7 @@ static git_index *repo_index;
 #define TEST_REPO_PATH "mergedrepo"
 #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_index_conflicts__initialize(void)
 {
 	repo = cl_git_sandbox_init("mergedrepo");
diff --git a/tests/index/names.c b/tests/index/names.c
index 5fa4b4e..11d2c41 100644
--- a/tests/index/names.c
+++ b/tests/index/names.c
@@ -10,7 +10,7 @@ static git_index *repo_index;
 #define TEST_REPO_PATH "mergedrepo"
 #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_index_names__initialize(void)
 {
 	repo = cl_git_sandbox_init("mergedrepo");
diff --git a/tests/index/nsec.c b/tests/index/nsec.c
index a20e3ea..dee1509 100644
--- a/tests/index/nsec.c
+++ b/tests/index/nsec.c
@@ -9,7 +9,7 @@ static git_index *repo_index;
 
 #define TEST_REPO_PATH "nsecs"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_index_nsec__initialize(void)
 {
 	repo = cl_git_sandbox_init("nsecs");
diff --git a/tests/index/reuc.c b/tests/index/reuc.c
index 134f499..1489ed1 100644
--- a/tests/index/reuc.c
+++ b/tests/index/reuc.c
@@ -18,7 +18,7 @@ static git_index *repo_index;
 #define TWO_OUR_OID "8f3c06cff9a83757cec40c80bc9bf31a2582bde9"
 #define TWO_THEIR_OID "887b153b165d32409c70163e0f734c090f12f673"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_index_reuc__initialize(void)
 {
 	repo = cl_git_sandbox_init("mergedrepo");
diff --git a/tests/index/stage.c b/tests/index/stage.c
index 58dc1fb..cdfe3a8 100644
--- a/tests/index/stage.c
+++ b/tests/index/stage.c
@@ -8,7 +8,7 @@ static git_index *repo_index;
 #define TEST_REPO_PATH "mergedrepo"
 #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_index_stage__initialize(void)
 {
 	repo = cl_git_sandbox_init("mergedrepo");
diff --git a/tests/merge/files.c b/tests/merge/files.c
index 6f5a1fd..27c9636 100644
--- a/tests/merge/files.c
+++ b/tests/merge/files.c
@@ -15,7 +15,7 @@
 static git_repository *repo;
 static git_index *repo_index;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_files__initialize(void)
 {
 	git_config *cfg;
diff --git a/tests/merge/trees/automerge.c b/tests/merge/trees/automerge.c
index 67f2cf7..e16b829 100644
--- a/tests/merge/trees/automerge.c
+++ b/tests/merge/trees/automerge.c
@@ -55,7 +55,7 @@ static git_repository *repo;
 	  "", \
 	  "5c3b68a71fc4fa5d362fd3875e53137c6a5ab7a5" }
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_trees_automerge__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/merge/trees/modeconflict.c b/tests/merge/trees/modeconflict.c
index d858b8f..e85e340 100644
--- a/tests/merge/trees/modeconflict.c
+++ b/tests/merge/trees/modeconflict.c
@@ -13,7 +13,7 @@ static git_repository *repo;
 #define DF_SIDE1_BRANCH		"df_side1"
 #define DF_SIDE2_BRANCH		"df_side2"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_trees_modeconflict__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/merge/trees/renames.c b/tests/merge/trees/renames.c
index 853bf2f..fbcfd2d 100644
--- a/tests/merge/trees/renames.c
+++ b/tests/merge/trees/renames.c
@@ -13,7 +13,7 @@ static git_repository *repo;
 #define BRANCH_RENAME_OURS					"rename_conflict_ours"
 #define BRANCH_RENAME_THEIRS				"rename_conflict_theirs"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_trees_renames__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/merge/trees/trivial.c b/tests/merge/trees/trivial.c
index c7f8d24..4a82556 100644
--- a/tests/merge/trees/trivial.c
+++ b/tests/merge/trees/trivial.c
@@ -13,7 +13,7 @@ static git_repository *repo;
 #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index"
 
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_trees_trivial__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/merge/trees/whitespace.c b/tests/merge/trees/whitespace.c
index b99583c..fdb1125 100644
--- a/tests/merge/trees/whitespace.c
+++ b/tests/merge/trees/whitespace.c
@@ -16,7 +16,7 @@ static git_repository *repo;
 #define BRANCH_A_CHANGE  "branch_a_change"
 #define BRANCH_B_CHANGE  "branch_b_change"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_trees_whitespace__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/merge/workdir/analysis.c b/tests/merge/workdir/analysis.c
index 84885c4..f87fc58 100644
--- a/tests/merge/workdir/analysis.c
+++ b/tests/merge/workdir/analysis.c
@@ -24,7 +24,7 @@ static git_index *repo_index;
 #define NOFASTFORWARD_ID		"7cb63eed597130ba4abb87b3e544b85021905520"
 
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_workdir_analysis__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/merge/workdir/renames.c b/tests/merge/workdir/renames.c
index fabcda2..a8ee59a 100644
--- a/tests/merge/workdir/renames.c
+++ b/tests/merge/workdir/renames.c
@@ -14,7 +14,7 @@ static git_repository *repo;
 #define BRANCH_RENAME_OURS					"rename_conflict_ours"
 #define BRANCH_RENAME_THEIRS				"rename_conflict_theirs"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_workdir_renames__initialize(void)
 {
 	git_config *cfg;
diff --git a/tests/merge/workdir/setup.c b/tests/merge/workdir/setup.c
index 92524e2..3a8f9d9 100644
--- a/tests/merge/workdir/setup.c
+++ b/tests/merge/workdir/setup.c
@@ -31,7 +31,7 @@ static git_index *repo_index;
 #define OCTO5_BRANCH		"octo5"
 #define OCTO5_OID			"e4f618a2c3ed0669308735727df5ebf2447f022f"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_workdir_setup__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c
index 32b2062..cff1a57 100644
--- a/tests/merge/workdir/simple.c
+++ b/tests/merge/workdir/simple.c
@@ -73,7 +73,7 @@ static git_index *repo_index;
 	  "5c3b68a71fc4fa5d362fd3875e53137c6a5ab7a5" }
 
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_workdir_simple__initialize(void)
 {
 	git_config *cfg;
diff --git a/tests/merge/workdir/submodules.c b/tests/merge/workdir/submodules.c
index c4cc188..35280e6 100644
--- a/tests/merge/workdir/submodules.c
+++ b/tests/merge/workdir/submodules.c
@@ -16,7 +16,7 @@ static git_repository *repo;
 
 #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_workdir_submodules__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/merge/workdir/trivial.c b/tests/merge/workdir/trivial.c
index 85cce49..39d1ddc 100644
--- a/tests/merge/workdir/trivial.c
+++ b/tests/merge/workdir/trivial.c
@@ -14,7 +14,7 @@ static git_index *repo_index;
 #define TEST_INDEX_PATH TEST_REPO_PATH "/.git/index"
 
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_merge_workdir_trivial__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/network/refspecs.c b/tests/network/refspecs.c
index 15d3624..1a65fd2 100644
--- a/tests/network/refspecs.c
+++ b/tests/network/refspecs.c
@@ -18,7 +18,7 @@ static void assert_refspec(unsigned int direction, const char *input, bool is_ex
 
 void test_network_refspecs__parsing(void)
 {
-	// Ported from https://github.com/git/git/blob/abd2bde78bd994166900290434a2048e660dabed/t/t5511-refspec.sh
+	/* Ported from https://github.com/git/git/blob/abd2bde78bd994166900290434a2048e660dabed/t/t5511-refspec.sh */
 
 	assert_refspec(GIT_DIRECTION_PUSH, "", false);
 	assert_refspec(GIT_DIRECTION_PUSH, ":", true);
@@ -40,8 +40,8 @@ void test_network_refspecs__parsing(void)
 	 * code.  They will be caught downstream anyway, but we may want to
 	 * have tighter check later...
 	 */
-	//assert_refspec(GIT_DIRECTION_PUSH, "refs/heads/master::refs/remotes/frotz/xyzzy", false);
-	//assert_refspec(GIT_DIRECTION_PUSH, "refs/heads/maste :refs/remotes/frotz/xyzzy", false);
+	/*assert_refspec(GIT_DIRECTION_PUSH, "refs/heads/master::refs/remotes/frotz/xyzzy", false); */
+	/*assert_refspec(GIT_DIRECTION_PUSH, "refs/heads/maste :refs/remotes/frotz/xyzzy", false); */
 
 	assert_refspec(GIT_DIRECTION_FETCH, "refs/heads/*:refs/remotes/frotz/*", true);
 	assert_refspec(GIT_DIRECTION_FETCH, "refs/heads/*:refs/remotes/frotz", false);
diff --git a/tests/object/lookupbypath.c b/tests/object/lookupbypath.c
index 13cd6a1..15e79f6 100644
--- a/tests/object/lookupbypath.c
+++ b/tests/object/lookupbypath.c
@@ -42,7 +42,7 @@ void test_object_lookupbypath__errors(void)
 {
 	cl_assert_equal_i(GIT_EINVALIDSPEC,
 			git_object_lookup_bypath(&g_actualobject, (git_object*)g_root_tree,
-				"subdir/subdir_test2.txt", GIT_OBJ_TREE)); // It's not a tree
+				"subdir/subdir_test2.txt", GIT_OBJ_TREE)); /* It's not a tree */
 	cl_assert_equal_i(GIT_ENOTFOUND,
 			git_object_lookup_bypath(&g_actualobject, (git_object*)g_root_tree,
 				"file/doesnt/exist", GIT_OBJ_ANY));
diff --git a/tests/object/message.c b/tests/object/message.c
index 519ce5f..bc00534 100644
--- a/tests/object/message.c
+++ b/tests/object/message.c
@@ -14,8 +14,8 @@ static void assert_message_prettifying(char *expected_output, char *input, int s
 
 #define t40 "A quick brown fox jumps over the lazy do"
 #define s40 "                                        "
-#define sss s40 s40 s40 s40 s40 s40 s40 s40 s40 s40 // # 400
-#define ttt t40 t40 t40 t40 t40 t40 t40 t40 t40 t40 // # 400
+#define sss s40 s40 s40 s40 s40 s40 s40 s40 s40 s40 /* # 400 */
+#define ttt t40 t40 t40 t40 t40 t40 t40 t40 t40 t40 /* # 400 */
 
 /* Ported from git.git */
 /* see https://github.com/git/git/blob/master/t/t0030-stripspace.sh */
diff --git a/tests/object/raw/write.c b/tests/object/raw/write.c
index 273f08f..c7270e2 100644
--- a/tests/object/raw/write.c
+++ b/tests/object/raw/write.c
@@ -16,7 +16,7 @@ void test_body(object_data *d, git_rawobj *o);
 
 
 
-// Helpers
+/* Helpers */
 static void remove_object_files(object_data *d)
 {
    cl_git_pass(p_unlink(d->file));
@@ -57,7 +57,7 @@ static void make_odb_dir(void)
 }
 
 
-// Standard test form
+/* Standard test form */
 void test_body(object_data *d, git_rawobj *o) 
 {
    git_odb *db;
diff --git a/tests/object/tag/list.c b/tests/object/tag/list.c
index 6d5a243..b8d507f 100644
--- a/tests/object/tag/list.c
+++ b/tests/object/tag/list.c
@@ -13,7 +13,7 @@ struct pattern_match_t
 	const char* expected_results[MAX_USED_TAGS];
 };
 
-// Helpers
+/* Helpers */
 static void ensure_tag_pattern_match(git_repository *repo,
 									 const struct pattern_match_t* data)
 {
@@ -34,7 +34,7 @@ static void ensure_tag_pattern_match(git_repository *repo,
 		goto exit;
 	}
 
-	// we have to be prepared that tags come in any order.
+	/* we have to be prepared that tags come in any order. */
 	for (i = 0; i < tag_list.count; i++)
 	{
 		for (j = 0; j < data->expected_matches; j++)
@@ -54,7 +54,7 @@ exit:
 	cl_git_pass(error);
 }
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_object_tag_list__initialize(void)
 {
 	g_repo = cl_git_sandbox_init("testrepo");
@@ -67,7 +67,7 @@ void test_object_tag_list__cleanup(void)
 
 void test_object_tag_list__list_all(void)
 {
-	// list all tag names from the repository
+	/* list all tag names from the repository */
 	git_strarray tag_list;
 
 	cl_git_pass(git_tag_list(&tag_list, g_repo));
@@ -78,37 +78,39 @@ void test_object_tag_list__list_all(void)
 }
 
 static const struct pattern_match_t matches[] = {
-	// All tags, including a packed one and two namespaced ones.
+	/* All tags, including a packed one and two namespaced ones. */
 	{ "", 6, { "e90810b", "point_to_blob", "test", "packed-tag", "foo/bar", "foo/foo/bar" } },
 
-	// beginning with
+	/* beginning with */
 	{ "t*", 1, { "test" } },
 
-	// ending with
+	/* ending with */
 	{ "*b", 2, { "e90810b", "point_to_blob" } },
 
-	// exact match
+	/* exact match */
 	{ "e", 0 },
 	{ "e90810b", 1, { "e90810b" } },
 
-	// either or
+	/* either or */
 	{ "e90810[ab]", 1, { "e90810b" } },
 
-	// glob in the middle
+	/* glob in the middle */
 	{ "foo/*/bar", 1, { "foo/foo/bar" } },
 
-	// The matching of '*' is based on plain string matching analog to the regular expression ".*"
-	// => a '/' in the tag name has no special meaning.
-	// Compare to `git tag -l "*bar"`
+	/*
+	 * The matching of '*' is based on plain string matching analog to the regular expression ".*"
+	 * => a '/' in the tag name has no special meaning.
+	 * Compare to `git tag -l "*bar"`
+	 */
 	{ "*bar", 2, { "foo/bar", "foo/foo/bar" } },
 
-	// End of list
+	/* End of list */
 	{ NULL }
 };
 
 void test_object_tag_list__list_by_pattern(void)
 {
-	// list all tag names from the repository matching a specified pattern
+	/* list all tag names from the repository matching a specified pattern */
 	size_t i = 0;
 	while (matches[i].pattern)
 		ensure_tag_pattern_match(g_repo, &matches[i++]);
diff --git a/tests/object/tag/read.c b/tests/object/tag/read.c
index 8f28afd..e28056e 100644
--- a/tests/object/tag/read.c
+++ b/tests/object/tag/read.c
@@ -13,7 +13,7 @@ static const char *taggerless = "4a23e2e65ad4e31c4c9db7dc746650bfad082679";
 
 static git_repository *g_repo;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_object_tag_read__initialize(void)
 {
 	g_repo = cl_git_sandbox_init("testrepo");
@@ -27,7 +27,7 @@ void test_object_tag_read__cleanup(void)
 
 void test_object_tag_read__parse(void)
 {
-	// read and parse a tag from the repository
+	/* read and parse a tag from the repository */
 	git_tag *tag1, *tag2;
 	git_commit *commit;
 	git_oid id1, id2, id_commit;
@@ -58,13 +58,13 @@ void test_object_tag_read__parse(void)
 
 void test_object_tag_read__parse_without_tagger(void)
 {
-	// read and parse a tag without a tagger field
+	/* read and parse a tag without a tagger field */
 	git_repository *bad_tag_repo;
 	git_tag *bad_tag;
 	git_commit *commit;
 	git_oid id, id_commit;
 
-	// TODO: This is a little messy
+	/* TODO: This is a little messy */
 	cl_git_pass(git_repository_open(&bad_tag_repo, cl_fixture("bad_tag.git")));
 
 	git_oid_fromstr(&id, bad_tag_id);
@@ -90,13 +90,13 @@ void test_object_tag_read__parse_without_tagger(void)
 
 void test_object_tag_read__parse_without_message(void)
 {
-	// read and parse a tag without a message field
+	/* read and parse a tag without a message field */
 	git_repository *short_tag_repo;
 	git_tag *short_tag;
 	git_commit *commit;
 	git_oid id, id_commit;
 
-	// TODO: This is a little messy
+	/* TODO: This is a little messy */
 	cl_git_pass(git_repository_open(&short_tag_repo, cl_fixture("short_tag.git")));
 
 	git_oid_fromstr(&id, short_tag_id);
diff --git a/tests/object/tag/write.c b/tests/object/tag/write.c
index 68e4b6c..4c50801 100644
--- a/tests/object/tag/write.c
+++ b/tests/object/tag/write.c
@@ -9,7 +9,7 @@ static const char *tagged_commit = "e90810b8df3e80c413d903f631643c716887138d";
 
 static git_repository *g_repo;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_object_tag_write__initialize(void)
 {
    g_repo = cl_git_sandbox_init("testrepo");
@@ -22,7 +22,7 @@ void test_object_tag_write__cleanup(void)
 
 void test_object_tag_write__basic(void)
 {
-   // write a tag to the repository and read it again
+	/* write a tag to the repository and read it again */
 	git_tag *tag;
 	git_oid target_id, tag_id;
 	git_signature *tagger;
@@ -67,7 +67,7 @@ void test_object_tag_write__basic(void)
 
 void test_object_tag_write__overwrite(void)
 {
-   // Attempt to write a tag bearing the same name than an already existing tag
+	/* Attempt to write a tag bearing the same name than an already existing tag */
 	git_oid target_id, tag_id;
 	git_signature *tagger;
 	git_object *target;
@@ -93,7 +93,7 @@ void test_object_tag_write__overwrite(void)
 
 void test_object_tag_write__replace(void)
 {
-   // Replace an already existing tag
+	/* Replace an already existing tag */
 	git_oid target_id, tag_id, old_tag_id;
 	git_signature *tagger;
 	git_reference *ref_tag;
@@ -130,7 +130,7 @@ void test_object_tag_write__replace(void)
 
 void test_object_tag_write__lightweight(void)
 {
-   // write a lightweight tag to the repository and read it again
+	/* write a lightweight tag to the repository and read it again */
 	git_oid target_id, object_id;
 	git_reference *ref_tag;
 	git_object *target;
@@ -159,7 +159,7 @@ void test_object_tag_write__lightweight(void)
 
 void test_object_tag_write__lightweight_over_existing(void)
 {
-   // Attempt to write a lightweight tag bearing the same name than an already existing tag
+	/* Attempt to write a lightweight tag bearing the same name than an already existing tag */
 	git_oid target_id, object_id, existing_object_id;
 	git_object *target;
 
@@ -181,7 +181,7 @@ void test_object_tag_write__lightweight_over_existing(void)
 
 void test_object_tag_write__delete(void)
 {
-   // Delete an already existing tag
+	/* Delete an already existing tag */
 	git_reference *ref_tag;
 
 	cl_git_pass(git_tag_delete(g_repo, "e90810b"));
diff --git a/tests/object/tree/read.c b/tests/object/tree/read.c
index 59a809b..1d3a913 100644
--- a/tests/object/tree/read.c
+++ b/tests/object/tree/read.c
@@ -6,7 +6,7 @@ static const char *tree_oid = "1810dff58d8a660512d4832e740f692884338ccd";
 
 static git_repository *g_repo;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_object_tree_read__initialize(void)
 {
    g_repo = cl_git_sandbox_init("testrepo");
@@ -21,7 +21,7 @@ void test_object_tree_read__cleanup(void)
 
 void test_object_tree_read__loaded(void)
 {
-   // acces randomly the entries on a loaded tree
+	/* acces randomly the entries on a loaded tree */
 	git_oid id;
 	git_tree *tree;
 
@@ -42,7 +42,7 @@ void test_object_tree_read__loaded(void)
 
 void test_object_tree_read__two(void)
 {
-   // read a tree from the repository
+	/* read a tree from the repository */
 	git_oid id;
 	git_tree *tree;
 	const git_tree_entry *entry;
diff --git a/tests/rebase/abort.c b/tests/rebase/abort.c
index d8891fb..a83c529 100644
--- a/tests/rebase/abort.c
+++ b/tests/rebase/abort.c
@@ -8,7 +8,7 @@
 
 static git_repository *repo;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_rebase_abort__initialize(void)
 {
 	repo = cl_git_sandbox_init("rebase");
diff --git a/tests/rebase/inmemory.c b/tests/rebase/inmemory.c
index 367d6b3..040a81b 100644
--- a/tests/rebase/inmemory.c
+++ b/tests/rebase/inmemory.c
@@ -7,7 +7,7 @@
 static git_repository *repo;
 static git_signature *signature;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_rebase_inmemory__initialize(void)
 {
 	repo = cl_git_sandbox_init("rebase");
diff --git a/tests/rebase/iterator.c b/tests/rebase/iterator.c
index db57b0a..49a6012 100644
--- a/tests/rebase/iterator.c
+++ b/tests/rebase/iterator.c
@@ -8,7 +8,7 @@ static git_repository *repo;
 static git_index *_index;
 static git_signature *signature;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_rebase_iterator__initialize(void)
 {
 	repo = cl_git_sandbox_init("rebase");
diff --git a/tests/rebase/merge.c b/tests/rebase/merge.c
index 7b2d687..8305937 100644
--- a/tests/rebase/merge.c
+++ b/tests/rebase/merge.c
@@ -19,7 +19,7 @@ static void set_core_autocrlf_to(git_repository *repo, bool value)
 	git_config_free(cfg);
 }
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_rebase_merge__initialize(void)
 {
 	repo = cl_git_sandbox_init("rebase");
diff --git a/tests/rebase/setup.c b/tests/rebase/setup.c
index b07a83a..f002945 100644
--- a/tests/rebase/setup.c
+++ b/tests/rebase/setup.c
@@ -8,7 +8,7 @@ static git_repository *repo;
 static git_index *_index;
 static git_signature *signature;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_rebase_setup__initialize(void)
 {
 	repo = cl_git_sandbox_init("rebase");
diff --git a/tests/rebase/submodule.c b/tests/rebase/submodule.c
index f71b94f..5aa9ceb 100644
--- a/tests/rebase/submodule.c
+++ b/tests/rebase/submodule.c
@@ -10,7 +10,7 @@
 static git_repository *repo;
 static git_signature *signature;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_rebase_submodule__initialize(void)
 {
 	git_index *index;
diff --git a/tests/refs/delete.c b/tests/refs/delete.c
index 8cad316..4cc78aa 100644
--- a/tests/refs/delete.c
+++ b/tests/refs/delete.c
@@ -27,7 +27,7 @@ void test_refs_delete__cleanup(void)
 
 void test_refs_delete__packed_loose(void)
 {
-   // deleting a ref which is both packed and loose should remove both tracks in the filesystem
+	/* deleting a ref which is both packed and loose should remove both tracks in the filesystem */
 	git_reference *looked_up_ref, *another_looked_up_ref;
 	git_buf temp_path = GIT_BUF_INIT;
 
@@ -57,7 +57,7 @@ void test_refs_delete__packed_loose(void)
 
 void test_refs_delete__packed_only(void)
 {
-   // can delete a just packed reference
+	/* can delete a just packed reference */
 	git_reference *ref;
 	git_refdb *refdb;
 	git_oid id;
diff --git a/tests/refs/list.c b/tests/refs/list.c
index 97461fd..3e8c82c 100644
--- a/tests/refs/list.c
+++ b/tests/refs/list.c
@@ -22,7 +22,7 @@ void test_refs_list__cleanup(void)
 
 void test_refs_list__all(void)
 {
-   // try to list all the references in our test repo
+	/* try to list all the references in our test repo */
 	git_strarray ref_list;
 
 	cl_git_pass(git_reference_list(&ref_list, g_repo));
diff --git a/tests/refs/normalize.c b/tests/refs/normalize.c
index f9c525e..c692eda 100644
--- a/tests/refs/normalize.c
+++ b/tests/refs/normalize.c
@@ -4,7 +4,7 @@
 #include "git2/reflog.h"
 #include "reflog.h"
 
-// Helpers
+/* Helpers */
 static void ensure_refname_normalized(
 	unsigned int flags,
 	const char *input_refname,
@@ -149,7 +149,7 @@ void test_refs_normalize__symbolic(void)
  
 void test_refs_normalize__jgit_suite(void)
 {
-	// tests borrowed from JGit
+	/* tests borrowed from JGit */
 
 /* EmptyString */
 	ensure_refname_invalid(
@@ -316,9 +316,10 @@ void test_refs_normalize__jgit_suite(void)
 	ensure_refname_normalized(
 		GIT_REF_FORMAT_ALLOW_ONELEVEL, "refs/heads/}", "refs/heads/}");
 
-	// This is valid on UNIX, but not on Windows
-	// hence we make in invalid due to non-portability
-	//
+	/*
+	 * This is valid on UNIX, but not on Windows
+	 * hence we make in invalid due to non-portability
+	 */
 	ensure_refname_invalid(
 		GIT_REF_FORMAT_ALLOW_ONELEVEL, "refs/heads/\\");
 
diff --git a/tests/refs/overwrite.c b/tests/refs/overwrite.c
index 5aea2a7..2e499b7 100644
--- a/tests/refs/overwrite.c
+++ b/tests/refs/overwrite.c
@@ -23,7 +23,7 @@ void test_refs_overwrite__cleanup(void)
 
 void test_refs_overwrite__symbolic(void)
 {
-   // Overwrite an existing symbolic reference
+	/* Overwrite an existing symbolic reference */
 	git_reference *ref, *branch_ref;
 
 	/* The target needds to exist and we need to check the name has changed */
@@ -53,7 +53,7 @@ void test_refs_overwrite__symbolic(void)
 
 void test_refs_overwrite__object_id(void)
 {
-   // Overwrite an existing object id reference
+	/* Overwrite an existing object id reference */
 	git_reference *ref;
 	git_oid id;
 
@@ -85,7 +85,7 @@ void test_refs_overwrite__object_id(void)
 
 void test_refs_overwrite__object_id_with_symbolic(void)
 {
-   // Overwrite an existing object id reference with a symbolic one
+	/* Overwrite an existing object id reference with a symbolic one */
 	git_reference *ref;
 	git_oid id;
 
@@ -110,7 +110,7 @@ void test_refs_overwrite__object_id_with_symbolic(void)
 
 void test_refs_overwrite__symbolic_with_object_id(void)
 {
-   // Overwrite an existing symbolic reference with an object id one
+	/* Overwrite an existing symbolic reference with an object id one */
 	git_reference *ref;
 	git_oid id;
 
diff --git a/tests/refs/read.c b/tests/refs/read.c
index c00b016..3c7a0a1 100644
--- a/tests/refs/read.c
+++ b/tests/refs/read.c
@@ -28,7 +28,7 @@ void test_refs_read__cleanup(void)
 
 void test_refs_read__loose_tag(void)
 {
-   // lookup a loose tag reference
+	/* lookup a loose tag reference */
 	git_reference *reference;
 	git_object *object;
 	git_buf ref_name_from_tag_name = GIT_BUF_INIT;
@@ -54,7 +54,7 @@ void test_refs_read__loose_tag(void)
 
 void test_refs_read__nonexisting_tag(void)
 {
-   // lookup a loose tag reference that doesn't exist
+	/* lookup a loose tag reference that doesn't exist */
 	git_reference *reference;
 
 	cl_git_fail(git_reference_lookup(&reference, g_repo, non_existing_tag_ref_name));
@@ -65,7 +65,7 @@ void test_refs_read__nonexisting_tag(void)
 
 void test_refs_read__symbolic(void)
 {
-   // lookup a symbolic reference
+	/* lookup a symbolic reference */
 	git_reference *reference, *resolved_ref;
 	git_object *object;
 	git_oid id;
@@ -93,7 +93,7 @@ void test_refs_read__symbolic(void)
 
 void test_refs_read__nested_symbolic(void)
 {
-   // lookup a nested symbolic reference
+	/* lookup a nested symbolic reference */
 	git_reference *reference, *resolved_ref;
 	git_object *object;
 	git_oid id;
@@ -121,7 +121,7 @@ void test_refs_read__nested_symbolic(void)
 
 void test_refs_read__head_then_master(void)
 {
-   // lookup the HEAD and resolve the master branch
+	/* lookup the HEAD and resolve the master branch */
 	git_reference *reference, *resolved_ref, *comp_base_ref;
 
 	cl_git_pass(git_reference_lookup(&reference, g_repo, head_tracker_sym_ref_name));
@@ -145,7 +145,7 @@ void test_refs_read__head_then_master(void)
 
 void test_refs_read__master_then_head(void)
 {
-   // lookup the master branch and then the HEAD
+	/* lookup the master branch and then the HEAD */
 	git_reference *reference, *master_ref, *resolved_ref;
 
 	cl_git_pass(git_reference_lookup(&master_ref, g_repo, current_head_target));
@@ -162,7 +162,7 @@ void test_refs_read__master_then_head(void)
 
 void test_refs_read__packed(void)
 {
-   // lookup a packed reference
+	/* lookup a packed reference */
 	git_reference *reference;
 	git_object *object;
 
@@ -182,7 +182,7 @@ void test_refs_read__packed(void)
 
 void test_refs_read__loose_first(void)
 {
-   // assure that a loose reference is looked up before a packed reference
+	/* assure that a loose reference is looked up before a packed reference */
 	git_reference *reference;
 
 	cl_git_pass(git_reference_lookup(&reference, g_repo, packed_head_name));
diff --git a/tests/refs/reflog/reflog.c b/tests/refs/reflog/reflog.c
index a448463..ec251da 100644
--- a/tests/refs/reflog/reflog.c
+++ b/tests/refs/reflog/reflog.c
@@ -11,7 +11,7 @@ static const char *current_master_tip = "a65fedf39aefe402d3bb6e24df4d4f5fe454775
 static git_repository *g_repo;
 
 
-// helpers
+/* helpers */
 static void assert_signature(const git_signature *expected, const git_signature *actual)
 {
 	cl_assert(actual);
@@ -22,15 +22,15 @@ static void assert_signature(const git_signature *expected, const git_signature 
 }
 
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_refs_reflog_reflog__initialize(void)
 {
-   g_repo = cl_git_sandbox_init("testrepo.git");
+	g_repo = cl_git_sandbox_init("testrepo.git");
 }
 
 void test_refs_reflog_reflog__cleanup(void)
 {
-   cl_git_sandbox_cleanup();
+	cl_git_sandbox_cleanup();
 }
 
 static void assert_appends(const git_signature *committer, const git_oid *oid)
diff --git a/tests/refs/rename.c b/tests/refs/rename.c
index e3e5148..6ec8f65 100644
--- a/tests/refs/rename.c
+++ b/tests/refs/rename.c
@@ -34,7 +34,7 @@ void test_refs_rename__cleanup(void)
 
 void test_refs_rename__loose(void)
 {
-	// rename a loose reference
+	/* rename a loose reference */
 	git_reference *looked_up_ref, *new_ref, *another_looked_up_ref;
 	git_buf temp_path = GIT_BUF_INIT;
 	const char *new_name = "refs/tags/Nemo/knows/refs.kung-fu";
@@ -76,7 +76,7 @@ void test_refs_rename__loose(void)
 
 void test_refs_rename__packed(void)
 {
-	// rename a packed reference (should make it loose)
+	/* rename a packed reference (should make it loose) */
 	git_reference *looked_up_ref, *new_ref, *another_looked_up_ref;
 	git_buf temp_path = GIT_BUF_INIT;
 	const char *brand_new_name = "refs/heads/brand_new_name";
@@ -118,7 +118,7 @@ void test_refs_rename__packed(void)
 
 void test_refs_rename__packed_doesnt_pack_others(void)
 {
-	// renaming a packed reference does not pack another reference which happens to be in both loose and pack state
+	/* renaming a packed reference does not pack another reference which happens to be in both loose and pack state */
 	git_reference *looked_up_ref, *another_looked_up_ref, *renamed_ref;
 	git_buf temp_path = GIT_BUF_INIT;
 	const char *brand_new_name = "refs/heads/brand_new_name";
@@ -160,7 +160,7 @@ void test_refs_rename__packed_doesnt_pack_others(void)
 
 void test_refs_rename__name_collision(void)
 {
-	// can not rename a reference with the name of an existing reference
+	/* can not rename a reference with the name of an existing reference */
 	git_reference *looked_up_ref, *renamed_ref;
 
 	/* An existing reference... */
@@ -179,7 +179,7 @@ void test_refs_rename__name_collision(void)
 
 void test_refs_rename__invalid_name(void)
 {
-	// can not rename a reference with an invalid name
+	/* can not rename a reference with an invalid name */
 	git_reference *looked_up_ref, *renamed_ref;
 
 	/* An existing oid reference... */
@@ -205,7 +205,7 @@ void test_refs_rename__invalid_name(void)
 
 void test_refs_rename__force_loose_packed(void)
 {
-	// can force-rename a packed reference with the name of an existing loose and packed reference
+	/* can force-rename a packed reference with the name of an existing loose and packed reference */
 	git_reference *looked_up_ref, *renamed_ref;
 	git_oid oid;
 
@@ -230,7 +230,7 @@ void test_refs_rename__force_loose_packed(void)
 
 void test_refs_rename__force_loose(void)
 {
-	// can force-rename a loose reference with the name of an existing loose reference
+	/* can force-rename a loose reference with the name of an existing loose reference */
 	git_reference *looked_up_ref, *renamed_ref;
 	git_oid oid;
 
@@ -258,7 +258,7 @@ void test_refs_rename__force_loose(void)
 
 void test_refs_rename__overwrite(void)
 {
-	// can not overwrite name of existing reference
+	/* can not overwrite name of existing reference */
 	git_reference *ref, *ref_one, *ref_one_new, *ref_two;
 	git_refdb *refdb;
 	git_oid id;
@@ -292,7 +292,7 @@ void test_refs_rename__overwrite(void)
 
 void test_refs_rename__prefix(void)
 {
-	// can be renamed to a new name prefixed with the old name
+	/* can be renamed to a new name prefixed with the old name */
 	git_reference *ref, *ref_two, *looked_up_ref, *renamed_ref;
 	git_oid id;
 
@@ -325,7 +325,7 @@ void test_refs_rename__prefix(void)
 
 void test_refs_rename__move_up(void)
 {
-	// can move a reference to a upper reference hierarchy
+	/* can move a reference to a upper reference hierarchy */
 	git_reference *ref, *ref_two, *looked_up_ref, *renamed_ref;
 	git_oid id;
 
diff --git a/tests/refs/setter.c b/tests/refs/setter.c
index 2b42ff2..03c2146 100644
--- a/tests/refs/setter.c
+++ b/tests/refs/setter.c
@@ -65,7 +65,7 @@ void test_refs_setter__update_symbolic(void)
 
 void test_refs_setter__cant_update_direct_with_symbolic(void)
 {
-	// Overwrite an existing object id reference with a symbolic one
+	/* Overwrite an existing object id reference with a symbolic one */
 	git_reference *ref, *new;
 	git_oid id;
 
@@ -80,7 +80,7 @@ void test_refs_setter__cant_update_direct_with_symbolic(void)
 
 void test_refs_setter__cant_update_symbolic_with_direct(void)
 {
-	// Overwrite an existing symbolic reference with an object id one
+	/* Overwrite an existing symbolic reference with an object id one */
 	git_reference *ref, *new;
 	git_oid id;
 
diff --git a/tests/repo/discover.c b/tests/repo/discover.c
index b13c97b..cc61c71 100644
--- a/tests/repo/discover.c
+++ b/tests/repo/discover.c
@@ -58,7 +58,7 @@ static void write_file(const char *path, const char *content)
 	cl_git_pass(error);
 }
 
-//no check is performed on ceiling_dirs length, so be sure it's long enough
+/*no check is performed on ceiling_dirs length, so be sure it's long enough */
 static void append_ceiling_dir(git_buf *ceiling_dirs, const char *path)
 {
 	git_buf pretty_path = GIT_BUF_INIT;
diff --git a/tests/revert/bare.c b/tests/revert/bare.c
index 206c86d..fda2b82 100644
--- a/tests/revert/bare.c
+++ b/tests/revert/bare.c
@@ -11,7 +11,7 @@
 
 static git_repository *repo;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_revert_bare__initialize(void)
 {
 	repo = cl_git_sandbox_init(TEST_REPO_PATH);
diff --git a/tests/revert/workdir.c b/tests/revert/workdir.c
index 8604735..53bb0e4 100644
--- a/tests/revert/workdir.c
+++ b/tests/revert/workdir.c
@@ -12,7 +12,7 @@
 static git_repository *repo;
 static git_index *repo_index;
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_revert_workdir__initialize(void)
 {
 	git_config *cfg;
diff --git a/tests/stash/apply.c b/tests/stash/apply.c
index 986eba0..16cb140 100644
--- a/tests/stash/apply.c
+++ b/tests/stash/apply.c
@@ -422,7 +422,7 @@ void test_stash_apply__uses_reflog_like_indices_1(void)
 	cl_git_pass(git_stash_save(&oid, repo, signature, NULL, GIT_STASH_INCLUDE_UNTRACKED));
 	assert_status(repo, "untracked", GIT_ENOTFOUND);
 
-	// stash@{1} is the oldest (first) stash we made
+	/* stash@{1} is the oldest (first) stash we made */
 	cl_git_pass(git_stash_apply(repo, 1, NULL));
 	cl_assert_equal_i(git_index_has_conflicts(repo_index), 0);
 	assert_status(repo, "what", GIT_STATUS_WT_MODIFIED);
@@ -441,7 +441,7 @@ void test_stash_apply__uses_reflog_like_indices_2(void)
 	cl_git_pass(git_stash_save(&oid, repo, signature, NULL, GIT_STASH_INCLUDE_UNTRACKED));
 	assert_status(repo, "untracked", GIT_ENOTFOUND);
 
-	// stash@{0} is the newest stash we made immediately above
+	/* stash@{0} is the newest stash we made immediately above */
 	cl_git_pass(git_stash_apply(repo, 0, NULL));
 
 	cl_assert_equal_i(git_index_has_conflicts(repo_index), 0);
diff --git a/tests/status/status_data.h b/tests/status/status_data.h
index 8ad4235..09b9827 100644
--- a/tests/status/status_data.h
+++ b/tests/status/status_data.h
@@ -1,6 +1,6 @@
 #include "status_helpers.h"
 
-// A utf-8 string with 83 characters, but 249 bytes.
+/* A utf-8 string with 83 characters, but 249 bytes. */
 static const char *longname = "\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97\xe5\x8f\x97";
 
 
diff --git a/tests/status/worktree.c b/tests/status/worktree.c
index bb9f8ec..7abc703 100644
--- a/tests/status/worktree.c
+++ b/tests/status/worktree.c
@@ -260,7 +260,7 @@ void test_status_worktree__within_subdir(void)
 	pathsArray.strings = paths;
 	opts.pathspec = pathsArray;
 
-	// We committed zzz_new_dir/new_file above. It shouldn't be reported.
+	/* We committed zzz_new_dir/new_file above. It shouldn't be reported. */
 	cl_git_pass(
 		git_status_foreach_ext(repo, &opts, cb_status__normal, &counts)
 	);
@@ -957,7 +957,7 @@ void test_status_worktree__long_filenames(void)
 	git_status_options opts = GIT_STATUS_OPTIONS_INIT;
 	status_entry_counts counts = {0};
 
-	// Create directory with amazingly long filename
+	/* Create directory with amazingly long filename */
 	sprintf(path, "empty_standard_repo/%s", longname);
 	cl_git_pass(git_futils_mkdir_r(path, 0777));
 	sprintf(path, "empty_standard_repo/%s/foo", longname);
diff --git a/tests/threads/basic.c b/tests/threads/basic.c
index af60490..9ce740c 100644
--- a/tests/threads/basic.c
+++ b/tests/threads/basic.c
@@ -19,7 +19,7 @@ void test_threads_basic__cleanup(void)
 
 void test_threads_basic__cache(void)
 {
-	// run several threads polling the cache at the same time
+	/* run several threads polling the cache at the same time */
 	cl_assert(1 == 1);
 }
 
diff --git a/tests/worktree/config.c b/tests/worktree/config.c
index 3ab317b..81dcfe1 100644
--- a/tests/worktree/config.c
+++ b/tests/worktree/config.c
@@ -36,8 +36,10 @@ void test_worktree_config__set(void)
 	cl_git_pass(git_config_set_int32(cfg, "core.dummy", 5));
 	git_config_free(cfg);
 
-	// reopen to verify configuration has been set in the
-	// common dir
+	/*
+	 * reopen to verify configuration has been set in the
+	 * common dir
+	 */
 	cl_git_pass(git_repository_config(&cfg, fixture.repo));
 	cl_git_pass(git_config_get_int32(&val, cfg, "core.dummy"));
 	cl_assert_equal_i(val, 5);