[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH] dmband: Stop corruption of output string
From:       Michael Stefaniuc <mstefani () winehq ! org>
Date:       2019-11-29 20:50:14
Message-ID: 3076f81d-f3a6-bc13-51e8-aceb3c2f6196 () winehq ! org
[Download RAW message or body]

On 11/29/19 9:47 PM, Michael Stefaniuc wrote:
> /home/michi/work/wine/dlls/dmband/dmutils.c: In function
> 'debugstr_DMUS_OBJECTDESC':
> /home/michi/work/wine/dlls/dmband/dmutils.c:144:10: warning: returning
> 'int' from a function with return type 'const char *' makes pointer from
> integer without a cast [-Wint-conversion]
> return wine_dbg_printf("%s", buffer);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> One for each DLL for both 32 and 64 bit.
> 
> Wonder why the testbot didn't complain about this. I'm using mingw too:
> $ i686-w64-mingw32-gcc --version
> i686-w64-mingw32-gcc (GCC) 8.3.0 20190222 (Fedora MinGW 8.3.0-2.fc29)
Now I see the compiler warnings in the WTB mingw output too.
So it isn't mingw that isn't complaining.


bye
	michael


> 
> On 11/29/19 2:07 AM, Alistair Leslie-Hughes wrote:
> > Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
> > ---
> > dlls/dmband/dmutils.c         | 2 +-
> > dlls/dmcompos/dmcompos_main.c | 2 +-
> > dlls/dmloader/debug.c         | 4 ++--
> > dlls/dmscript/dmscript_main.c | 2 +-
> > 4 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
> > index c76bde1146..5d38d06d1d 100644
> > --- a/dlls/dmband/dmutils.c
> > +++ b/dlls/dmband/dmutils.c
> > @@ -141,7 +141,7 @@ static const char *debugstr_DMUS_OBJECTDESC \
> >                 (LPDMUS_OBJECTDESC pDesc) {
> > 		                                                     \
> > wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);  if \
> > (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p\n", \
> > pDesc->pStream); 
> > -		return wine_dbg_sprintf("%s", buffer);
> > +		return wine_dbg_printf("%s", buffer);
> > 	} else {
> > 		return "(NULL)";
> > 	}
> > diff --git a/dlls/dmcompos/dmcompos_main.c b/dlls/dmcompos/dmcompos_main.c
> > index 21e896cc3e..1580e215bb 100644
> > --- a/dlls/dmcompos/dmcompos_main.c
> > +++ b/dlls/dmcompos/dmcompos_main.c
> > @@ -472,7 +472,7 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC \
> >                 pDesc) {
> > 		                                                     \
> > wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);  if \
> > (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", \
> > pDesc->pStream); 
> > -		return wine_dbg_sprintf("%s", buffer);
> > +		return wine_dbg_printf("%s", buffer);
> > 	} else {
> > 		return wine_dbg_sprintf("(NULL)");
> > 	}
> > diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c
> > index 30b23c2ade..af76404b57 100644
> > --- a/dlls/dmloader/debug.c
> > +++ b/dlls/dmloader/debug.c
> > @@ -503,7 +503,7 @@ const char *debugstr_DMUS_IO_CONTAINER_HEADER \
> > (LPDMUS_IO_CONTAINER_HEADER pHeade  ptr += sprintf(ptr, "DMUS_IO_CONTAINER_HEADER \
> > (%p):", pHeader);  ptr += sprintf(ptr, "\n - dwFlags = %s", \
> > debugstr_DMUS_CONTAINER_FLAGS(pHeader->dwFlags));  
> > -		return wine_dbg_sprintf("%s", buffer);
> > +		return wine_dbg_printf("%s", buffer);
> > 	} else {
> > 		return wine_dbg_sprintf("(NULL)");
> > 	}
> > @@ -519,7 +519,7 @@ const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER \
> > (LPDMUS_IO_CONTAINED_OBJECT  ptr += sprintf(ptr, "\n - ckid = %s", \
> > debugstr_fourcc (pHeader->ckid));  ptr += sprintf(ptr, "\n - fccType = %s", \
> > debugstr_fourcc (pHeader->fccType)); 
> > -		return wine_dbg_sprintf("%s", buffer);
> > +		return wine_dbg_printf("%s", buffer);
> > 	} else {
> > 		return wine_dbg_sprintf("(NULL)");
> > 	}
> > diff --git a/dlls/dmscript/dmscript_main.c b/dlls/dmscript/dmscript_main.c
> > index 7a96679302..4055ea6a93 100644
> > --- a/dlls/dmscript/dmscript_main.c
> > +++ b/dlls/dmscript/dmscript_main.c
> > @@ -502,7 +502,7 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC \
> >                 pDesc) {
> > 		                                                     \
> > wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);  if \
> > (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", \
> > pDesc->pStream); 
> > -		return wine_dbg_sprintf("%s", buffer);
> > +		return wine_dbg_printf("%s", buffer);
> > 	} else {
> > 		return wine_dbg_sprintf("(NULL)");
> > 	}
> > 
> 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic