Commit 7fa7e14
reftable: stop using
We're about to introduce our own `reftable_buf` type to replace
`strbuf`. One function we'll have to convert is `strbuf_addf()`, which
is used in a handful of places. This function uses `snprintf()`
internally, which makes porting it a bit more involved:
- It is not available on all platforms.
- Some platforms like Windows have broken implementations.
So by using `snprintf()` we'd also push the burden on downstream users
of the reftable library to make available a properly working version of
it.
Most callsites of `strbuf_addf()` are trivial to convert to not using
it. We do end up using `snprintf()` in our unit tests, but that isn't
much of a problem for downstream users of the reftable library.
While at it, remove a useless call to `strbuf_reset()` in
`t_reftable_stack_auto_compaction_with_locked_tables()`. We don't write
to the buffer before this and initialize it with `STRBUF_INIT`, so there
is no need to reset anything.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>strbuf_addf()
1 parent 409f049 commit 7fa7e14
File tree
4 files changed
+50
-37
lines changed- reftable
- t/unit-tests
4 files changed
+50
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
1396 | 1402 | | |
1397 | 1403 | | |
1398 | 1404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
312 | 314 | | |
| 315 | + | |
313 | 316 | | |
314 | | - | |
| 317 | + | |
315 | 318 | | |
316 | 319 | | |
317 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
| 762 | + | |
762 | 763 | | |
763 | 764 | | |
764 | 765 | | |
| |||
770 | 771 | | |
771 | 772 | | |
772 | 773 | | |
773 | | - | |
774 | | - | |
775 | | - | |
| 774 | + | |
| 775 | + | |
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
| |||
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
791 | | - | |
792 | | - | |
793 | | - | |
| 791 | + | |
| 792 | + | |
794 | 793 | | |
795 | 794 | | |
796 | 795 | | |
| |||
824 | 823 | | |
825 | 824 | | |
826 | 825 | | |
827 | | - | |
828 | 826 | | |
829 | 827 | | |
830 | 828 | | |
| |||
848 | 846 | | |
849 | 847 | | |
850 | 848 | | |
| 849 | + | |
851 | 850 | | |
852 | | - | |
853 | | - | |
854 | | - | |
| 851 | + | |
| 852 | + | |
855 | 853 | | |
856 | 854 | | |
857 | 855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
| |||
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| 119 | + | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 121 | + | |
| 122 | + | |
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
| |||
434 | 432 | | |
435 | 433 | | |
436 | 434 | | |
437 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
1077 | 1078 | | |
1078 | 1079 | | |
1079 | 1080 | | |
1080 | | - | |
1081 | | - | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
1082 | 1085 | | |
1083 | 1086 | | |
1084 | 1087 | | |
| |||
1101 | 1104 | | |
1102 | 1105 | | |
1103 | 1106 | | |
1104 | | - | |
1105 | 1107 | | |
1106 | 1108 | | |
1107 | 1109 | | |
| |||
1115 | 1117 | | |
1116 | 1118 | | |
1117 | 1119 | | |
| 1120 | + | |
1118 | 1121 | | |
1119 | 1122 | | |
1120 | 1123 | | |
| |||
1123 | 1126 | | |
1124 | 1127 | | |
1125 | 1128 | | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
| 1129 | + | |
| 1130 | + | |
1129 | 1131 | | |
1130 | 1132 | | |
1131 | 1133 | | |
| |||
1142 | 1144 | | |
1143 | 1145 | | |
1144 | 1146 | | |
1145 | | - | |
1146 | 1147 | | |
1147 | 1148 | | |
1148 | 1149 | | |
| |||
1163 | 1164 | | |
1164 | 1165 | | |
1165 | 1166 | | |
1166 | | - | |
1167 | | - | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
1168 | 1171 | | |
1169 | 1172 | | |
1170 | 1173 | | |
| |||
1321 | 1324 | | |
1322 | 1325 | | |
1323 | 1326 | | |
1324 | | - | |
1325 | | - | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1326 | 1331 | | |
1327 | | - | |
| 1332 | + | |
| 1333 | + | |
1328 | 1334 | | |
1329 | 1335 | | |
1330 | 1336 | | |
| |||
0 commit comments