commit f9c0bed57bf5ae4802bef0c6b51d9a5e48aa7375
parent 2abb8568132852381bed7af0bad7d983655a20ea
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 10 Nov 2026 20:06:06 +0100
fix misc compiler warnings
Diffstat:
17 files changed, 75 insertions(+), 17 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -16,7 +16,7 @@
#
#
AC_PREREQ([2.72])
-AC_INIT([libextractor],[1.19],[bug-libextractor@gnu.org])
+AC_INIT([libextractor],[1.20],[bug-libextractor@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
diff --git a/src/main/extractor.c b/src/main/extractor.c
@@ -680,6 +680,9 @@ EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins,
* Initialize gettext and libltdl (and W32 if needed).
*/
void __attribute__ ((constructor))
+EXTRACTOR_ltdl_init (void);
+
+void __attribute__ ((constructor))
EXTRACTOR_ltdl_init ()
{
int err;
@@ -709,6 +712,9 @@ EXTRACTOR_ltdl_init ()
* Deinit.
*/
void __attribute__ ((destructor))
+EXTRACTOR_ltdl_fini (void);
+
+void __attribute__ ((destructor))
EXTRACTOR_ltdl_fini ()
{
#if WINDOWS
diff --git a/src/main/test2_extractor.c b/src/main/test2_extractor.c
@@ -44,6 +44,9 @@
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_test2_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_test2_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
void *dp;
diff --git a/src/main/test_extractor.c b/src/main/test_extractor.c
@@ -44,6 +44,9 @@
* @param ec extraction context provided to the plugin
*/
_EXTRACTOR_EXTERN void
+EXTRACTOR_test_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+_EXTRACTOR_EXTERN void
EXTRACTOR_test_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
void *dp;
diff --git a/src/plugins/dvi_extractor.c b/src/plugins/dvi_extractor.c
@@ -1236,7 +1236,6 @@ parse_fnt_def (struct DviText *t,
uint32_t d;
uint32_t a;
uint32_t l;
- unsigned int i;
if ( (0 != read_u (t, pos, n, &k)) ||
(0 != read_u (t, pos, 4, &csum)) ||
@@ -1255,17 +1254,19 @@ parse_fnt_def (struct DviText *t,
while (0 != t->font_hash[h])
h = (h + 1) & (DVI_FONT_HASH - 1);
t->font_hash[h] = (uint16_t) (t->num_fonts + 1);
- struct DviFont *f = &t->fonts[t->num_fonts++];
-
- f->k = k;
- if (s < 0)
- s = -s;
- if ( (0 == s) ||
- (s > (1 << 30)) )
- s = DVI_DEFAULT_SIZE;
- f->size = (double) s;
- f->enc = dvi_font_encoding ((const char *) &t->data[*pos + a],
- l);
+ {
+ struct DviFont *f = &t->fonts[t->num_fonts++];
+
+ f->k = k;
+ if (s < 0)
+ s = -s;
+ if ( (0 == s) ||
+ (s > (1 << 30)) )
+ s = DVI_DEFAULT_SIZE;
+ f->size = (double) s;
+ f->enc = dvi_font_encoding ((const char *) &t->data[*pos + a],
+ l);
+ }
}
*pos += a + l;
(void) csum;
@@ -1343,7 +1344,9 @@ interpret_page (struct DviText *t,
SEEK_CUR); /* keep the host from giving up */
if (op < 128)
{
- r.h += (int64_t) put_glyph (t, font, op, r.h, r.v);
+ double pgr = put_glyph (t, font, op, r.h, r.v);
+
+ r.h += (int64_t) pgr;
continue;
}
if ( (op >= 171) &&
@@ -1357,7 +1360,10 @@ interpret_page (struct DviText *t,
case 128: case 129: case 130: case 131: /* set1..4 */
if (0 != read_u (t, &pos, op - 127, &u))
goto DONE;
- r.h += (int64_t) put_glyph (t, font, u, r.h, r.v);
+ {
+ double pgr = put_glyph (t, font, u, r.h, r.v);
+ r.h += (int64_t) pgr;
+ }
break;
case 133: case 134: case 135: case 136: /* put1..4 */
if (0 != read_u (t, &pos, op - 132, &u))
diff --git a/src/plugins/gstreamer_extractor.c b/src/plugins/gstreamer_extractor.c
@@ -2194,6 +2194,9 @@ _run_async (struct PrivStruct *ps)
* meta data
*/
void
+EXTRACTOR_gstreamer_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_gstreamer_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
struct PrivStruct ps;
@@ -2237,6 +2240,9 @@ EXTRACTOR_gstreamer_extract_method (struct EXTRACTOR_ExtractContext *ec)
* Initialize glib and globals.
*/
void __attribute__ ((constructor))
+gstreamer_init (void);
+
+void __attribute__ ((constructor))
gstreamer_init ()
{
gst_init (NULL, NULL);
diff --git a/src/plugins/it_extractor.c b/src/plugins/it_extractor.c
@@ -63,6 +63,9 @@ struct Header
* @param ec extraction context
*/
void
+EXTRACTOR_it_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_it_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
void *data;
diff --git a/src/plugins/jpeg_extractor.c b/src/plugins/jpeg_extractor.c
@@ -87,6 +87,9 @@ no_exit (j_common_ptr cinfo)
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_jpeg_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_jpeg_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
struct jpeg_decompress_struct jds;
diff --git a/src/plugins/mediautil.h b/src/plugins/mediautil.h
@@ -311,7 +311,7 @@ EXTRACTOR_media_options_parse_ (const char *config,
* the attack surface for no gain, so both plugin families gate on this.
*
* @param ec extraction context to inspect
- * @param want_audio also accept "audio/*" (in addition to "video/*")
+ * @param want_audio also accept "audio/" (in addition to "video/")
* @return 1 if the input should be processed, 0 if not
*/
int
diff --git a/src/plugins/mime_extractor.c b/src/plugins/mime_extractor.c
@@ -47,6 +47,9 @@ static char *magic_path;
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_mime_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_mime_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
void *buf;
@@ -96,6 +99,9 @@ EXTRACTOR_mime_extract_method (struct EXTRACTOR_ExtractContext *ec)
* Constructor for the library. Loads the magic file.
*/
void __attribute__ ((constructor))
+mime_ltdl_init (void);
+
+void __attribute__ ((constructor))
mime_ltdl_init ()
{
magic = magic_open (MAGIC_MIME_TYPE);
@@ -110,6 +116,9 @@ mime_ltdl_init ()
* Destructor for the library, cleans up.
*/
void __attribute__ ((destructor))
+mime_ltdl_fini (void);
+
+void __attribute__ ((destructor))
mime_ltdl_fini ()
{
if (NULL != magic)
diff --git a/src/plugins/mpeg_extractor.c b/src/plugins/mpeg_extractor.c
@@ -47,6 +47,9 @@
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_mpeg_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_mpeg_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
mpeg2dec_t *handle;
diff --git a/src/plugins/odf_extractor.c b/src/plugins/odf_extractor.c
@@ -1089,6 +1089,9 @@ odf_extract_fulltext (struct EXTRACTOR_UnzipFile *uf,
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_odf_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_odf_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
char filename_inzip[MAXFILENAME];
diff --git a/src/plugins/ogg_extractor.c b/src/plugins/ogg_extractor.c
@@ -153,6 +153,9 @@ get_comment (vorbis_comment *vc,
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_ogg_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_ogg_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
uint64_t fsize;
diff --git a/src/plugins/png_extractor.c b/src/plugins/png_extractor.c
@@ -472,6 +472,9 @@ FINISH:
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_png_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_png_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
void *data;
diff --git a/src/plugins/test_lib.c b/src/plugins/test_lib.c
@@ -264,6 +264,7 @@ int
ET_main (const char *plugin_name,
struct ProblemSet *ps)
{
+ static char env_val[] = "LIBEXTRACTOR_PREFIX=./.libs/";
int ret;
/* change environment to find plugins which may not yet be
@@ -272,7 +273,7 @@ ET_main (const char *plugin_name,
#ifndef WINDOWS
ignore_sigpipe ();
#endif
- if (0 != putenv ("LIBEXTRACTOR_PREFIX=./.libs/"))
+ if (0 != putenv (env_val))
fprintf (stderr,
"Failed to update my environment, plugin loading may fail: %s\n",
strerror (errno));
diff --git a/src/plugins/tiff_extractor.c b/src/plugins/tiff_extractor.c
@@ -173,6 +173,9 @@ static struct Matches tmap[] = {
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_tiff_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_tiff_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
TIFF *tiff;
diff --git a/src/plugins/zip_extractor.c b/src/plugins/zip_extractor.c
@@ -34,6 +34,9 @@
* @param ec extraction context provided to the plugin
*/
void
+EXTRACTOR_zip_extract_method (struct EXTRACTOR_ExtractContext *ec);
+
+void
EXTRACTOR_zip_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
struct EXTRACTOR_UnzipFile *uf;