Avoid some warnings in rdoff/rdf2bin.c

I received some warnings when running make on the head revision of
nasm from git:

----
rdf2bin.c: In function 'main':
rdf2bin.c:122: warning: comparison between signed and unsigned
rdf2bin.c:123: warning: comparison between signed and unsigned
rdf2bin.c:124: warning: comparison between signed and unsigned
----

I think these warnings are innocuous and should be safely avoidable
with simple casts (please see attached patch).

* rdoff/rdf2bin.c
(main): cast to size_t for comparison with fwrite return value

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
This commit is contained in:
Bo Borgerson 2008-04-12 11:47:57 -04:00 committed by H. Peter Anvin
parent 72ec0e4144
commit 7d4d2c3cc9

View file

@ -119,9 +119,9 @@ int main(int argc, char **argv)
return 1;
}
if (fwrite(m->t, 1, m->f.seg[0].length, of) != m->f.seg[0].length ||
fwrite(padding, 1, codepad, of) != codepad ||
fwrite(m->d, 1, m->f.seg[1].length, of) != m->f.seg[1].length) {
if (fwrite(m->t, 1, m->f.seg[0].length, of) != (size_t)m->f.seg[0].length ||
fwrite(padding, 1, codepad, of) != (size_t)codepad ||
fwrite(m->d, 1, m->f.seg[1].length, of) != (size_t)m->f.seg[1].length) {
fprintf(stderr, "rdf2bin: error writing to %s\n", *argv);
return 1;
}