Fix warnings reported by Turbo C

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@684 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2003-09-15 10:36:04 +00:00
parent b0e54ff704
commit c418300de4
2 changed files with 11 additions and 11 deletions

View File

@ -166,7 +166,7 @@ int main(int argc, char **argv)
/* first read file into memory chunks */
fseek(src, header.exHeaderSize * 16UL, SEEK_SET);
buffers = malloc((size + BUFSIZE - 1) / BUFSIZE * sizeof(char *));
buffers = malloc((size_t)((size + BUFSIZE - 1) / BUFSIZE) * sizeof(char *));
if (buffers == NULL)
{
printf("Allocation error\n");
@ -177,7 +177,7 @@ int main(int argc, char **argv)
to_xfer -= bufsize, curbuf++)
{
if (to_xfer < BUFSIZE)
bufsize = to_xfer;
bufsize = (size_t)to_xfer;
*curbuf = malloc(bufsize);
if (*curbuf == NULL)
{
@ -208,10 +208,10 @@ int main(int argc, char **argv)
for (i = 0; i < header.exRelocItems; i++)
{
ULONG spot = ((ULONG) reloc[i].seg << 4) + reloc[i].off;
UBYTE *spot0 = &buffers[spot / BUFSIZE][spot % BUFSIZE];
UBYTE *spot1 = &buffers[(spot + 1) / BUFSIZE][(spot + 1) % BUFSIZE];
UBYTE *spot0 = &buffers[(size_t)(spot / BUFSIZE)][(size_t)(spot % BUFSIZE)];
UBYTE *spot1 = &buffers[(size_t)((spot + 1) / BUFSIZE)][(size_t)((spot + 1) % BUFSIZE)];
UWORD segment = ((UWORD) * spot1 << 8) + *spot0;
for (j = 0; j < silentcount; j++)
if (segment == silentSegments[j])
{
@ -270,7 +270,7 @@ int main(int argc, char **argv)
to_xfer -= bufsize, curbuf++)
{
if (to_xfer < BUFSIZE)
bufsize = to_xfer;
bufsize = (size_t)to_xfer;
if (fwrite(*curbuf, sizeof(char), bufsize, dest) != bufsize)
{

View File

@ -123,7 +123,7 @@ int main(int argc, char *argv[])
struct record {
unsigned char rectyp;
unsigned short datalen;
unsigned char buffer[0x2000];
char buffer[0x2000];
} Record, Outrecord;
#include "algndflt.h"
@ -132,7 +132,7 @@ struct verify_pack1 { char x[ sizeof(struct record) == 0x2003 ? 1 : -1];};
void go_records(FILE * fdin, FILE * fdo)
{
unsigned char stringlen;
unsigned char *string, *s;
char *string, *s;
int i, j;
unsigned char chksum;
@ -165,7 +165,7 @@ void go_records(FILE * fdin, FILE * fdo)
for (i = 0; i < Record.datalen - 1;)
{
stringlen = Record.buffer[i];
stringlen = (unsigned char)Record.buffer[i];
i++;
string = &Record.buffer[i];
@ -188,9 +188,9 @@ void go_records(FILE * fdin, FILE * fdo)
}
chksum = 0;
for (s = (unsigned char *)&Outrecord;
for (s = (char *)&Outrecord;
s < &Outrecord.buffer[Outrecord.datalen]; s++)
chksum += *s;
chksum += (unsigned char)*s;
Outrecord.buffer[Outrecord.datalen] = ~chksum;
Outrecord.datalen++;