changed a few more vars int -> uint32_t/size_t

This is probably the last change of such kind.  There are many other
instances left, and fixing them all is hopeless.  On the other hand,
the way mod 2^32 arithmetic works, although technically not always
well defined, is to our advantage.  I suggest that only user-visible
discrepancies further be fixed.

The following comparison to st_size looks particularly bad.
The code turns out to be unused!

lib/signature.c:
> verifySizeSignature(const char * datafile, int_32 size, /*@out@*/ char * result)
> [...]
>     if (size != st.st_size) {
>         sprintf(result, "Header+Archive size mismatch.\n"
This commit is contained in:
Alexey Tourbin 2018-01-31 12:28:40 +03:00
parent 4970509cb9
commit 4d777d01d2
2 changed files with 3 additions and 3 deletions

View File

@ -2021,7 +2021,7 @@ static int finalizeSize(TFI_t fi)
{
if (fi == NULL)
return 0;
int totalFileSize = 0;
uint32_t totalFileSize = 0;
int partialHardlinkSets = 0;
for (int i = 0; i < fi->fc; i++) {
if (fi->actions[i] == FA_SKIP) // %ghost

View File

@ -691,7 +691,7 @@ static int expandRegular(/*@special@*/ FSM_t fsm)
{
const char * fmd5sum;
const struct stat * st = &fsm->sb;
int left = st->st_size;
size_t left = st->st_size;
int rc = 0;
rc = fsmStage(fsm, FSM_WOPEN);
@ -758,7 +758,7 @@ static int writeFile(/*@special@*/ FSM_t fsm, int writeData)
struct stat * ost = &fsm->osb;
size_t pos = fdGetCpioPos(fsm->cfd);
char * symbuf = NULL;
int left;
size_t left;
int xx;
int rc;