libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 212c68e5b2adac184ce4d743358a4e905c5a9ae6
parent 252f633f7cbfe2b73ec9c5e8921c9086884868c9
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  7 Jun 2012 19:52:56 +0000

-fixing many warnings

Diffstat:
MINSTALL | 9++-------
MMakefile.am | 2+-
Mconfigure.ac | 2++
Mdoc/version.texi | 4++--
Msrc/plugins/ebml_extractor.c | 27+++++++--------------------
Msrc/plugins/id3v2_extractor.c | 9++++-----
Msrc/plugins/png_extractor.c | 35+++++++++++++++++++----------------
Msrc/plugins/s3m_extractor.c | 1-
8 files changed, 37 insertions(+), 52 deletions(-)

diff --git a/INSTALL b/INSTALL @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, -Inc. +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -226,11 +226,6 @@ order to use an ANSI C compiler: and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `<wchar.h>' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended diff --git a/Makefile.am b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = libltdl m4 po src doc . +SUBDIRS = m4 po src doc . EXTRA_DIST = config.rpath \ ABOUT-NLS install-sh diff --git a/configure.ac b/configure.ac @@ -1,6 +1,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) AC_INIT([libextractor], [0.6.3], [bug-libextractor@gnu.org]) +LT_CONFIG_LTDL_DIR([libltdl]) +AC_CONFIG_AUX_DIR([libltdl/config]) AM_INIT_AUTOMAKE([silent-rules]) AC_CONFIG_HEADERS([config.h]) AH_TOP([#define _GNU_SOURCE 1]) diff --git a/doc/version.texi b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 21 March 2012 -@set UPDATED-MONTH March 2012 +@set UPDATED 29 January 2012 +@set UPDATED-MONTH January 2012 @set EDITION 0.6.3 @set VERSION 0.6.3 diff --git a/src/plugins/ebml_extractor.c b/src/plugins/ebml_extractor.c @@ -355,7 +355,6 @@ VINTparse (struct EXTRACTOR_PluginList *plugin, unsigned int c; uint64_t result_u; int64_t result_s; - unsigned char tempc; uint64_t temp; unsigned char *data; unsigned char first_byte; @@ -499,7 +498,6 @@ elementRead (struct EXTRACTOR_PluginList *plugin, int64_t tempsize; ssize_t id_offset; ssize_t size_offset; - unsigned char *data; tempID = 0; @@ -526,9 +524,7 @@ idRead (struct EXTRACTOR_PluginList *plugin, uint64_t length, uint32_t *id) { int64_t tempID; - int64_t tempsize; ssize_t id_offset; - ssize_t size_offset; tempID = 0; @@ -945,7 +941,7 @@ EXTRACTOR_ebml_init_state_method () struct ebml_state *state; state = malloc (sizeof (struct ebml_state)); if (state == NULL) - return; + return NULL; memset (state, 0, sizeof (struct ebml_state)); state->next_state = EBML_BAD_STATE; @@ -959,7 +955,7 @@ EXTRACTOR_ebml_init_state_method () static void report_simpletag (struct ebml_state *state, EXTRACTOR_MetaDataProcessor proc, void *proc_cls) { - struct matroska_simpletag *el, *next, *parent; + struct matroska_simpletag *el, *next; char format[MAX_STRING_SIZE + 1]; for (el = state->tag_tree; el != NULL; el = next) { @@ -1124,9 +1120,9 @@ report_state (struct ebml_state *state, EXTRACTOR_MetaDataProcessor proc, void * char hz_part[MAX_STRING_SIZE + 1]; struct MatroskaTrackType *tt; const char *track_type_string = NULL; - char *codec_name = NULL; char use_video = 0; char use_audio = 0; + state->reported_matroska_track = 1; for (tt = track_types; tt->code > 0; tt++) { @@ -1144,7 +1140,7 @@ report_state (struct ebml_state *state, EXTRACTOR_MetaDataProcessor proc, void * track_type_string = "unknown"; if (state->matroska_track_name == NULL) - snprintf (name_part, MAX_STRING_SIZE, ""); + snprintf (name_part, MAX_STRING_SIZE, "%s", ""); else snprintf (name_part, MAX_STRING_SIZE, "`%s' ", state->matroska_track_name); name_part[MAX_STRING_SIZE] = '\0'; @@ -1229,12 +1225,6 @@ ebml_stack_pop (struct ebml_state *state) return result; } -static void -ebml_stack_push (struct ebml_state *state, struct ebml_element *element) -{ - element->parent = state->stack_top; - state->stack_top = element; -} static void ebml_stack_push_new (struct ebml_state *state, uint64_t position, uint32_t id, uint64_t size, uint64_t header_size, int finish_state, int prev_state, int bail_state, int bail_next_state) @@ -1398,7 +1388,6 @@ sort_seeks (struct ebml_state *state) int EXTRACTOR_ebml_extract_method (struct EXTRACTOR_PluginList *plugin, EXTRACTOR_MetaDataProcessor proc, void *proc_cls) { - int64_t i; uint64_t offset = 0; ssize_t read_result; unsigned char *data; @@ -1408,13 +1397,11 @@ EXTRACTOR_ebml_extract_method (struct EXTRACTOR_PluginList *plugin, EXTRACTOR_Me uint32_t eID; uint64_t eSize; int do_break; - int r; uint64_t uint_value; int64_t sint_value; char string_value[MAX_STRING_SIZE + 1]; long double float_value; - int64_t date_value; uint32_t id_value; if (plugin == NULL) @@ -1456,7 +1443,7 @@ EXTRACTOR_ebml_extract_method (struct EXTRACTOR_PluginList *plugin, EXTRACTOR_Me state->state = EBML_READING_HEADER; break; case EBML_READING_HEADER: - if (0 > (read_result = elementRead (plugin, &eID, &eSize))) + if (0 > (read_result = elementRead (plugin, &eID, (int64_t*) &eSize))) return EXTRACTOR_ebml_discard_state_method (state); if (EBMLID_EBML != eID) { @@ -1503,7 +1490,7 @@ EXTRACTOR_ebml_extract_method (struct EXTRACTOR_PluginList *plugin, EXTRACTOR_Me { enum EBMLState next_state = state->next_state; state->state = EBML_BAD_STATE; - read_result = elementRead (plugin, &eID, &eSize); + read_result = elementRead (plugin, &eID, (int64_t*) &eSize); if (read_result >= 0) state->state = next_state; } @@ -2226,7 +2213,7 @@ EXTRACTOR_ebml_extract_method (struct EXTRACTOR_PluginList *plugin, EXTRACTOR_Me break; case MatroskaID_Info_DateUTC: state->matroska_info_date_utc_is_set = 1; - state->matroska_info_date_utc = date_value; + state->matroska_info_date_utc = 0; // FIXME: date_value; break; } rise_up_after_value (plugin, state, EBML_READING_MATROSKA_INFO_CONTENTS); diff --git a/src/plugins/id3v2_extractor.c b/src/plugins/id3v2_extractor.c @@ -256,7 +256,6 @@ EXTRACTOR_id3v2_extract_method (struct EXTRACTOR_PluginList *plugin, EXTRACTOR_MetaDataProcessor proc, void *proc_cls) { int64_t offset = 0; - int64_t size; struct id3v2_state *state; unsigned char *data; char *word = NULL; @@ -360,9 +359,9 @@ EXTRACTOR_id3v2_extract_method (struct EXTRACTOR_PluginList *plugin, } if (state->ver == 0x03 && state->extended_header) { - uint32_t padding, extended_header_size; + uint32_t extended_header_size; extended_header_size = (((data[0]) << 24) | ((data[1]) << 16) | ((data[2]) << 8) | ((data[3]) << 0)); - padding = (((data[6]) << 24) | ((data[7]) << 16) | ((data[8]) << 8) | ((data[9]) << 0)); + // padding = (((data[6]) << 24) | ((data[7]) << 16) | ((data[8]) << 8) | ((data[9]) << 0)); if (extended_header_size - 6 != pl_read (plugin, &data, extended_header_size - 6)) { state->state = ID3V2_INVALID; @@ -532,7 +531,7 @@ EXTRACTOR_id3v2_extract_method (struct EXTRACTOR_PluginList *plugin, } /* find end of description */ off = 4; - while ((off < size) && (off < state->csize) && (data[off] != '\0')) + while ((off < state->csize) && (data[off] != '\0')) off++; if ((off >= state->csize) || (data[off] != '\0')) { @@ -591,7 +590,7 @@ EXTRACTOR_id3v2_extract_method (struct EXTRACTOR_PluginList *plugin, } /* find end of description */ off = 4; - while ((off < size) && (off < state->csize) && (data[off] != '\0')) + while ((off < state->csize) && (data[off] != '\0')) off++; if ((off >= state->csize) || (data[off] != '\0')) { diff --git a/src/plugins/png_extractor.c b/src/plugins/png_extractor.c @@ -23,6 +23,9 @@ #include <zlib.h> #include "convert.h" +#include "extractor_plugins.h" + + static char * stndup (const char *str, size_t n) { @@ -100,17 +103,17 @@ processtEXt (struct EXTRACTOR_PluginList *plugin, return 1; //data += 4; - off = stnlen (data, length) + 1; + off = stnlen ((char*) data, length) + 1; if (off >= length) return 0; /* failed to find '\0' */ - keyword = EXTRACTOR_common_convert_to_utf8 (&data[off], length - off, "ISO-8859-1"); + keyword = EXTRACTOR_common_convert_to_utf8 ( (char*) &data[off], length - off, "ISO-8859-1"); if (keyword == NULL) return 0; i = 0; ret = 0; while (tagmap[i].name != NULL) { - if (0 == strcmp (tagmap[i].name, data)) + if (0 == strcmp (tagmap[i].name, (char*) data)) { ADDF (tagmap[i].type, keyword); return 0; @@ -145,13 +148,13 @@ processiTXt (struct EXTRACTOR_PluginList *plugin, if (length != pl_read (plugin, &data, length)) return 1; - pos = stnlen (data, length) + 1; + pos = stnlen ( (char*) data, length) + 1; if (pos >= length) return 0; compressed = data[pos++]; if (compressed && (data[pos++] != 0)) return 0; /* bad compression method */ - language = &data[pos]; + language = (char*) &data[pos]; ret = 0; if (stnlen (language, length - pos) > 0) { @@ -161,7 +164,7 @@ processiTXt (struct EXTRACTOR_PluginList *plugin, pos += stnlen (language, length - pos) + 1; if (pos + 1 >= length) return 0; - translated = &data[pos]; /* already in utf-8! */ + translated = (char*) &data[pos]; /* already in utf-8! */ if (stnlen (translated, length - pos) > 0) { lan = stndup (translated, length - pos); @@ -207,12 +210,12 @@ processiTXt (struct EXTRACTOR_PluginList *plugin, } else { - keyword = stndup (&data[pos], length - pos); + keyword = stndup ((char*) &data[pos], length - pos); } i = 0; while (tagmap[i].name != NULL) { - if (0 == strcmp (tagmap[i].name, data)) + if (0 == strcmp (tagmap[i].name, (char*) data)) { ADDF (tagmap[i].type, keyword /* already in utf8 */); return 0; @@ -270,7 +273,7 @@ processzTXt (struct EXTRACTOR_PluginList *plugin, return 1; //data += 4; - off = stnlen (data, length) + 1; + off = stnlen ( (char*) data, length) + 1; if (off >= length) return 0; /* failed to find '\0' */ if (data[off] != 0) @@ -310,7 +313,7 @@ processzTXt (struct EXTRACTOR_PluginList *plugin, i = 0; while (tagmap[i].name != NULL) { - if (0 == strcmp (tagmap[i].name, data)) + if (0 == strcmp (tagmap[i].name, (char*) data)) { ADDF (tagmap[i].type, keyword); return 0; @@ -382,7 +385,7 @@ EXTRACTOR_png_extract_method (struct EXTRACTOR_PluginList *plugin, if (ret != pl_read (plugin, &data, ret)) return 1; - if (0 != strncmp (data, PNG_HEADER, ret)) + if (0 != strncmp ((char*) data, PNG_HEADER, ret)) return 1; ADD (EXTRACTOR_METATYPE_MIMETYPE, "image/png"); @@ -399,15 +402,15 @@ EXTRACTOR_png_extract_method (struct EXTRACTOR_PluginList *plugin, if (pos <= 0) break; pos += length + 4; /* Chunk type, data, crc */ - if (0 == strncmp (data, "IHDR", 4)) + if (0 == strncmp ((char*) data, "IHDR", 4)) ret = processIHDR (plugin, length, proc, proc_cls); - if (0 == strncmp (data, "iTXt", 4)) + if (0 == strncmp ((char*) data, "iTXt", 4)) ret = processiTXt (plugin, length, proc, proc_cls); - if (0 == strncmp (data, "tEXt", 4)) + if (0 == strncmp ((char*)data, "tEXt", 4)) ret = processtEXt (plugin, length, proc, proc_cls); - if (0 == strncmp (data, "zTXt", 4)) + if (0 == strncmp ((char*) data, "zTXt", 4)) ret = processzTXt (plugin, length, proc, proc_cls); - if (0 == strncmp (data, "tIME", 4)) + if (0 == strncmp ((char*) data, "tIME", 4)) ret = processtIME (plugin, length, proc, proc_cls); if (ret != 0) break; diff --git a/src/plugins/s3m_extractor.c b/src/plugins/s3m_extractor.c @@ -63,7 +63,6 @@ int EXTRACTOR_s3m_extract_method (struct EXTRACTOR_PluginList *plugin, EXTRACTOR_MetaDataProcessor proc, void *proc_cls) { - int64_t offset; unsigned char *data; struct S3MHeader header; char song_name_NT[29];