[MPlayer-dev-eng] [PATCH] warning fixes
Dominik 'Rathann' Mierzejewski
dominik at rangers.eu.org
Sun May 14 21:25:53 CEST 2006
Hello.
The first patch fixes the following:
codec-cfg.c:1036: warning: pointer targets in passing argument 1 of ‘print_int_array’ differ in signedness
codec-cfg.c:1039: warning: pointer targets in passing argument 1 of ‘print_int_array’ differ in signedness
codec-cfg.c:1042: warning: pointer targets in passing argument 1 of ‘print_int_array’ differ in signedness
codec-cfg.c:1048: warning: pointer targets in passing argument 1 of ‘print_int_array’ differ in signedness
subreader.c:1333: warning: assignment discards qualifiers from pointer target type
dvbin.c:843: warning: assignment from incompatible pointer type
ad_hwac3.c:115: warning: initialization from incompatible pointer type
The second fixes printf format warnings.
--
MPlayer developer and RPMs maintainer: http://rpm.greysector.net/mplayer/
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
--- MPlayer-20060514/libmpcodecs/ad_hwac3.c.warn 2005-11-20 01:06:16.000000000 +0100
+++ MPlayer-20060514/libmpcodecs/ad_hwac3.c 2006-05-14 20:05:35.000000000 +0200
@@ -112,8 +112,8 @@
static int init(sh_audio_t *sh_audio)
{
/* Dolby AC3 passthrough:*/
- sample_t *a52_samples = a52_init(0);
- if(a52_samples == NULL)
+ a52_state_t *a52_state = a52_init(0);
+ if(a52_state == NULL)
{
mp_msg(MSGT_DECAUDIO, MSGL_ERR, "A52 init failed\n");
return 0;
--- MPlayer-20060514/libmpdemux/frequencies.c.warn 2006-04-03 21:41:20.000000000 +0200
+++ MPlayer-20060514/libmpdemux/frequencies.c 2006-05-14 20:05:35.000000000 +0200
@@ -1165,5 +1165,5 @@
};
int chantab = 5;
-struct CHANLIST *chanlist = europe_west;
+const struct CHANLIST *chanlist = europe_west;
int chancount = CHAN_COUNT(europe_west);
--- MPlayer-20060514/libmpdemux/frequencies.h.warn 2006-04-03 21:41:20.000000000 +0200
+++ MPlayer-20060514/libmpdemux/frequencies.h 2006-05-14 20:05:35.000000000 +0200
@@ -107,5 +107,5 @@
//extern struct STRTAB chanlist_names[];
extern int chantab;
-extern struct CHANLIST *chanlist;
+extern const struct CHANLIST *chanlist;
extern int chancount;
--- MPlayer-20060514/libmpdemux/dvbin.c.warn 2006-05-13 21:41:33.000000000 +0200
+++ MPlayer-20060514/libmpdemux/dvbin.c 2006-05-14 20:05:35.000000000 +0200
@@ -778,8 +778,8 @@
int i, fd, type, size;
char filename[30], *conf_file, *name;
dvb_channels_list *list;
- dvb_card_config_t *cards = NULL;
- dvb_config_t *conf = NULL, *tmp;
+ dvb_card_config_t *cards = NULL, *tmp;
+ dvb_config_t *conf = NULL;
if(dvb_config != NULL)
return dvb_config;
--- MPlayer-20060514/subreader.c.warn 2006-04-24 22:17:51.000000000 +0200
+++ MPlayer-20060514/subreader.c 2006-05-14 20:05:35.000000000 +0200
@@ -1325,7 +1325,7 @@
mp_msg(MSGT_SUBREADER, MSGL_V, "\n");
for (i = 0; i < langcnt; i++) {
- char *tmp;
+ const char *tmp;
if (strcasecmp(languages[i], preferred_language) != 0) continue;
analyser = enca_analyser_alloc(languages[i]);
--- MPlayer-20060514/codec-cfg.c.warn 2006-04-03 21:41:14.000000000 +0200
+++ MPlayer-20060514/codec-cfg.c 2006-05-14 20:24:25.000000000 +0200
@@ -964,7 +964,7 @@
}
}
-static void print_int_array(const int* a, int size)
+static void print_int_array(const unsigned* a, int size)
{
printf("{ ");
while (size--)
-------------- next part --------------
--- MPlayer-20060514/libmpcodecs/ve_vfw.c.printf 2006-04-02 21:19:39.000000000 +0200
+++ MPlayer-20060514/libmpcodecs/ve_vfw.c 2006-05-14 18:16:39.000000000 +0200
@@ -130,21 +130,21 @@
// if( mp_msg_test(MSGT_WIN32,MSGL_V) ) {
printf("Starting compression:\n");
printf(" Input format:\n");
- printf(" biSize %d\n", input_bih->biSize);
- printf(" biWidth %d\n", input_bih->biWidth);
- printf(" biHeight %d\n", input_bih->biHeight);
+ printf(" biSize %ld\n", input_bih->biSize);
+ printf(" biWidth %ld\n", input_bih->biWidth);
+ printf(" biHeight %ld\n", input_bih->biHeight);
printf(" biPlanes %d\n", input_bih->biPlanes);
printf(" biBitCount %d\n", input_bih->biBitCount);
- printf(" biCompression 0x%x ('%.4s')\n", input_bih->biCompression, (char *)&input_bih->biCompression);
- printf(" biSizeImage %d\n", input_bih->biSizeImage);
+ printf(" biCompression 0x%lx ('%.4s')\n", input_bih->biCompression, (char *)&input_bih->biCompression);
+ printf(" biSizeImage %ld\n", input_bih->biSizeImage);
printf(" Output format:\n");
- printf(" biSize %d\n", output_bih->biSize);
- printf(" biWidth %d\n", output_bih->biWidth);
- printf(" biHeight %d\n", output_bih->biHeight);
+ printf(" biSize %ld\n", output_bih->biSize);
+ printf(" biWidth %ld\n", output_bih->biWidth);
+ printf(" biHeight %ld\n", output_bih->biHeight);
printf(" biPlanes %d\n", output_bih->biPlanes);
printf(" biBitCount %d\n", output_bih->biBitCount);
- printf(" biCompression 0x%x ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression);
- printf(" biSizeImage %d\n", output_bih->biSizeImage);
+ printf(" biCompression 0x%lx ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression);
+ printf(" biSizeImage %ld\n", output_bih->biSizeImage);
// }
output_bih->biWidth=input_bih->biWidth;
--- MPlayer-20060514/libmpcodecs/ve_xvid.c.printf 2006-03-26 23:00:43.000000000 +0200
+++ MPlayer-20060514/libmpcodecs/ve_xvid.c 2006-05-14 18:16:39.000000000 +0200
@@ -173,7 +173,7 @@
fp->mux->bih->biHeight = height;
fp->mux->bih->biSizeImage = fp->mux->bih->biWidth * fp->mux->bih->biHeight * 3;
fp->mux->aspect = (float)d_width/d_height;
- mp_msg(MSGT_MENCODER,MSGL_INFO,"videocodec: XViD (%dx%d fourcc=%x [%.4s])\n",
+ mp_msg(MSGT_MENCODER,MSGL_INFO,"videocodec: XViD (%dx%d fourcc=%lx [%.4s])\n",
width, height, fp->mux->bih->biCompression, (char *)&fp->mux->bih->biCompression);
// {min,max}_{i,p}quantizer parsing & validation
--- MPlayer-20060514/libmpdemux/parse_es.c.printf 2006-01-17 22:35:50.000000000 +0100
+++ MPlayer-20060514/libmpdemux/parse_es.c 2006-05-14 18:16:39.000000000 +0200
@@ -26,7 +26,7 @@
int skipped=0;
if (!demux_pattern_3(ds, NULL, MAX_SYNCLEN, &skipped, 0x100)) {
if (skipped == MAX_SYNCLEN)
- mp_msg(MSGT_DEMUXER, MSGL_ERR, "parse_es: could not sync video stream!\n", skipped);
+ mp_msg(MSGT_DEMUXER, MSGL_ERR, "parse_es: could not sync video stream!\n");
goto eof_out;
}
next_nal = demux_getc(ds);
--- MPlayer-20060514/libmpdemux/aviprint.c.printf 2006-03-27 23:57:53.000000000 +0200
+++ MPlayer-20060514/libmpdemux/aviprint.c 2006-05-14 19:47:19.000000000 +0200
@@ -16,7 +16,7 @@
//#include "stheader.h"
void print_avih_flags(MainAVIHeader *h, int verbose_level){
- mp_msg(MSGT_HEADER, verbose_level, "MainAVIHeader.dwFlags: (%ld)%s%s%s%s%s%s\n",h->dwFlags,
+ mp_msg(MSGT_HEADER, verbose_level, "MainAVIHeader.dwFlags: (%d)%s%s%s%s%s%s\n",h->dwFlags,
(h->dwFlags&AVIF_HASINDEX)?" HAS_INDEX":"",
(h->dwFlags&AVIF_MUSTUSEINDEX)?" MUST_USE_INDEX":"",
(h->dwFlags&AVIF_ISINTERLEAVED)?" IS_INTERLEAVED":"",
@@ -28,28 +28,28 @@
void print_avih(MainAVIHeader *h, int verbose_level){
mp_msg(MSGT_HEADER, verbose_level, "======= AVI Header =======\n");
- mp_msg(MSGT_HEADER, verbose_level, "us/frame: %ld (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame);
- mp_msg(MSGT_HEADER, verbose_level, "max bytes/sec: %ld\n",h->dwMaxBytesPerSec);
- mp_msg(MSGT_HEADER, verbose_level, "padding: %ld\n",h->dwPaddingGranularity);
+ mp_msg(MSGT_HEADER, verbose_level, "us/frame: %d (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame);
+ mp_msg(MSGT_HEADER, verbose_level, "max bytes/sec: %d\n",h->dwMaxBytesPerSec);
+ mp_msg(MSGT_HEADER, verbose_level, "padding: %d\n",h->dwPaddingGranularity);
print_avih_flags(h, verbose_level);
- mp_msg(MSGT_HEADER, verbose_level, "frames total: %ld initial: %ld\n",h->dwTotalFrames,h->dwInitialFrames);
- mp_msg(MSGT_HEADER, verbose_level, "streams: %ld\n",h->dwStreams);
- mp_msg(MSGT_HEADER, verbose_level, "Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
- mp_msg(MSGT_HEADER, verbose_level, "Size: %ld x %ld\n",h->dwWidth,h->dwHeight);
+ mp_msg(MSGT_HEADER, verbose_level, "frames total: %d initial: %d\n",h->dwTotalFrames,h->dwInitialFrames);
+ mp_msg(MSGT_HEADER, verbose_level, "streams: %d\n",h->dwStreams);
+ mp_msg(MSGT_HEADER, verbose_level, "Suggested BufferSize: %d\n",h->dwSuggestedBufferSize);
+ mp_msg(MSGT_HEADER, verbose_level, "Size: %d x %d\n",h->dwWidth,h->dwHeight);
mp_msg(MSGT_HEADER, verbose_level, "==========================\n");
}
void print_strh(AVIStreamHeader *h, int verbose_level){
mp_msg(MSGT_HEADER, verbose_level, "====== STREAM Header =====\n");
mp_msg(MSGT_HEADER, verbose_level, "Type: %.4s FCC: %.4s (%X)\n",(char *)&h->fccType,(char *)&h->fccHandler,(unsigned int)h->fccHandler);
- mp_msg(MSGT_HEADER, verbose_level, "Flags: %ld\n",h->dwFlags);
+ mp_msg(MSGT_HEADER, verbose_level, "Flags: %d\n",h->dwFlags);
mp_msg(MSGT_HEADER, verbose_level, "Priority: %d Language: %d\n",h->wPriority,h->wLanguage);
- mp_msg(MSGT_HEADER, verbose_level, "InitialFrames: %ld\n",h->dwInitialFrames);
- mp_msg(MSGT_HEADER, verbose_level, "Rate: %ld/%ld = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale);
- mp_msg(MSGT_HEADER, verbose_level, "Start: %ld Len: %ld\n",h->dwStart,h->dwLength);
- mp_msg(MSGT_HEADER, verbose_level, "Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize);
- mp_msg(MSGT_HEADER, verbose_level, "Quality %ld\n",h->dwQuality);
- mp_msg(MSGT_HEADER, verbose_level, "Sample size: %ld\n",h->dwSampleSize);
+ mp_msg(MSGT_HEADER, verbose_level, "InitialFrames: %d\n",h->dwInitialFrames);
+ mp_msg(MSGT_HEADER, verbose_level, "Rate: %d/%d = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale);
+ mp_msg(MSGT_HEADER, verbose_level, "Start: %d Len: %d\n",h->dwStart,h->dwLength);
+ mp_msg(MSGT_HEADER, verbose_level, "Suggested BufferSize: %d\n",h->dwSuggestedBufferSize);
+ mp_msg(MSGT_HEADER, verbose_level, "Quality %d\n",h->dwQuality);
+ mp_msg(MSGT_HEADER, verbose_level, "Sample size: %d\n",h->dwSampleSize);
mp_msg(MSGT_HEADER, verbose_level, "==========================\n");
}
@@ -57,15 +57,15 @@
mp_msg(MSGT_HEADER, verbose_level, "======= WAVE Format =======\n");
mp_msg(MSGT_HEADER, verbose_level, "Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
mp_msg(MSGT_HEADER, verbose_level, "Channels: %d\n",h->nChannels);
- mp_msg(MSGT_HEADER, verbose_level, "Samplerate: %ld\n",h->nSamplesPerSec);
- mp_msg(MSGT_HEADER, verbose_level, "avg byte/sec: %ld\n",h->nAvgBytesPerSec);
+ mp_msg(MSGT_HEADER, verbose_level, "Samplerate: %d\n",h->nSamplesPerSec);
+ mp_msg(MSGT_HEADER, verbose_level, "avg byte/sec: %d\n",h->nAvgBytesPerSec);
mp_msg(MSGT_HEADER, verbose_level, "Block align: %d\n",h->nBlockAlign);
mp_msg(MSGT_HEADER, verbose_level, "bits/sample: %d\n",h->wBitsPerSample);
mp_msg(MSGT_HEADER, verbose_level, "cbSize: %d\n",h->cbSize);
if(h->wFormatTag==0x55 && h->cbSize>=12){
MPEGLAYER3WAVEFORMAT* h2=(MPEGLAYER3WAVEFORMAT *)h;
mp_msg(MSGT_HEADER, verbose_level, "mp3.wID=%d\n",h2->wID);
- mp_msg(MSGT_HEADER, verbose_level, "mp3.fdwFlags=0x%lX\n",h2->fdwFlags);
+ mp_msg(MSGT_HEADER, verbose_level, "mp3.fdwFlags=0x%X\n",h2->fdwFlags);
mp_msg(MSGT_HEADER, verbose_level, "mp3.nBlockSize=%d\n",h2->nBlockSize);
mp_msg(MSGT_HEADER, verbose_level, "mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock);
mp_msg(MSGT_HEADER, verbose_level, "mp3.nCodecDelay=%d\n",h2->nCodecDelay);
@@ -138,7 +138,7 @@
for(i=0;i<idx_size;i++){
int id=avi_stream_id(idx[i].ckid);
if(id<0 || id>255) id=255;
- mp_msg(MSGT_HEADER, verbose_level, "%5d: %.4s %4X %016llX len:%6ld pos:%7d->%7.3f %7d->%7.3f\n",i,
+ mp_msg(MSGT_HEADER, verbose_level, "%5d: %.4s %4X %016llX len:%6d pos:%7d->%7.3f %7d->%7.3f\n",i,
(char *)&idx[i].ckid,
(unsigned int)idx[i].dwFlags&0xffff,
(uint64_t)AVI_IDX_OFFSET(&idx[i]),
More information about the MPlayer-dev-eng
mailing list