Commit 87318f2
gpg-interface: address -Wsign-comparison warnings
There are a couple of -Wsign-comparison warnings in "gpg-interface.c".
Most of them are trivial and simply using signed integers to loop
towards an upper unsigned bound.
But in `parse_signed_buffer()` we have one case where the different
signedness of the two values of a ternary expression results in a
warning. Given that:
- `size` will always be bigger than `len` due to the loop condition.
- `eol` will always be after `buf + len` because it is found via
memchr(3p) starting from `buf + len`.
We know that both values will always be natural integers.
Squelch the warning by casting the left-hand side to `size_t`.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 7d200af commit 87318f2
1 file changed
+6
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 130 | + | |
134 | 131 | | |
135 | 132 | | |
136 | 133 | | |
137 | 134 | | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
141 | | - | |
| 138 | + | |
142 | 139 | | |
143 | | - | |
| 140 | + | |
144 | 141 | | |
145 | 142 | | |
146 | 143 | | |
| |||
228 | 225 | | |
229 | 226 | | |
230 | 227 | | |
231 | | - | |
| 228 | + | |
232 | 229 | | |
233 | 230 | | |
234 | 231 | | |
| |||
243 | 240 | | |
244 | 241 | | |
245 | 242 | | |
246 | | - | |
| 243 | + | |
247 | 244 | | |
248 | 245 | | |
249 | 246 | | |
| |||
700 | 697 | | |
701 | 698 | | |
702 | 699 | | |
703 | | - | |
| 700 | + | |
704 | 701 | | |
705 | 702 | | |
706 | 703 | | |
| |||
0 commit comments