From 8d057e4ee49a787feab49d20be00a01bc72bcf03 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 8 Jun 2011 08:23:08 +0000 Subject: [PATCH] Replaced some large local variables by other means in libburn/toc.c --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/toc.c | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index fc3287b..48456c3 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.06.08.081338" +#define Cdrskin_timestamP "2011.06.08.082201" diff --git a/libburn/toc.c b/libburn/toc.c index 1195a7c..d9e12d3 100644 --- a/libburn/toc.c +++ b/libburn/toc.c @@ -1,6 +1,7 @@ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens + Copyright (c) 2011 - 2011 Thomas Schmitt Provided under GPL version 2 or later. */ @@ -20,6 +21,7 @@ #include "libburn.h" #include "sector.h" #include "options.h" +#include "init.h" #if 0 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; int lba; - int i, j; - struct buffer mem; + int i, j, ret; + struct buffer *mem = NULL; struct burn_toc_entry *e; - /* ts A61008 : to be prevented on the higher levels */ - /* a ssert(d->busy); */ + BURN_ALLOC_MEM(mem, struct buffer, 1); - mem.bytes = 0; - mem.sectors = 1; + mem->bytes = 0; + mem->sectors = 1; o.raw = 1; o.c2errors = 0; o.subcodes_audio = 1; @@ -141,10 +142,13 @@ void toc_find_modes(struct burn_drive *d) t->mode = BURN_MODE1; /* 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. - mem.sectors = 1; - d->read_sectors(d, lba, mem.sectors, &o, &mem); - t->mode = sector_identify(mem.data); + mem->sectors = 1; + d->read_sectors(d, lba, mem.sectors, &o, mem); + t->mode = sector_identify(mem->data); */ } } + +ex: + BURN_FREE_MEM(mem); }