summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2013-04-07 13:44:33 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2013-04-07 13:44:45 +1000
commitb9574fe58950d38c96399161421484935249822a (patch)
treec6610c2d49ea334e98daac376742c6f756780dd5
parent6a9a18ff7abbcefe1286033be8c72f635102c84d (diff)
downloadflac-b9574fe58950d38c96399161421484935249822a.tar.gz
Fix a bunch of compiler warnings (mainly MinGW).
-rw-r--r--include/share/endswap.h2
-rw-r--r--src/libFLAC/stream_encoder.c4
-rw-r--r--src/metaflac/main.c2
-rw-r--r--src/share/getopt/getopt.c6
-rw-r--r--src/share/utf8/charset.c2
-rw-r--r--src/share/utf8/utf8.c22
-rw-r--r--src/test_seeking/main.c4
7 files changed, 22 insertions, 20 deletions
diff --git a/include/share/endswap.h b/include/share/endswap.h
index b9beaffc..e71f0f6c 100644
--- a/include/share/endswap.h
+++ b/include/share/endswap.h
@@ -39,7 +39,7 @@
#define ENDSWAP_32(x) (_byteswap_ulong (x))
-#elif HAVE_BYTESWAP_H /* Linux */
+#elif defined HAVE_BYTESWAP_H /* Linux */
#include <byteswap.h>
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index 6c180fe4..bc30dcac 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -2406,6 +2406,10 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const
FLAC__StreamEncoderWriteStatus status;
FLAC__uint64 output_position = 0;
+#if FLAC__HAS_OGG == 0
+ (void)is_last_block;
+#endif
+
/* FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED just means we didn't get the offset; no error */
if(encoder->private_->tell_callback && encoder->private_->tell_callback(encoder, &output_position, encoder->private_->client_data) == FLAC__STREAM_ENCODER_TELL_STATUS_ERROR) {
encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR;
diff --git a/src/metaflac/main.c b/src/metaflac/main.c
index 03e42c7a..4cfe754a 100644
--- a/src/metaflac/main.c
+++ b/src/metaflac/main.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
#endif
#ifdef _WIN32
if (get_utf8_argv(&argc, &argv) != 0) {
- fprintf(stderr, "%ERROR: failed to convert command line parameters to UTF-8\n");
+ fputs("ERROR: failed to convert command line parameters to UTF-8\n", stderr);
return 1;
}
#endif
diff --git a/src/share/getopt/getopt.c b/src/share/getopt/getopt.c
index f25a830c..968bf2f5 100644
--- a/src/share/getopt/getopt.c
+++ b/src/share/getopt/getopt.c
@@ -220,13 +220,11 @@ static char *posixly_correct;
whose names are inconsistent. */
#ifndef getenv
-extern char *getenv ();
+extern char *getenv (const char * name);
#endif
static char *
-my_index (str, chr)
- const char *str;
- int chr;
+my_index (const char *str, int chr)
{
while (*str)
{
diff --git a/src/share/utf8/charset.c b/src/share/utf8/charset.c
index 3ea20f7d..cfde5621 100644
--- a/src/share/utf8/charset.c
+++ b/src/share/utf8/charset.c
@@ -359,7 +359,7 @@ static struct inverse_map *make_inverse_map(const unsigned short *from)
return to;
}
-int wctomb_8bit(void *map1, char *s, int wc1)
+static int wctomb_8bit(void *map1, char *s, int wc1)
{
struct map *map = map1;
unsigned short wc = wc1;
diff --git a/src/share/utf8/utf8.c b/src/share/utf8/utf8.c
index 25dd1a4b..beb815af 100644
--- a/src/share/utf8/utf8.c
+++ b/src/share/utf8/utf8.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -164,13 +164,13 @@ int utf8_encode(const char *from, char **to)
return -1;
unicode = safe_calloc_((size_t)wchars + 1, sizeof(unsigned short));
- if(unicode == NULL)
+ if(unicode == NULL)
{
fprintf(stderr, "Out of memory processing string to UTF8\n");
return -1;
}
- err = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from,
+ err = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from,
strlen(from), unicode, wchars);
if(err != wchars)
{
@@ -179,10 +179,10 @@ int utf8_encode(const char *from, char **to)
return -1;
}
- /* On NT-based windows systems, we could use WideCharToMultiByte(), but
+ /* On NT-based windows systems, we could use WideCharToMultiByte(), but
* MS doesn't actually have a consistent API across win32.
*/
- *to = make_utf8_string(unicode);
+ *to = (char*)make_utf8_string(unicode);
free(unicode);
return 0;
@@ -193,11 +193,11 @@ int utf8_decode(const char *from, char **to)
wchar_t *unicode;
int chars, err;
- /* On NT-based windows systems, we could use MultiByteToWideChar(CP_UTF8), but
+ /* On NT-based windows systems, we could use MultiByteToWideChar(CP_UTF8), but
* MS doesn't actually have a consistent API across win32.
*/
- unicode = make_unicode_string(from);
- if(unicode == NULL)
+ unicode = make_unicode_string((const unsigned char*)from);
+ if(unicode == NULL)
{
fprintf(stderr, "Out of memory processing string from UTF8 to UNICODE16\n");
return -1;
@@ -217,14 +217,14 @@ int utf8_decode(const char *from, char **to)
}
*to = safe_calloc_((size_t)chars + 1, sizeof(unsigned char));
- if(*to == NULL)
+ if(*to == NULL)
{
fprintf(stderr, "Out of memory processing string to local charset\n");
free(unicode);
return -1;
}
- err = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode,
+ err = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode,
-1, *to, chars, NULL, NULL);
if(err != chars)
{
diff --git a/src/test_seeking/main.c b/src/test_seeking/main.c
index 3dd707e4..e68a41bb 100644
--- a/src/test_seeking/main.c
+++ b/src/test_seeking/main.c
@@ -48,9 +48,9 @@ typedef struct {
static FLAC__bool stop_signal_ = false;
-static void our_sigint_handler_(int signal)
+static void our_sigint_handler_(int signum)
{
- (void)signal;
+ (void)signum;
printf("(caught SIGINT) ");
fflush(stdout);
stop_signal_ = true;