Replaced some large local variables by other means in libburn/toc.c

This commit is contained in:
Thomas Schmitt 2011-06-08 08:23:08 +00:00
parent 5d58052a7b
commit 5a5e75fee8
2 changed files with 14 additions and 10 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2011.06.08.081338" #define Cdrskin_timestamP "2011.06.08.082201"

View File

@ -1,6 +1,7 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2011 - 2011 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
*/ */
@ -20,6 +21,7 @@
#include "libburn.h" #include "libburn.h"
#include "sector.h" #include "sector.h"
#include "options.h" #include "options.h"
#include "init.h"
#if 0 #if 0
static void write_clonecd2(volatile struct toc *toc, int f); static void write_clonecd2(volatile struct toc *toc, int f);
@ -105,15 +107,14 @@ void toc_find_modes(struct burn_drive *d)
{ {
struct burn_read_opts o; struct burn_read_opts o;
int lba; int lba;
int i, j; int i, j, ret;
struct buffer mem; struct buffer *mem = NULL;
struct burn_toc_entry *e; struct burn_toc_entry *e;
/* ts A61008 : to be prevented on the higher levels */ BURN_ALLOC_MEM(mem, struct buffer, 1);
/* a ssert(d->busy); */
mem.bytes = 0; mem->bytes = 0;
mem.sectors = 1; mem->sectors = 1;
o.raw = 1; o.raw = 1;
o.c2errors = 0; o.c2errors = 0;
o.subcodes_audio = 1; o.subcodes_audio = 1;
@ -141,10 +142,13 @@ void toc_find_modes(struct burn_drive *d)
t->mode = BURN_MODE1; t->mode = BURN_MODE1;
/* ts A70519 : this does not work with GNU/Linux 2.4 USB because one cannot /* ts A70519 : this does not work with GNU/Linux 2.4 USB because one cannot
predict the exact dxfer_size without knowing the sector type. predict the exact dxfer_size without knowing the sector type.
mem.sectors = 1; mem->sectors = 1;
d->read_sectors(d, lba, mem.sectors, &o, &mem); d->read_sectors(d, lba, mem.sectors, &o, mem);
t->mode = sector_identify(mem.data); t->mode = sector_identify(mem->data);
*/ */
} }
} }
ex:
BURN_FREE_MEM(mem);
} }