compiler warning fixes

based on patch by Dominik Mierzejewski <dominik@rangers.eu.org>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8452 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-12-14 17:56:35 +00:00
parent bbeb54d80a
commit b987127e0e
20 changed files with 86 additions and 61 deletions

View File

@ -274,7 +274,7 @@ void render() {
#ifndef NEW_DESC
fprintf(f, "charspace %i\n", -2*padding);
#endif
fprintf(f, "height %i\n", f266ToInt(face->size->metrics.height));
fprintf(f, "height %li\n", f266ToInt(face->size->metrics.height));
#ifdef NEW_DESC
fprintf(f, "ascender %i\n", f266CeilToInt(face->size->metrics.ascender));
fprintf(f, "descender %i\n", f266FloorToInt(face->size->metrics.descender));
@ -303,7 +303,7 @@ void render() {
else {
glyph_index = FT_Get_Char_Index(face, uni_charmap ? character:code);
if (glyph_index==0) {
WARNING("Glyph for char 0x%02x|U+%04X|%c not found.", code, character,
WARNING("Glyph for char 0x%02lx|U+%04lX|%c not found.", code, character,
code<' '||code>255 ? '.':code);
continue;
}
@ -312,7 +312,7 @@ void render() {
// load glyph
error = FT_Load_Glyph(face, glyph_index, load_flags);
if (error) {
WARNING("FT_Load_Glyph 0x%02x (char 0x%02x|U+%04X) failed.", glyph_index, code, character);
WARNING("FT_Load_Glyph 0x%02x (char 0x%02lx|U+%04lX) failed.", glyph_index, code, character);
continue;
}
slot = face->glyph;
@ -321,7 +321,7 @@ void render() {
if (slot->format != ft_glyph_format_bitmap) {
error = FT_Render_Glyph(slot, ft_render_mode_normal);
if (error) {
WARNING("FT_Render_Glyph 0x%04x (char 0x%02x|U+%04X) failed.", glyph_index, code, character);
WARNING("FT_Render_Glyph 0x%04x (char 0x%02lx|U+%04lX) failed.", glyph_index, code, character);
continue;
}
}
@ -329,7 +329,7 @@ void render() {
// extract glyph image
error = FT_Get_Glyph(slot, (FT_Glyph*)&glyph);
if (error) {
WARNING("FT_Get_Glyph 0x%04x (char 0x%02x|U+%04X) failed.", glyph_index, code, character);
WARNING("FT_Get_Glyph 0x%04x (char 0x%02lx|U+%04lX) failed.", glyph_index, code, character);
continue;
}
glyphs[glyphs_count++] = (FT_Glyph)glyph;
@ -365,7 +365,7 @@ void render() {
pen_xa = pen_x + f266ToInt(slot->advance.x) + 2*padding;
/* font.desc */
fprintf(f, "0x%04x %i %i;\tU+%04X|%c\n", unicode_desc ? character:code,
fprintf(f, "0x%04lx %i %i;\tU+%04lX|%c\n", unicode_desc ? character:code,
pen_x, // bitmap start
pen_xa-1, // bitmap end
character, code<' '||code>255 ? '.':code);

View File

@ -392,8 +392,8 @@ imdct_do_512(sample_t data[],sample_t delay[], sample_t bias)
#endif
#include "srfftp_3dnow.h"
const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = { 0x00000000UL, 0x80000000UL };
const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = { 0x80000000UL, 0x00000000UL };
const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }};
const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }};
const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 };
#undef HAVE_3DNOWEX

View File

@ -48,7 +48,7 @@
// Macro to add data to circular que
#define ADDQUE(xi,xq,in)\
xq[xi]=xq[xi+L]=(*in);\
xi=(--xi)&(L-1);
xi=(xi-1)&(L-1);

View File

@ -171,7 +171,7 @@ static int play(){
if(pl_resample.up==pl_resample.dn){
register int16_t* in = ((int16_t*)ao_plugin_data.data);
register int16_t* end = in+ao_plugin_data.len/2;
while(in < end) *in=(*in++)>>1;
while(in < end) *(in++)>>=1;
return 1;
}
if(pl_resample.up>pl_resample.dn)

View File

@ -10,6 +10,10 @@
#include "ad_internal.h"
#include "bswap.h"
#ifdef USE_WIN32DLL
#include "ldt_keeper.h"
#endif
static ad_info_t info = {
"QuickTime Audio Decoder",
"qtaudio",

View File

@ -491,7 +491,8 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
for (row = 0; row < height; row++) {
pixel_ptr = row * width * 3;
yq = encoded[pixel_ptr++];
uqvq = encoded[pixel_ptr++] + (encoded[pixel_ptr++] << 8);
uqvq = encoded[pixel_ptr++];
uqvq+=(encoded[pixel_ptr++] << 8);
for (col = 1; col < width; col++) {
encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
uqvq -= (encoded[pixel_ptr+1] | (encoded[pixel_ptr+2]<<8));
@ -505,7 +506,8 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags)
for (row = 0; row < height; row++) {
pixel_ptr = row * width * 3;
yq = encoded[pixel_ptr++];
uqvq = encoded[pixel_ptr++] + (encoded[pixel_ptr++] << 8);
uqvq = encoded[pixel_ptr++];
uqvq+=(encoded[pixel_ptr++] << 8);
for (col = 1; col < width; col++) {
encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
uqvq -= (encoded[pixel_ptr+1] | (encoded[pixel_ptr+2]<<8));

View File

@ -8,6 +8,10 @@
#include "mp_msg.h"
#include "vd_internal.h"
#ifdef USE_WIN32DLL
#include "ldt_keeper.h"
#endif
static vd_info_t info = {
"Quicktime Video decoder",
"qtvideo",
@ -100,20 +104,20 @@ static int init(sh_video_t *sh){
handler = LoadLibraryA("qtmlClient.dll");
InitializeQTML = GetProcAddress(handler, "InitializeQTML");
EnterMovies = GetProcAddress(handler, "EnterMovies");
FindNextComponent = GetProcAddress(handler, "FindNextComponent");
CountComponents = GetProcAddress(handler, "CountComponents");
GetComponentInfo = GetProcAddress(handler, "GetComponentInfo");
OpenComponent = GetProcAddress(handler, "OpenComponent");
ImageCodecInitialize = GetProcAddress(handler, "ImageCodecInitialize");
ImageCodecGetCodecInfo = GetProcAddress(handler, "ImageCodecGetCodecInfo");
ImageCodecBeginBand = GetProcAddress(handler, "ImageCodecBeginBand");
ImageCodecPreDecompress = GetProcAddress(handler, "ImageCodecPreDecompress");
ImageCodecBandDecompress = GetProcAddress(handler, "ImageCodecBandDecompress");
GetGWorldPixMap = GetProcAddress(handler, "GetGWorldPixMap");
QTNewGWorldFromPtr = GetProcAddress(handler, "QTNewGWorldFromPtr");
NewHandleClear = GetProcAddress(handler, "NewHandleClear");
InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML");
EnterMovies = (OSErr (*)(void))GetProcAddress(handler, "EnterMovies");
FindNextComponent = (Component (*)(Component,ComponentDescription*))GetProcAddress(handler, "FindNextComponent");
CountComponents = (long (*)(ComponentDescription*))GetProcAddress(handler, "CountComponents");
GetComponentInfo = (OSErr (*)(Component,ComponentDescription*,Handle,Handle,Handle))GetProcAddress(handler, "GetComponentInfo");
OpenComponent = (ComponentInstance (*)(Component))GetProcAddress(handler, "OpenComponent");
ImageCodecInitialize = (ComponentResult (*)(ComponentInstance,ImageSubCodecDecompressCapabilities *))GetProcAddress(handler, "ImageCodecInitialize");
ImageCodecGetCodecInfo = (ComponentResult (*)(ComponentInstance,CodecInfo *))GetProcAddress(handler, "ImageCodecGetCodecInfo");
ImageCodecBeginBand = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *,ImageSubCodecDecompressRecord *,long))GetProcAddress(handler, "ImageCodecBeginBand");
ImageCodecPreDecompress = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *))GetProcAddress(handler, "ImageCodecPreDecompress");
ImageCodecBandDecompress = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *))GetProcAddress(handler, "ImageCodecBandDecompress");
GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");
QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr");
NewHandleClear = (OSErr(*)(Size))GetProcAddress(handler, "NewHandleClear");
// = GetProcAddress(handler, "");
if(!InitializeQTML || !EnterMovies || !FindNextComponent || !ImageCodecBandDecompress){
@ -371,7 +375,7 @@ if(!codec_inited){
if((int)sh->context==0x73797639){ // Sorenson 16-bit YUV -> std YVU9
short *src0=((char*)decpar.dstPixMap.baseAddr+0x20);
short *src0=(short *)((char*)decpar.dstPixMap.baseAddr+0x20);
for(i=0;i<mpi->h;i++){
int x;

View File

@ -1,5 +1,3 @@
#define USE_QTX_CODECS
// QuickTime MOV file parser by A'rpi
// additional work by Atmos
// based on TOOLS/movinfo.c by A'rpi & Al3x

View File

@ -4,6 +4,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "../cfgparser.h"

View File

@ -336,9 +336,10 @@ inline static void vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){
if (sub_utf8){
if ((c & 0xe0) == 0xc0) /* 2 bytes U+00080..U+0007FF*/
c = (c & 0x1f)<<6 | (t[++j] & 0x3f);
else if((c & 0xf0) == 0xe0)/* 3 bytes U+00800..U+00FFFF*/
c = ((c & 0x0f)<<6 |
(t[++j] & 0x3f))<<6 | (t[++j] & 0x3f);
else if((c & 0xf0) == 0xe0){ /* 3 bytes U+00800..U+00FFFF*/
c = (((c & 0x0f)<<6) | (t[++j] & 0x3f))<<6;
c |= (t[++j] & 0x3f);
}
} else if (sub_unicode)
c = (c<<8) + t[++j];
}

View File

@ -10,6 +10,7 @@
#include "except.h"
#else
#include "libwin32.h"
#include "ldt_keeper.h"
#endif
#include "DMO_Filter.h"
@ -33,6 +34,7 @@ struct _DMO_AudioDecoder
#define __MODULE__ "DirectShow audio decoder"
typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**);
extern void print_wave_header(WAVEFORMATEX *h);
DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf,int out_channels)
//DMO_AudioDecoder * DMO_AudioDecoder_Create(const CodecInfo * info, const WAVEFORMATEX* wf)
@ -83,8 +85,8 @@ DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX
this->m_sDestType.cbFormat=18; //pWF->cbSize;
this->m_sDestType.pbFormat=this->m_sVhdr2;
print_wave_header(this->m_sVhdr);
print_wave_header(this->m_sVhdr2);
print_wave_header((WAVEFORMATEX *)this->m_sVhdr);
print_wave_header((WAVEFORMATEX *)this->m_sVhdr2);
this->m_pDMO_Filter = DMO_FilterCreate(dllname, guid, &this->m_sOurType, &this->m_sDestType);
if( !this->m_pDMO_Filter ) {
@ -109,8 +111,8 @@ int DMO_AudioDecoder_Convert(DMO_AudioDecoder *this, const void* in_data, unsign
{
DMO_OUTPUT_DATA_BUFFER db;
CMediaBuffer* bufferin;
unsigned int written = 0;
unsigned int read = 0;
unsigned long written = 0;
unsigned long read = 0;
int r = 0;
if (!in_data || !out_data)

View File

@ -8,6 +8,7 @@
#include "guids.h"
#include "interfaces.h"
#include "registry.h"
#include "../ldt_keeper.h"
#ifndef NOAVIFILE_HEADERS
#include "videodecoder.h"
@ -234,7 +235,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE
if (!result)
{
this->m_Caps = (this->m_Caps | c->cap);
printf("%.4s ", &c->fcc);
printf("%.4s ", (char*) &c->fcc);
}
}
printf("\n");

View File

@ -17,6 +17,7 @@
#include "registry.h"
#include "ldt_keeper.h"
#include "driver.h"
#include "ext.h"
extern char* def_path;

View File

@ -24,6 +24,7 @@ struct _DS_AudioDecoder
};
#include "DS_AudioDecoder.h"
#include "../ldt_keeper.h"
#include <string.h>
#include <stdio.h>

View File

@ -35,6 +35,7 @@ struct _DS_VideoDecoder
#include "DS_VideoDecoder.h"
#include "../wine/winerror.h"
#include "../ldt_keeper.h"
#ifndef NOAVIFILE_HEADERS
#define VFW_E_NOT_RUNNING 0x80040226
@ -66,7 +67,7 @@ typedef struct _ct ct;
struct _ct {
unsigned int bits;
fourcc_t fcc;
GUID *subtype;
const GUID *subtype;
int cap;
};
@ -224,7 +225,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD
if (!result)
{
this->m_Caps = (this->m_Caps | c->cap);
printf("%.4s ", &c->fcc);
printf("%.4s ", (char *)&c->fcc);
}
}
printf("\n");

View File

@ -430,10 +430,10 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
// dispatch_addr = GetProcAddress(wm->module, "theQuickTimeDispatcher", TRUE);
dispatch_addr = PE_FindExportedFunction(wm, "theQuickTimeDispatcher", TRUE);
if (dispatch_addr == 0x62924c30)
if (dispatch_addr == (void *)0x62924c30)
{
fprintf(stderr, "QuickTime5 DLLs found\n");
ptr = 0x62b75ca4; // dispatch_ptr
ptr = (void **)0x62b75ca4; // dispatch_ptr
for (i=0;i<5;i++) ((char*)0x6299e842)[i]=0x90; // make_new_region ?
for (i=0;i<28;i++) ((char*)0x6299e86d)[i]=0x90; // call__call_CreateCompatibleDC ?
for (i=0;i<5;i++) ((char*)0x6299e898)[i]=0x90; // jmp_to_call_loadbitmap ?
@ -458,10 +458,10 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
((char *)0x6288e0ae)[0] = 0xc3; // font/dc remover
for (i=0;i<24;i++) ((char*)0x6287a1ad)[i]=0x90; // destroy window
#endif
} else if (dispatch_addr == 0x6693b330)
} else if (dispatch_addr == (void *)0x6693b330)
{
fprintf(stderr, "QuickTime6 DLLs found\n");
ptr = 0x66bb9524; // dispatcher_ptr
ptr = (void **)0x66bb9524; // dispatcher_ptr
for (i=0;i<5;i++) ((char *)0x66a730cc)[i]=0x90; // make_new_region
for (i=0;i<28;i++) ((char *)0x66a730f7)[i]=0x90; // call__call_CreateCompatibleDC
for (i=0;i<5;i++) ((char *)0x66a73122)[i]=0x90; // jmp_to_call_loadbitmap
@ -469,9 +469,9 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
for (i=0;i<96;i++) ((char *)0x66aac852)[i]=0x90; // disable threads
} else
{
fprintf(stderr, "Unsupported QuickTime version (0x%x)\n",
fprintf(stderr, "Unsupported QuickTime version (%p)\n",
dispatch_addr);
return NULL;
return 0;
}
fprintf(stderr,"QuickTime.qts patched!!! old entry=%p\n",ptr[0]);
@ -724,15 +724,15 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_
// memory management:
case 0x150011: //NewPtrClear
case 0x150012: //NewPtrSysClear
reg->eax=malloc(((u_int32_t *)stack_base)[1]);
memset(reg->eax,0,((u_int32_t *)stack_base)[1]);
reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
memset((void *)reg->eax,0,((u_int32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
#endif
return 1;
case 0x15000F: //NewPtr
case 0x150010: //NewPtrSys
reg->eax=malloc(((u_int32_t *)stack_base)[1]);
reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
#endif
@ -741,7 +741,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_
if(((u_int32_t *)stack_base)[1]>=0x60000000)
printf("WARNING! Invalid Ptr handle!\n");
else
free(((u_int32_t *)stack_base)[1]);
free((void *)((u_int32_t *)stack_base)[1]);
reg->eax=0;
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
@ -956,7 +956,7 @@ FARPROC MODULE_GetProcAddress(
report_entry = report_func;
report_ret = report_func_ret;
wrapper_target=retproc;
retproc=wrapper;
retproc=(FARPROC)wrapper;
}
}

View File

@ -40,6 +40,7 @@ for DLL to know too much about its environment.
#include "registry.h"
#include "loader.h"
#include "com.h"
#include "ext.h"
#include <stdlib.h>
#include <assert.h>
@ -820,7 +821,7 @@ static void* WINAPI expWaitForMultipleObjects(int count, const void** objects,
{
int i;
void *object;
int ret;
void *ret;
dbgprintf("WaitForMultipleObjects(%d, 0x%x, %d, duration %d) =>\n",
count, objects, WaitAll, duration);
@ -846,7 +847,7 @@ static void WINAPI expExitThread(int retcode)
static HANDLE WINAPI expCreateMutexA(void *pSecAttr,
char bInitialOwner, const char *name)
{
HANDLE mlist = expCreateEventA(pSecAttr, 0, 0, name);
HANDLE mlist = (HANDLE)expCreateEventA(pSecAttr, 0, 0, name);
if (name)
dbgprintf("CreateMutexA(0x%x, %d, '%s') => 0x%x\n",
@ -1376,6 +1377,9 @@ static void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c)
pthread_mutex_unlock(&(cs->mutex));
return;
}
static void expfree(void* mem); /* forward declaration */
static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c)
{
#ifdef CRITSECS_NEWTYPE
@ -2492,7 +2496,7 @@ static int WINAPI expGetMonitorInfoA(void *mon, LPMONITORINFO lpmi)
if (lpmi->cbSize == sizeof(MONITORINFOEX))
{
LPMONITORINFOEX lpmiex = lpmi;
LPMONITORINFOEX lpmiex = (LPMONITORINFOEX)lpmi;
dbgprintf("MONITORINFOEX!\n");
strncpy(lpmiex->szDevice, "Monitor1", CCHDEVICENAME);
}
@ -3529,9 +3533,9 @@ static DWORD WINAPI expGetFullPathNameA
#endif
#else
if (strrchr(lpFileName, '\\'))
*lpFilePart = strrchr(lpFileName, '\\');
lpFilePart = strrchr(lpFileName, '\\');
else
*lpFilePart = lpFileName;
lpFilePart = lpFileName;
#endif
strcpy(lpBuffer, lpFileName);
// strncpy(lpBuffer, lpFileName, rindex(lpFileName, '\\')-lpFileName);
@ -4403,7 +4407,7 @@ static WIN_BOOL WINAPI expSetThreadPriority(
static void WINAPI expExitProcess( DWORD status )
{
printf("EXIT - code %d\n",status);
printf("EXIT - code %ld\n",status);
exit(status);
}
@ -4462,7 +4466,7 @@ static int expSysStringByteLen(void *str)
static int expDirectDrawCreate(void)
{
dbgprintf("DirectDrawCreate(...) => NULL\n");
return NULL;
return 0;
}
#if 1
@ -4488,8 +4492,8 @@ static HPALETTE WINAPI expCreatePalette(CONST LOGPALETTE *lpgpl)
dbgprintf("CreatePalette(%x) => NULL\n", lpgpl);
i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY));
test = malloc(i);
memcpy(test, lpgpl, i);
test = (HPALETTE)malloc(i);
memcpy((void *)test, lpgpl, i);
return test;
}

View File

@ -1281,7 +1281,7 @@ static int parse_end_at(struct config *conf, const char* param)
end_at_type = END_AT_SIZE;
if(sscanf(param, "%d%3s", &end_at, unit) == 2) {
if(sscanf(param, "%lf%3s", &end_at, unit) == 2) {
if(!strcasecmp(unit, "b"))
;
else if(!strcasecmp(unit, "kb"))

View File

@ -43,6 +43,8 @@ void list_sub_file(subtitle* subs);
void dump_srt(subtitle* subs, float fps);
void dump_mpsub(subtitle* subs, float fps);
void dump_microdvd(subtitle* subs, float fps);
void dump_jacosub(subtitle* subs, float fps);
void dump_sami(subtitle* subs, float fps);
void sub_free( subtitle * subs );
void find_sub(subtitle* subtitles,int key);
void step_sub(subtitle *subtitles, float pts, int movement);

View File

@ -1676,7 +1676,10 @@ void ReadTables(void)
UnpReadBuf(0);
DecodeNumber((struct Decode *)&BD);
if (Number<16)
Table[I++]=(Number+UnpOldTable[I]) & 0xf;
{
Table[I]=(Number+UnpOldTable[I]) & 0xf;
I++;
}
else
if (Number==16)
{