summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorreynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-02 03:59:36 +0000
committerreynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-02 03:59:36 +0000
commit9d9a15d18572d1450fd8fef495be3629bf85c995 (patch)
treebfbc498db3d3ada10c8cfe64c9381bce66533419 /loader
parent1ad9af38b5120af85129d3b74834c7ed9690e7f3 (diff)
downloadmpv-9d9a15d18572d1450fd8fef495be3629bf85c995.tar.bz2
mpv-9d9a15d18572d1450fd8fef495be3629bf85c995.tar.xz
rm unnecesary casts from void* - part 2
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18883 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r--loader/afl.c2
-rw-r--r--loader/dmo/DMO_VideoDecoder.c4
-rw-r--r--loader/dshow/DS_VideoDecoder.c4
-rw-r--r--loader/dshow/cmediasample.c6
-rw-r--r--loader/dshow/inputpin.c2
-rw-r--r--loader/dshow/outputpin.c6
-rw-r--r--loader/dshow/test.c2
-rw-r--r--loader/ldt_keeper.c2
-rw-r--r--loader/module.c2
-rw-r--r--loader/registry.c26
-rw-r--r--loader/vfl.c2
-rw-r--r--loader/win32.c14
12 files changed, 36 insertions, 36 deletions
diff --git a/loader/afl.c b/loader/afl.c
index 46b7acaa3b..7e1993657f 100644
--- a/loader/afl.c
+++ b/loader/afl.c
@@ -282,7 +282,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName,
MSACM_hHeap = GetProcessHeap();
#endif
padid = (PWINE_ACMDRIVERID) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
- padid->pszFileName = (char*)malloc(strlen(pszFileName)+1);
+ padid->pszFileName = malloc(strlen(pszFileName)+1);
strcpy(padid->pszFileName, pszFileName);
// 1~strdup(pszDriverAlias);
padid->wFormatTag = wFormatTag;
diff --git a/loader/dmo/DMO_VideoDecoder.c b/loader/dmo/DMO_VideoDecoder.c
index b2b5dd3823..16eba31936 100644
--- a/loader/dmo/DMO_VideoDecoder.c
+++ b/loader/dmo/DMO_VideoDecoder.c
@@ -119,7 +119,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE
bihs = (format->biSize < (int) sizeof(BITMAPINFOHEADER)) ?
sizeof(BITMAPINFOHEADER) : format->biSize;
- this->iv.m_bh = (BITMAPINFOHEADER*)malloc(bihs);
+ this->iv.m_bh = malloc(bihs);
memcpy(this->iv.m_bh, format, bihs);
this->iv.m_State = STOP;
@@ -131,7 +131,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE
this->iv.m_bCapable16b = true;
bihs += sizeof(VIDEOINFOHEADER) - sizeof(BITMAPINFOHEADER);
- this->m_sVhdr = (VIDEOINFOHEADER*)malloc(bihs);
+ this->m_sVhdr = malloc(bihs);
memset(this->m_sVhdr, 0, bihs);
memcpy(&this->m_sVhdr->bmiHeader, this->iv.m_bh, this->iv.m_bh->biSize);
this->m_sVhdr->rcSource.left = this->m_sVhdr->rcSource.top = 0;
diff --git a/loader/dshow/DS_VideoDecoder.c b/loader/dshow/DS_VideoDecoder.c
index 5ed464f056..7f1cf72bae 100644
--- a/loader/dshow/DS_VideoDecoder.c
+++ b/loader/dshow/DS_VideoDecoder.c
@@ -114,7 +114,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD
bihs = (format->biSize < (int) sizeof(BITMAPINFOHEADER)) ?
sizeof(BITMAPINFOHEADER) : format->biSize;
- this->iv.m_bh = (BITMAPINFOHEADER*)malloc(bihs);
+ this->iv.m_bh = malloc(bihs);
memcpy(this->iv.m_bh, format, bihs);
this->iv.m_State = STOP;
@@ -126,7 +126,7 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD
this->iv.m_bCapable16b = true;
bihs += sizeof(VIDEOINFOHEADER) - sizeof(BITMAPINFOHEADER);
- this->m_sVhdr = (VIDEOINFOHEADER*)malloc(bihs);
+ this->m_sVhdr = malloc(bihs);
memset(this->m_sVhdr, 0, bihs);
memcpy(&this->m_sVhdr->bmiHeader, this->iv.m_bh, this->iv.m_bh->biSize);
this->m_sVhdr->rcSource.left = this->m_sVhdr->rcSource.top = 0;
diff --git a/loader/dshow/cmediasample.c b/loader/dshow/cmediasample.c
index 0656a72e87..3237a06f88 100644
--- a/loader/dshow/cmediasample.c
+++ b/loader/dshow/cmediasample.c
@@ -178,9 +178,9 @@ static HRESULT STDCALL CMediaSample_GetMediaType(IMediaSample* This,
t = &((CMediaSample*)This)->media_type;
// if(t.pbFormat)free(t.pbFormat);
- (*ppMediaType) = (AM_MEDIA_TYPE*)malloc(sizeof(AM_MEDIA_TYPE));
+ (*ppMediaType) = malloc(sizeof(AM_MEDIA_TYPE));
**ppMediaType = *t;
- (*ppMediaType)->pbFormat = (char*)malloc(t->cbFormat);
+ (*ppMediaType)->pbFormat = malloc(t->cbFormat);
memcpy((*ppMediaType)->pbFormat, t->pbFormat, t->cbFormat);
// *ppMediaType=0; //media type was not changed
return 0;
@@ -199,7 +199,7 @@ static HRESULT STDCALL CMediaSample_SetMediaType(IMediaSample * This,
t = pMediaType;
if (t->cbFormat)
{
- t->pbFormat = (char*)malloc(t->cbFormat);
+ t->pbFormat = malloc(t->cbFormat);
memcpy(t->pbFormat, pMediaType->pbFormat, t->cbFormat);
}
else
diff --git a/loader/dshow/inputpin.c b/loader/dshow/inputpin.c
index 96c5c20e79..88aa19b372 100644
--- a/loader/dshow/inputpin.c
+++ b/loader/dshow/inputpin.c
@@ -179,7 +179,7 @@ static long STDCALL CInputPin_ConnectionMediaType(IPin* This,
*pmt=((CInputPin*)This)->type;
if (pmt->cbFormat > 0)
{
- pmt->pbFormat=(char *)malloc(pmt->cbFormat);
+ pmt->pbFormat=malloc(pmt->cbFormat);
memcpy(pmt->pbFormat, ((CInputPin*)This)->type.pbFormat, pmt->cbFormat);
}
return 0;
diff --git a/loader/dshow/outputpin.c b/loader/dshow/outputpin.c
index 8c1769afa7..3ab6221eab 100644
--- a/loader/dshow/outputpin.c
+++ b/loader/dshow/outputpin.c
@@ -56,12 +56,12 @@ static HRESULT STDCALL CEnumMediaTypes_Next(IEnumMediaTypes * This,
if (pcFetched)
*pcFetched=1;
- ppMediaTypes[0] = (AM_MEDIA_TYPE *)malloc(sizeof(AM_MEDIA_TYPE));
+ ppMediaTypes[0] = malloc(sizeof(AM_MEDIA_TYPE));
// copy structures - C can handle this...
**ppMediaTypes = *type;
if (ppMediaTypes[0]->pbFormat)
{
- ppMediaTypes[0]->pbFormat=(char *)malloc(ppMediaTypes[0]->cbFormat);
+ ppMediaTypes[0]->pbFormat=malloc(ppMediaTypes[0]->cbFormat);
memcpy(ppMediaTypes[0]->pbFormat, type->pbFormat, ppMediaTypes[0]->cbFormat);
}
if (cMediaTypes == 1)
@@ -219,7 +219,7 @@ static HRESULT STDCALL COutputPin_ConnectionMediaType(IPin * This,
*pmt = ((COutputPin*)This)->type;
if (pmt->cbFormat>0)
{
- pmt->pbFormat=(char *)malloc(pmt->cbFormat);
+ pmt->pbFormat=malloc(pmt->cbFormat);
memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
}
return 0;
diff --git a/loader/dshow/test.c b/loader/dshow/test.c
index 0b3a521f47..b7a0ec6a9e 100644
--- a/loader/dshow/test.c
+++ b/loader/dshow/test.c
@@ -20,7 +20,7 @@ int main(int argc,char* argv[]){
fread(&bih,sizeof(BITMAPINFOHEADER),1,f);
printf("frame dim: %d x %d \n",(int)bih.biWidth,(int)bih.biHeight);
- src=(char*)malloc(512000);
+ src=malloc(512000);
len=fread(src,1,512000,f);
printf("frame len = %d\n",len);
diff --git a/loader/ldt_keeper.c b/loader/ldt_keeper.c
index 5fb612bd2d..6b28776501 100644
--- a/loader/ldt_keeper.c
+++ b/loader/ldt_keeper.c
@@ -272,7 +272,7 @@ ldt_fs_t* Setup_LDT_Keeper(void)
Setup_FS_Segment();
- ldt_fs->prev_struct = (char*)malloc(8);
+ ldt_fs->prev_struct = malloc(8);
*(void**)array.base_addr = ldt_fs->prev_struct;
return ldt_fs;
diff --git a/loader/module.c b/loader/module.c
index cf3c745aec..8f87180627 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -242,7 +242,7 @@ static WIN_BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved )
}
else
{
- local_wm = (modref_list*)malloc(sizeof(modref_list));
+ local_wm = malloc(sizeof(modref_list));
local_wm->next=local_wm->prev=NULL;
local_wm->wm=wm;
}
diff --git a/loader/registry.c b/loader/registry.c
index a4a06b8383..4a05e88d54 100644
--- a/loader/registry.c
+++ b/loader/registry.c
@@ -66,11 +66,11 @@ static void create_registry(void){
save_registry();
return;
}
- regs=(struct reg_value*)malloc(3*sizeof(struct reg_value));
+ regs=malloc(3*sizeof(struct reg_value));
regs[0].type=regs[1].type=DIR;
- regs[0].name=(char*)malloc(5);
+ regs[0].name=malloc(5);
strcpy(regs[0].name, "HKLM");
- regs[1].name=(char*)malloc(5);
+ regs[1].name=malloc(5);
strcpy(regs[1].name, "HKCU");
regs[0].value=regs[1].value=NULL;
regs[0].len=regs[1].len=0;
@@ -97,13 +97,13 @@ static void open_registry(void)
return;
}
read(fd, &reg_size, 4);
- regs=(struct reg_value*)malloc(reg_size*sizeof(struct reg_value));
+ regs=malloc(reg_size*sizeof(struct reg_value));
head = 0;
for(i=0; i<reg_size; i++)
{
read(fd,&regs[i].type,4);
read(fd,&len,4);
- regs[i].name=(char*)malloc(len+1);
+ regs[i].name=malloc(len+1);
if(regs[i].name==0)
{
reg_size=i+1;
@@ -112,7 +112,7 @@ static void open_registry(void)
read(fd, regs[i].name, len);
regs[i].name[len]=0;
read(fd,&regs[i].len,4);
- regs[i].value=(char*)malloc(regs[i].len+1);
+ regs[i].value=malloc(regs[i].len+1);
if(regs[i].value==0)
{
free(regs[i].name);
@@ -226,7 +226,7 @@ static int generate_handle()
static reg_handle_t* insert_handle(long handle, const char* name)
{
reg_handle_t* t;
- t=(reg_handle_t*)malloc(sizeof(reg_handle_t));
+ t=malloc(sizeof(reg_handle_t));
if(head==0)
{
t->prev=0;
@@ -237,7 +237,7 @@ static reg_handle_t* insert_handle(long handle, const char* name)
t->prev=head;
}
t->next=0;
- t->name=(char*)malloc(strlen(name)+1);
+ t->name=malloc(strlen(name)+1);
strcpy(t->name, name);
t->handle=handle;
head=t;
@@ -254,7 +254,7 @@ static char* build_keyname(long key, const char* subkey)
}
if(subkey==NULL)
subkey="<default>";
- full_name=(char*)malloc(strlen(t->name)+strlen(subkey)+10);
+ full_name=malloc(strlen(t->name)+strlen(subkey)+10);
strcpy(full_name, t->name);
strcat(full_name, "\\");
strcat(full_name, subkey);
@@ -290,9 +290,9 @@ static struct reg_value* insert_reg_value(int handle, const char* name, int type
TRACE("RegInsert '%s' %p v:%d len:%d\n", name, value, *(int*)value, len);
v->type=type;
v->len=len;
- v->value=(char*)malloc(len);
+ v->value=malloc(len);
memcpy(v->value, value, len);
- v->name=(char*)malloc(strlen(fullname)+1);
+ v->name=malloc(strlen(fullname)+1);
strcpy(v->name, fullname);
free(fullname);
save_registry();
@@ -325,7 +325,7 @@ static void init_registry(void)
pthn = pwent->pw_dir;
}
- localregpathname = (char*)malloc(strlen(pthn)+20);
+ localregpathname = malloc(strlen(pthn)+20);
strcpy(localregpathname, pthn);
strcat(localregpathname, "/.registry");
}
@@ -347,7 +347,7 @@ static reg_handle_t* find_handle_2(long key, const char* subkey)
}
if(subkey==NULL)
return t;
- full_name=(char*)malloc(strlen(t->name)+strlen(subkey)+10);
+ full_name=malloc(strlen(t->name)+strlen(subkey)+10);
strcpy(full_name, t->name);
strcat(full_name, "\\");
strcat(full_name, subkey);
diff --git a/loader/vfl.c b/loader/vfl.c
index db00fa74ec..8aa1573913 100644
--- a/loader/vfl.c
+++ b/loader/vfl.c
@@ -78,7 +78,7 @@ ICOpen(long filename,long fccHandler,unsigned int wMode) {
/* FIXME: do we need to fill out the rest too? */
hdrv=OpenDriverA((long)&icopen);
if (!hdrv) return 0;
- whic = (WINE_HIC*)malloc(sizeof(WINE_HIC));
+ whic = malloc(sizeof(WINE_HIC));
whic->hdrv = hdrv;
whic->driverproc= ((DRVR*)hdrv)->DriverProc;
// whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
diff --git a/loader/win32.c b/loader/win32.c
index 74a9031bc5..feea09ba67 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -2759,7 +2759,7 @@ static int WINAPI expGetPrivateProfileIntA(const char* appname,
dbgprintf("GetPrivateProfileIntA('%s', '%s', %d, '%s') => %d\n", appname, keyname, default_value, filename, default_value );
return default_value;
}
- fullname=(char*)malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
+ fullname=malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
strcpy(fullname, "Software\\IniFileMapping\\");
strcat(fullname, appname);
strcat(fullname, "\\");
@@ -2797,7 +2797,7 @@ static int WINAPI expGetPrivateProfileStringA(const char* appname,
char* fullname;
dbgprintf("GetPrivateProfileStringA('%s', '%s', def_val '%s', 0x%x, 0x%x, '%s')", appname, keyname, def_val, dest, len, filename );
if(!(appname && keyname && filename) ) return 0;
- fullname=(char*)malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
+ fullname=malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
strcpy(fullname, "Software\\IniFileMapping\\");
strcat(fullname, appname);
strcat(fullname, "\\");
@@ -2828,7 +2828,7 @@ static int WINAPI expWritePrivateProfileStringA(const char* appname,
dbgprintf(" => -1\n");
return -1;
}
- fullname=(char*)malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
+ fullname=malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
strcpy(fullname, "Software\\IniFileMapping\\");
strcat(fullname, appname);
strcat(fullname, "\\");
@@ -3542,7 +3542,7 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2,
if(strstr(cs1, "QuickTime.qts"))
{
int result;
- char* tmp=(char*)malloc(strlen(def_path)+50);
+ char* tmp=malloc(strlen(def_path)+50);
strcpy(tmp, def_path);
strcat(tmp, "/");
strcat(tmp, "QuickTime.qts");
@@ -3553,7 +3553,7 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2,
if(strstr(cs1, ".qtx"))
{
int result;
- char* tmp=(char*)malloc(strlen(def_path)+250);
+ char* tmp=malloc(strlen(def_path)+250);
char* x=strrchr(cs1,'\\');
sprintf(tmp,"%s/%s",def_path,x?(x+1):cs1);
// printf("### Open: %s -> %s\n",cs1,tmp);
@@ -3566,7 +3566,7 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2,
if(strncmp(cs1, "AP", 2) == 0)
{
int result;
- char* tmp=(char*)malloc(strlen(def_path)+50);
+ char* tmp=malloc(strlen(def_path)+50);
strcpy(tmp, def_path);
strcat(tmp, "/");
strcat(tmp, "APmpg4v1.apl");
@@ -3578,7 +3578,7 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2,
{
int r;
int flg = 0;
- char* tmp=(char*)malloc(20 + strlen(cs1));
+ char* tmp=malloc(20 + strlen(cs1));
strcpy(tmp, "/tmp/");
strcat(tmp, cs1);
r = 4;