Commit 50d92b5
grep: typesafe versions of grep_source_init
grep_source_init() can create "struct grep_source" objects and,
depending on the value of the type passed, some void-pointer parameters have
different meanings. Because one of these types (GREP_SOURCE_OID) will
require an additional parameter in a subsequent patch, take the
opportunity to increase clarity and type safety by replacing this
function with individual functions for each type.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 8d33c3a commit 50d92b5
3 files changed
+34
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
1828 | 1840 | | |
1829 | 1841 | | |
1830 | 1842 | | |
1831 | 1843 | | |
1832 | 1844 | | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
| 1845 | + | |
1836 | 1846 | | |
1837 | 1847 | | |
1838 | 1848 | | |
1839 | 1849 | | |
1840 | 1850 | | |
1841 | 1851 | | |
1842 | 1852 | | |
1843 | | - | |
1844 | | - | |
1845 | | - | |
| 1853 | + | |
| 1854 | + | |
1846 | 1855 | | |
1847 | | - | |
| 1856 | + | |
1848 | 1857 | | |
1849 | 1858 | | |
1850 | 1859 | | |
1851 | 1860 | | |
1852 | 1861 | | |
| 1862 | + | |
| 1863 | + | |
1853 | 1864 | | |
1854 | | - | |
1855 | | - | |
1856 | | - | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
1864 | | - | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
1865 | 1875 | | |
1866 | 1876 | | |
1867 | 1877 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
0 commit comments