1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
Description: Fix some compiler warnings
Forwarded: yes
Author: Peter Pentchev <[email protected]>
Last-Update: 2014-03-11
--- a/id3.c
+++ b/id3.c
@@ -249,7 +249,7 @@
id3tag->style = 0xFF;
}
-extern char *
+extern const char *
id3_findstyle(int styleid)
{
int ctr;
--- a/id3.h
+++ b/id3.h
@@ -63,7 +63,7 @@
struct style_s {
unsigned char styleid;
- char *name;
+ const char *name;
};
extern struct style_s id3_styles[];
@@ -72,6 +72,6 @@
extern int id3_appendtag (FILE *fout, id3tag_t *id3tag);
extern int id3_replacetag (FILE *fout, id3tag_t *id3tag);
extern void id3_cleartag(id3tag_t *id3tag);
-extern char *id3_findstyle(int styleid);
+extern const char *id3_findstyle(int styleid);
#endif /* #ifndef _ID3_H */
--- a/id3tool.c
+++ b/id3tool.c
@@ -40,6 +40,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <ctype.h>
#ifdef HAVE_UNISTD_H
@@ -68,6 +69,9 @@
};
#define ID3TOOL_GETOPT_ARGS "t:a:r:y:n:g:G:c:lvh"
+static void showblurb(void);
+static void showusage(int argc, char **argv);
+
#ifdef NEED_STRDUP
extern char *
my_strdup (char *strin)
@@ -83,7 +87,7 @@
}
#endif
-void
+static void
showblurb(void)
{
printf ("id3tool version %s\n", VERSION);
@@ -102,11 +106,11 @@
#endif
}
-void
+static void
showusage(int argc, char **argv)
{
printf ("usage:\n");
- printf ("%s [<options>] <filename>\n", argv[0]);
+ printf ("%s [<options>] <filename>\n", argc > 0? argv[0]: "id3tool");
printf (" -t, --set-title=WORD\t\tSets the title to WORD\n");
printf (" -a, --set-album=WORD\t\tSets the album to WORD\n");
printf (" -r, --set-artist=WORD\t\tSets the artist to WORD\n");
|