mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-21 03:29:49 +00:00
Remove unused variables (detected with gcc-4.6)
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
7b2824186b
commit
14f8dd5556
@ -20,7 +20,7 @@ int emile_first_set_param_scsi_extents( int fd, int drive_num, int second_offset
|
||||
int ret;
|
||||
char first[1024];
|
||||
int current;
|
||||
unsigned short max_blocks;
|
||||
/* unsigned short max_blocks; */
|
||||
int location;
|
||||
|
||||
location = lseek(fd, 0, SEEK_CUR);
|
||||
@ -31,7 +31,7 @@ int emile_first_set_param_scsi_extents( int fd, int drive_num, int second_offset
|
||||
if (ret == -1)
|
||||
return EEMILE_CANNOT_READ_FIRST;
|
||||
|
||||
max_blocks = read_short((u_int16_t*)&first[1022]) / 6;
|
||||
/* max_blocks = read_short((u_int16_t*)&first[1022]) / 6; */
|
||||
|
||||
write_short((u_int16_t*)&first[1014], blocksize);
|
||||
write_short((u_int16_t*)&first[1016], drive_num);
|
||||
|
@ -20,7 +20,6 @@ int emile_second_set_configuration(int fd, int8_t *configuration)
|
||||
int ret;
|
||||
int size;
|
||||
int len;
|
||||
off_t offset;
|
||||
char *buf;
|
||||
|
||||
if (configuration == NULL)
|
||||
@ -33,7 +32,7 @@ int emile_second_set_configuration(int fd, int8_t *configuration)
|
||||
ret = read(fd, &header, sizeof(header));
|
||||
if (!EMILE_COMPAT(EMILE_06_SIGNATURE, read_long(&header.signature)))
|
||||
{
|
||||
offset = lseek(fd, FIRST_LEVEL_SIZE, SEEK_SET);
|
||||
lseek(fd, FIRST_LEVEL_SIZE, SEEK_SET);
|
||||
ret = read(fd, &header, sizeof(header));
|
||||
if (!EMILE_COMPAT(EMILE_06_SIGNATURE, read_long(&header.signature)))
|
||||
return EEMILE_INVALID_SECOND;
|
||||
|
@ -80,7 +80,7 @@ void print_info(struct iso_primary_descriptor *ipd)
|
||||
void iso9660_name(stream_VOLUME *volume, struct iso_directory_record *idr, char *buffer)
|
||||
{
|
||||
int j;
|
||||
unsigned char uh, ul, uc;
|
||||
unsigned char /* uh, */ ul, uc;
|
||||
|
||||
buffer[0] = 0;
|
||||
if (idr->name_len[0] == 1 && idr->name[0] == 0)
|
||||
@ -97,7 +97,7 @@ void iso9660_name(stream_VOLUME *volume, struct iso_directory_record *idr, char
|
||||
*/
|
||||
|
||||
for (j = 0; j < (int)idr->name_len[0] / 2; j++) {
|
||||
uh = idr->name[j*2];
|
||||
/* uh = idr->name[j*2]; */
|
||||
ul = idr->name[j*2+1];
|
||||
|
||||
/*
|
||||
@ -140,14 +140,14 @@ stream_VOLUME *iso9660_mount(device_io_t *device)
|
||||
iso9660_VOLUME* volume;
|
||||
struct iso_primary_descriptor *jpd;
|
||||
struct iso_primary_descriptor ipd;
|
||||
struct iso_directory_record * idr;
|
||||
/* struct iso_directory_record * idr; */
|
||||
int block;
|
||||
int ucs_level;
|
||||
|
||||
/* read filesystem descriptor */
|
||||
|
||||
device->read_sector(device->data, 16, &ipd, sizeof (ipd));
|
||||
idr = (struct iso_directory_record *)ipd.root_directory_record;
|
||||
/* idr = (struct iso_directory_record *)ipd.root_directory_record; */
|
||||
|
||||
/*
|
||||
* High sierra:
|
||||
|
@ -102,7 +102,6 @@ static int create_apple_driver(char *temp, char *appledriver, char *first_level)
|
||||
int fd_driver;
|
||||
char *buffer;
|
||||
unsigned char *driver;
|
||||
int ret;
|
||||
struct stat st;
|
||||
int driver_size;
|
||||
|
||||
@ -124,7 +123,7 @@ static int create_apple_driver(char *temp, char *appledriver, char *first_level)
|
||||
fprintf(stderr, "Cannot malloc %d bytes\n", driver_size);
|
||||
return -1;
|
||||
}
|
||||
ret = read(fd_driver, driver, st.st_size);
|
||||
read(fd_driver, driver, st.st_size);
|
||||
|
||||
close(fd_driver);
|
||||
|
||||
@ -187,11 +186,11 @@ static int create_apple_driver(char *temp, char *appledriver, char *first_level)
|
||||
mkstemp(temp);
|
||||
fd = fopen(temp, "w");
|
||||
|
||||
ret = fwrite(&block0, 1, sizeof(block0), fd);
|
||||
ret = fwrite(&map2048, 1, sizeof(map2048), fd);
|
||||
ret = fwrite(&map512, 1, sizeof(map512), fd);
|
||||
fwrite(&block0, 1, sizeof(block0), fd);
|
||||
fwrite(&map2048, 1, sizeof(map2048), fd);
|
||||
fwrite(&map512, 1, sizeof(map512), fd);
|
||||
memset(&map512, 0, sizeof(map512));
|
||||
ret = fwrite(&map512, 1, sizeof(map512), fd);
|
||||
fwrite(&map512, 1, sizeof(map512), fd);
|
||||
|
||||
fwrite(driver, driver_size, 1, fd);
|
||||
free(driver);
|
||||
|
@ -76,7 +76,6 @@ static int set_cmdline(char* image, char *kernel, char* cmdline, char *ramdisk)
|
||||
int get_cmdline(char* image)
|
||||
{
|
||||
int fd;
|
||||
int ret;
|
||||
char kernel[255];
|
||||
char cmdline[255];
|
||||
char ramdisk[255];
|
||||
@ -88,7 +87,7 @@ int get_cmdline(char* image)
|
||||
return 2;
|
||||
}
|
||||
|
||||
ret = emile_second_get_param(fd, kernel, cmdline, ramdisk);
|
||||
emile_second_get_param(fd, kernel, cmdline, ramdisk);
|
||||
|
||||
if (kernel[0])
|
||||
printf("kernel path: \"%s\"\n", kernel);
|
||||
|
@ -98,8 +98,10 @@ local gzFile gz_open (path, mode, fd)
|
||||
int fd;
|
||||
{
|
||||
int err;
|
||||
#ifndef NO_GZCOMPRESS
|
||||
int level = Z_DEFAULT_COMPRESSION; /* compression level */
|
||||
int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
|
||||
#endif
|
||||
char *p = (char*)mode;
|
||||
gz_stream *s;
|
||||
char fmode[80]; /* copy of mode, without the compression level */
|
||||
@ -136,6 +138,7 @@ local gzFile gz_open (path, mode, fd)
|
||||
do {
|
||||
if (*p == 'r') s->mode = 'r';
|
||||
if (*p == 'w' || *p == 'a') s->mode = 'w';
|
||||
#ifndef NO_GZCOMPRESS
|
||||
if (*p >= '0' && *p <= '9') {
|
||||
level = *p - '0';
|
||||
} else if (*p == 'f') {
|
||||
@ -145,6 +148,9 @@ local gzFile gz_open (path, mode, fd)
|
||||
} else if (*p == 'R') {
|
||||
strategy = Z_RLE;
|
||||
} else {
|
||||
#else
|
||||
if (1) {
|
||||
#endif
|
||||
*m++ = *p; /* copy the mode */
|
||||
}
|
||||
} while (*p++ && m != fmode + sizeof(fmode));
|
||||
|
@ -16,13 +16,12 @@ int main(int argc, char **argv)
|
||||
gzFile in;
|
||||
Elf32_Ehdr elf_header;
|
||||
Elf32_Phdr *program_header;
|
||||
int ret;
|
||||
unsigned long min_addr, max_addr, kernel_size;
|
||||
int i;
|
||||
char * base;
|
||||
|
||||
in = gzopen("vmlinux.gz", "rb");
|
||||
ret = gzread(in, &elf_header, sizeof(Elf32_Ehdr));
|
||||
gzread(in, &elf_header, sizeof(Elf32_Ehdr));
|
||||
|
||||
if (elf_header.e_machine != EM_68K)
|
||||
{
|
||||
@ -44,9 +43,9 @@ int main(int argc, char **argv)
|
||||
return 3;
|
||||
}
|
||||
|
||||
ret = gzseek(in, elf_header.e_phoff, SEEK_SET);
|
||||
gzseek(in, elf_header.e_phoff, SEEK_SET);
|
||||
|
||||
ret = gzread(in, program_header, elf_header.e_phnum * sizeof(Elf32_Phdr));
|
||||
gzread(in, program_header, elf_header.e_phnum * sizeof(Elf32_Phdr));
|
||||
min_addr = 0xffffffff;
|
||||
max_addr = 0;
|
||||
for (i = 0; i < elf_header.e_phnum; i++)
|
||||
@ -78,12 +77,13 @@ int main(int argc, char **argv)
|
||||
i, (long)program_header[i].p_offset,
|
||||
program_header[i].p_vaddr - PAGE_SIZE,
|
||||
(long)program_header[i].p_filesz);
|
||||
ret = gzseek(in, program_header[i].p_offset, SEEK_SET);
|
||||
ret = gzread(in, base + program_header[i].p_vaddr - PAGE_SIZE, program_header[i].p_filesz);
|
||||
gzseek(in, program_header[i].p_offset, SEEK_SET);
|
||||
gzread(in, base + program_header[i].p_vaddr - PAGE_SIZE,
|
||||
program_header[i].p_filesz);
|
||||
}
|
||||
write(STDOUT_FILENO, base, kernel_size);
|
||||
|
||||
ret = gzclose(in);
|
||||
gzclose(in);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user