mirror of
https://github.com/git/git.git
synced 2026-01-10 01:56:42 +00:00
global: trivial conversions to fix -Wsign-compare warnings
We have a bunch of loops which iterate up to an unsigned boundary using a signed index, which generates warnigs because we compare a signed and unsigned value in the loop condition. Address these sites for trivial cases and enable `-Wsign-compare` warnings for these code units. This patch only adapts those code units where we can drop the `DISABLE_SIGN_COMPARE_WARNINGS` macro in the same step. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
25435e4ad8
commit
80c9e70ebe
@@ -17,8 +17,6 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define DISABLE_SIGN_COMPARE_WARNINGS
|
||||
|
||||
#include "git-compat-util.h"
|
||||
#include "ewok.h"
|
||||
#include "ewok_rlw.h"
|
||||
@@ -258,10 +256,8 @@ void ewah_each_bit(struct ewah_bitmap *self, void (*callback)(size_t, void*), vo
|
||||
++pointer;
|
||||
|
||||
for (k = 0; k < rlw_get_literal_words(word); ++k) {
|
||||
int c;
|
||||
|
||||
/* todo: zero count optimization */
|
||||
for (c = 0; c < BITS_IN_EWORD; ++c, ++pos) {
|
||||
for (size_t c = 0; c < BITS_IN_EWORD; ++c, ++pos) {
|
||||
if ((self->buffer[pointer] & ((eword_t)1 << c)) != 0)
|
||||
callback(pos, payload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user