mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
Fix a bunch of compiler warnings (mainly MinGW).
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#define ENDSWAP_32(x) (_byteswap_ulong (x))
|
#define ENDSWAP_32(x) (_byteswap_ulong (x))
|
||||||
|
|
||||||
#elif HAVE_BYTESWAP_H /* Linux */
|
#elif defined HAVE_BYTESWAP_H /* Linux */
|
||||||
|
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
|
|
||||||
|
|||||||
@@ -2406,6 +2406,10 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const
|
|||||||
FLAC__StreamEncoderWriteStatus status;
|
FLAC__StreamEncoderWriteStatus status;
|
||||||
FLAC__uint64 output_position = 0;
|
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 */
|
/* 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) {
|
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;
|
encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (get_utf8_argv(&argc, &argv) != 0) {
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -220,13 +220,11 @@ static char *posixly_correct;
|
|||||||
whose names are inconsistent. */
|
whose names are inconsistent. */
|
||||||
|
|
||||||
#ifndef getenv
|
#ifndef getenv
|
||||||
extern char *getenv ();
|
extern char *getenv (const char * name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
my_index (str, chr)
|
my_index (const char *str, int chr)
|
||||||
const char *str;
|
|
||||||
int chr;
|
|
||||||
{
|
{
|
||||||
while (*str)
|
while (*str)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ static struct inverse_map *make_inverse_map(const unsigned short *from)
|
|||||||
return to;
|
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;
|
struct map *map = map1;
|
||||||
unsigned short wc = wc1;
|
unsigned short wc = wc1;
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ int utf8_encode(const char *from, char **to)
|
|||||||
/* 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.
|
* MS doesn't actually have a consistent API across win32.
|
||||||
*/
|
*/
|
||||||
*to = make_utf8_string(unicode);
|
*to = (char*)make_utf8_string(unicode);
|
||||||
|
|
||||||
free(unicode);
|
free(unicode);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -196,7 +196,7 @@ int utf8_decode(const char *from, char **to)
|
|||||||
/* 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.
|
* MS doesn't actually have a consistent API across win32.
|
||||||
*/
|
*/
|
||||||
unicode = make_unicode_string(from);
|
unicode = make_unicode_string((const unsigned char*)from);
|
||||||
if(unicode == NULL)
|
if(unicode == NULL)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Out of memory processing string from UTF8 to UNICODE16\n");
|
fprintf(stderr, "Out of memory processing string from UTF8 to UNICODE16\n");
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ typedef struct {
|
|||||||
|
|
||||||
static FLAC__bool stop_signal_ = false;
|
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) ");
|
printf("(caught SIGINT) ");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
stop_signal_ = true;
|
stop_signal_ = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user