[Libburn] [PATCH] Compiler warnings in libburn
Derek Foreman
manmower at signalmarketing.com
Sat Feb 11 11:18:40 PST 2006
Thanks!
Merged in cvs.
On Sat, 11 Feb 2006, Philip Martin wrote:
> Fix a number of compiler warnings related to function prototypes and
> shadowed variables. It's mostly just mechanical stuff, but I changed
>
> burn_write_opts_has_mediacatalog -> burn_write_opts_set_has_mediacatalog
>
> to fit the naming scheme as I see it.
>
> Index: libburn/async.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/async.c,v
> retrieving revision 1.18
> diff -u -r1.18 async.c
> --- libburn/async.c 24 Feb 2004 18:37:46 -0000 1.18
> +++ libburn/async.c 11 Feb 2006 18:44:36 -0000
> @@ -5,6 +5,7 @@
> #include "drive.h"
> #include "write.h"
> #include "options.h"
> +#include "async.h"
>
> #include <pthread.h>
> #include <assert.h>
> @@ -178,7 +179,7 @@
> add_worker(opts->drive, (WorkerFunc) write_disc_worker_func, &o);
> }
>
> -void burn_async_join_all()
> +void burn_async_join_all(void)
> {
> void *ret;
>
> Index: libburn/async.h
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/async.h,v
> retrieving revision 1.5
> diff -u -r1.5 async.h
> --- libburn/async.h 24 Feb 2004 18:37:46 -0000 1.5
> +++ libburn/async.h 11 Feb 2006 18:44:36 -0000
> @@ -3,6 +3,6 @@
> #ifndef BURN__ASYNC_H
> #define BURN__ASYNC_H
>
> -void burn_async_join_all();
> +void burn_async_join_all(void);
> struct burn_write_opts;
> #endif /* BURN__ASYNC_H */
> Index: libburn/debug.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/debug.c,v
> retrieving revision 1.11
> diff -u -r1.11 debug.c
> --- libburn/debug.c 9 Dec 2003 00:05:47 -0000 1.11
> +++ libburn/debug.c 11 Feb 2006 18:44:36 -0000
> @@ -6,6 +6,8 @@
>
> #include <stdarg.h>
> #include <stdio.h>
> +#include "libburn.h"
> +#include "debug.h"
>
> static int burn_verbosity = 0;
>
> @@ -14,7 +16,7 @@
> burn_verbosity = v;
> }
>
> -void burn_print(int level, char *a, ...)
> +void burn_print(int level, const char *a, ...)
> {
> #ifdef WIN32
> char debug_string_data[256];
> Index: libburn/debug.h
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/debug.h,v
> retrieving revision 1.5
> diff -u -r1.5 debug.h
> --- libburn/debug.h 9 Dec 2003 00:05:47 -0000 1.5
> +++ libburn/debug.h 11 Feb 2006 18:44:36 -0000
> @@ -3,6 +3,6 @@
> #ifndef BURN__DEBUG_H
> #define BURN__DEBUG_H
>
> -void burn_print(int level, char *a, ...);
> +void burn_print(int level, const char *a, ...);
>
> #endif /* BURN__DEBUG_H */
> Index: libburn/drive.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/drive.c,v
> retrieving revision 1.258
> diff -u -r1.258 drive.c
> --- libburn/drive.c 9 Feb 2006 03:50:21 -0000 1.258
> +++ libburn/drive.c 11 Feb 2006 18:44:36 -0000
> @@ -122,7 +122,7 @@
> }
> }
>
> -void burn_wait_all()
> +void burn_wait_all(void)
> {
> unsigned int i;
> int finished = 0;
> @@ -340,9 +340,9 @@
> return d->disc;
> }
>
> -void burn_drive_set_speed(struct burn_drive *d, int read, int write)
> +void burn_drive_set_speed(struct burn_drive *d, int r, int w)
> {
> - d->set_speed(d, read, write);
> + d->set_speed(d, r, w);
> }
>
> int burn_msf_to_sectors(int m, int s, int f)
> Index: libburn/drive.h
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/drive.h,v
> retrieving revision 1.82
> diff -u -r1.82 drive.h
> --- libburn/drive.h 24 Feb 2004 18:37:46 -0000 1.82
> +++ libburn/drive.h 11 Feb 2006 18:44:36 -0000
> @@ -37,7 +37,7 @@
> struct burn_drive *burn_drive_register(struct burn_drive *);
>
> unsigned int burn_drive_count(void);
> -void burn_wait_all();
> +void burn_wait_all(void);
> int burn_sector_length_write(struct burn_drive *d);
> int burn_track_control(struct burn_drive *d, int);
> void burn_write_empty_sector(int fd);
> @@ -47,5 +47,7 @@
> int burn_drive_scan_sync(struct burn_drive_info *drives[],
> unsigned int *n_drives);
> void burn_disc_erase_sync(struct burn_drive *d, int fast);
> +int burn_drive_get_block_types(struct burn_drive *d,
> + enum burn_write_types write_type);
>
> #endif /* __DRIVE */
> Index: libburn/file.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/file.c,v
> retrieving revision 1.14
> diff -u -r1.14 file.c
> --- libburn/file.c 11 Feb 2006 03:00:38 -0000 1.14
> +++ libburn/file.c 11 Feb 2006 18:44:36 -0000
> @@ -19,7 +19,9 @@
> but to memorize its filling level, burn_source would have to get a member
> int remnant_bytes .
> */
> -int file_read(struct burn_source *source, unsigned char *buffer, int size)
> +static int file_read(struct burn_source *source,
> + unsigned char *buffer,
> + int size)
> {
> struct burn_source_file *fs = source->data;
> int ret,summed_ret = 0;
> @@ -38,7 +40,9 @@
> return summed_ret;
> }
>
> -int file_read_sub(struct burn_source *source, unsigned char *buffer, int size)
> +static int file_read_sub(struct burn_source *source,
> + unsigned char *buffer,
> + int size)
> {
> struct burn_source_file *fs = source->data;
>
> Index: libburn/libburn.h
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/libburn.h,v
> retrieving revision 1.199
> diff -u -r1.199 libburn.h
> --- libburn/libburn.h 11 Feb 2006 13:23:04 -0000 1.199
> +++ libburn/libburn.h 11 Feb 2006 18:44:37 -0000
> @@ -778,6 +778,10 @@
> */
> void burn_write_opts_set_perform_opc(struct burn_write_opts *opts, int opc);
>
> +void burn_write_opts_set_has_mediacatalog(struct burn_write_opts *opts, int has_mediacatalog);
> +
> +void burn_write_opts_set_mediacatalog(struct burn_write_opts *opts, unsigned char mediacatalog[13]);
> +
> /** Sets whether to read in raw mode or not
> @param opts The read opts to change
> @param raw_mode If non-zero, reading will be done in raw mode, so that everything in the data tracks on the
> @@ -867,6 +871,8 @@
> struct burn_session **burn_disc_get_sessions(struct burn_disc *d,
> int *num);
>
> +int burn_disc_get_sectors(struct burn_disc *d);
> +
> /** Gets an array of all the tracks for a session
> THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK
> @param s session to get track array for
> @@ -876,6 +882,8 @@
> struct burn_track **burn_session_get_tracks(struct burn_session *s,
> int *num);
>
> +int burn_session_get_sectors(struct burn_session *s);
> +
> /** Gets the mode of a track
> @param track the track to query
> @return the track's mode
> Index: libburn/message.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/message.c,v
> retrieving revision 1.4
> diff -u -r1.4 message.c
> --- libburn/message.c 24 Feb 2004 18:37:46 -0000 1.4
> +++ libburn/message.c 11 Feb 2006 18:44:37 -0000
> @@ -1,6 +1,7 @@
> /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
>
> #include "message.h"
> +#include "libburn.h"
> #include "debug.h"
>
> #include <stdlib.h>
> @@ -19,7 +20,7 @@
> free(msg);
> }
>
> -void burn_message_clear_queue()
> +void burn_message_clear_queue(void)
> {
> struct burn_message *msg;
>
> @@ -49,7 +50,7 @@
> return msg;
> }
>
> -void queue_push_tail(struct burn_message *msg)
> +static void queue_push_tail(struct burn_message *msg)
> {
> struct message_list *node;
>
> @@ -93,8 +94,8 @@
> queue_push_tail(msg);
> }
>
> -void burn_message_error(struct burn_drive *drive,
> - enum burn_message_info message)
> +void burn_message_error_new(struct burn_drive *drive,
> + enum burn_message_info message)
> {
> struct burn_message *msg;
>
> Index: libburn/message.h
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/message.h,v
> retrieving revision 1.4
> diff -u -r1.4 message.h
> --- libburn/message.h 24 Feb 2004 18:37:46 -0000 1.4
> +++ libburn/message.h 11 Feb 2006 18:44:37 -0000
> @@ -5,7 +5,7 @@
>
> #include "libburn.h"
>
> -void burn_message_clear_queue();
> +void burn_message_clear_queue(void);
>
> void burn_message_info_new(struct burn_drive *drive,
> enum burn_message_info message);
> Index: libburn/mmc.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/mmc.c,v
> retrieving revision 1.139
> diff -u -r1.139 mmc.c
> --- libburn/mmc.c 11 Feb 2006 02:13:00 -0000 1.139
> +++ libburn/mmc.c 11 Feb 2006 18:44:37 -0000
> @@ -451,17 +451,17 @@
> d->issue_command(d, &c);
> }
>
> -void mmc_set_speed(struct burn_drive *d, int read, int write)
> +void mmc_set_speed(struct burn_drive *d, int r, int w)
> {
> struct command c;
>
> memcpy(c.opcode, MMC_SET_SPEED, sizeof(MMC_SET_SPEED));
> c.retry = 1;
> c.oplen = sizeof(MMC_SET_SPEED);
> - c.opcode[2] = read >> 8;
> - c.opcode[3] = read & 0xFF;
> - c.opcode[4] = write >> 8;
> - c.opcode[5] = write & 0xFF;
> + c.opcode[2] = r >> 8;
> + c.opcode[3] = r & 0xFF;
> + c.opcode[4] = w >> 8;
> + c.opcode[5] = w & 0xFF;
> c.page = NULL;
> c.dir = NO_TRANSFER;
> d->issue_command(d, &c);
> Index: libburn/mmc.h
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/mmc.h,v
> retrieving revision 1.40
> diff -u -r1.40 mmc.h
> --- libburn/mmc.h 9 Feb 2006 03:50:21 -0000 1.40
> +++ libburn/mmc.h 11 Feb 2006 18:44:37 -0000
> @@ -17,6 +17,7 @@
> void mmc_close(struct burn_drive *, int session, int track);
> void mmc_get_event(struct burn_drive *);
> int mmc_write(struct burn_drive *, int start, struct buffer *buf);
> +void mmc_write_12(struct burn_drive *d, int start, struct buffer *buf);
> void mmc_sync_cache(struct burn_drive *);
> void mmc_load(struct burn_drive *);
> void mmc_eject(struct burn_drive *);
> Index: libburn/null.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/null.c,v
> retrieving revision 1.2
> diff -u -r1.2 null.c
> --- libburn/null.c 1 Feb 2004 06:11:00 -0000 1.2
> +++ libburn/null.c 11 Feb 2006 18:44:37 -0000
> @@ -1,6 +1,8 @@
> /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
>
> +#include "null.h"
> #include "libburn.h"
> +#include <stdlib.h>
>
> #include <string.h>
> int null_read(struct burn_source *source, unsigned char *buffer, int size)
> Index: libburn/null.h
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/null.h,v
> retrieving revision 1.2
> diff -u -r1.2 null.h
> --- libburn/null.h 1 Feb 2004 06:11:00 -0000 1.2
> +++ libburn/null.h 11 Feb 2006 18:44:37 -0000
> @@ -3,6 +3,7 @@
> #ifndef BURN__NULL_H
> #define BURN__NULL_H
>
> +struct burn_source;
> int null_read(struct burn_source *source, unsigned char *buffer, int size);
> struct burn_source *burn_null_source_new(void);
>
> Index: libburn/options.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/options.c,v
> retrieving revision 1.17
> diff -u -r1.17 options.c
> --- libburn/options.c 24 Feb 2004 18:37:46 -0000 1.17
> +++ libburn/options.c 11 Feb 2006 18:44:37 -0000
> @@ -109,8 +109,8 @@
> opts->perform_opc = opc;
> }
>
> -void burn_write_opts_has_mediacatalog(struct burn_write_opts *opts,
> - int has_mediacatalog)
> +void burn_write_opts_set_has_mediacatalog(struct burn_write_opts *opts,
> + int has_mediacatalog)
> {
> opts->has_mediacatalog = has_mediacatalog;
> }
> @@ -121,7 +121,7 @@
> memcpy(opts->mediacatalog, &mediacatalog, 13);
> }
>
> -void burn_read_opts_set_raw_mode(struct burn_read_opts *opts, int raw)
> +void burn_read_opts_set_raw(struct burn_read_opts *opts, int raw)
> {
> opts->raw = raw;
> }
> Index: libburn/sector.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/sector.c,v
> retrieving revision 1.102
> diff -u -r1.102 sector.c
> --- libburn/sector.c 11 Feb 2006 02:56:25 -0000 1.102
> +++ libburn/sector.c 11 Feb 2006 18:44:37 -0000
> @@ -231,7 +231,7 @@
> }
> }
>
> -void subcode_toc(struct burn_drive *d, int mode, unsigned char *data)
> +static void subcode_toc(struct burn_drive *d, int mode, unsigned char *data)
> {
> unsigned char *q;
> int track;
> @@ -322,8 +322,8 @@
> return 1;
> }
>
> -void subcode_lout(struct burn_write_opts *o, unsigned char control,
> - unsigned char *data)
> +static void subcode_lout(struct burn_write_opts *o, unsigned char control,
> + unsigned char *data)
> {
> struct burn_drive *d = o->drive;
> unsigned char *q;
> @@ -368,7 +368,7 @@
>
> void subcode_user(struct burn_write_opts *o, unsigned char *subcodes,
> unsigned char tno, unsigned char control,
> - unsigned char index, struct isrc *isrc, int psub)
> + unsigned char indx, struct isrc *isrc, int psub)
> {
> struct burn_drive *d = o->drive;
> unsigned char *p, *q;
> @@ -403,7 +403,7 @@
> switch (qmode) {
> case 1:
> q[1] = dec_to_bcd(tno); /* track number */
> - q[2] = dec_to_bcd(index); /* index XXX read this shit
> + q[2] = dec_to_bcd(indx); /* index XXX read this shit
> from the track array */
> burn_lba_to_msf(d->rlba, &m, &s, &f);
> q[3] = dec_to_bcd(m); /* rel min */
> Index: libburn/source.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/source.c,v
> retrieving revision 1.8
> diff -u -r1.8 source.c
> --- libburn/source.c 25 Feb 2004 04:02:22 -0000 1.8
> +++ libburn/source.c 11 Feb 2006 18:44:37 -0000
> @@ -3,6 +3,7 @@
> #include <stdlib.h>
> #include <string.h>
> #include "libburn.h"
> +#include "source.h"
> #include "structure.h"
>
> void burn_source_free(struct burn_source *src)
> Index: libburn/util.c
> ===================================================================
> RCS file: /cvs/burn/burn/libburn/util.c,v
> retrieving revision 1.6
> diff -u -r1.6 util.c
> --- libburn/util.c 9 Feb 2006 02:06:16 -0000 1.6
> +++ libburn/util.c 11 Feb 2006 18:44:37 -0000
> @@ -2,6 +2,8 @@
> #include <assert.h>
> #include <stdlib.h>
> #include "../version.h"
> +#include "util.h"
> +#include "libburn.h"
>
> char *burn_strdup(char *s)
> {
>
> --
> Philip Martin
> _______________________________________________
> libburn mailing list
> libburn at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libburn
>
More information about the libburn
mailing list