Re: [Mingw-w64-public] [PATCH] vsbackup.idl: set default value for InitializeForBackup() bstrXML

2022-02-17 Thread Marc-André Lureau
Hi Biswapriyo

On Fri, Feb 18, 2022 at 10:15 AM Biswapriyo Nath  wrote:
>
> Opps! I have been caught for my `sed` cheats :) I may have missed many
> of those default values. Can I add those defaultvalue() in one patch?
>

That would be great!
thanks



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] vsbackup.idl: set default value for InitializeForBackup() bstrXML

2022-02-17 Thread Biswapriyo Nath
Opps! I have been caught for my `sed` cheats :) I may have missed many
of those default values. Can I add those defaultvalue() in one patch?


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] winpthreads: Add a missing (void) in the parameters for pthread_getevent

2022-02-17 Thread LIU Hao

在 2/18/22 00:23, NightStrike 写道:


Adding unnecessary spam because of yet another poor choice of clang is
not something we should be catering towards.  Users can compile with
-Wno-strict-prototypes if it bothers them that much.




No this is not 'unnecessary'. In C the declaration `void* pthread_getevent();` is equivalent to 
`void* pthread_getevent(...);` despite lack of any means to get arguments (`va_start` requires a 
named parameter). Ancient code that predated ISO C used to define functions like


  int fputc();  /* declaration */

  int fputc()   /* definition*/
int c;  /* arguments */
FILE* fp;
  { /* ... */  }

so empty parentheses are there to provide compatibility, and leaving them there for now is not only 
not unnecessary, but totally incorrect in C.



--
Best regards,
LIU Hao


OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] winpthreads: Add a missing (void) in the parameters for pthread_getevent

2022-02-17 Thread Ozkan Sezer
On 2/17/22, Martin Storsjö  wrote:
> On Thu, 17 Feb 2022, NightStrike wrote:
>
>> On Thu, Feb 17, 2022 at 8:27 AM Martin Storsjö  wrote:
>>>
>>> This avoids warnings if building code including it, with
>>> -Wstrict-prototypes. (Latest Clang defaults to enabling this warning
>>> by default.)
>>>
>>> Signed-off-by: Martin Storsjö 
>>> ---
>>>  mingw-w64-libraries/winpthreads/include/pthread.h | 2 +-
>>>  mingw-w64-libraries/winpthreads/src/thread.c  | 2 +-
>>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/mingw-w64-libraries/winpthreads/include/pthread.h 
>>> b/mingw-w64-libraries/winpthreads/include/pthread.h
>>> index fe0e821ce..5aadb1cfa 100644
>>> --- a/mingw-w64-libraries/winpthreads/include/pthread.h
>>> +++ b/mingw-w64-libraries/winpthreads/include/pthread.h
>>> @@ -393,7 +393,7 @@ int WINPTHREAD_API pthread_barrierattr_getpshared(void 
>>> **attr, int *s);
>>>  /* Private extensions for analysis and internal use.  */
>>>  struct _pthread_cleanup ** WINPTHREAD_API pthread_getclean (void);
>>>  void * WINPTHREAD_API pthread_gethandle (pthread_t t);
>>> -void * WINPTHREAD_API pthread_getevent ();
>>> +void * WINPTHREAD_API pthread_getevent (void);
>>>
>>>  unsigned long long WINPTHREAD_API _pthread_rel_time_in_ms(const
>>> struct timespec *ts);
>>>  unsigned long long WINPTHREAD_API _pthread_time_in_ms(void);
>>> diff --git a/mingw-w64-libraries/winpthreads/src/thread.c
>>> b/mingw-w64-libraries/winpthreads/src/thread.c
>>> index 55361aec9..e3edbae8a 100644
>>> --- a/mingw-w64-libraries/winpthreads/src/thread.c
>>> +++ b/mingw-w64-libraries/winpthreads/src/thread.c
>>> @@ -1038,7 +1038,7 @@ pthread_self (void)
>>>
>>>  /* Internal helper for getting event handle of thread T.  */
>>>  void *
>>> -pthread_getevent ()
>>> +pthread_getevent (void)
>>>  {
>>>_pthread_v *t = __pthread_self_lite ();
>>>return (!t ? NULL : t->evStart);
>>
>> Adding unnecessary spam because of yet another poor choice of clang is
>> not something we should be catering towards.  Users can compile with
>> -Wno-strict-prototypes if it bothers them that much.
>
> Actually, my comment about Clang was wrong, I was misinformed - this
> doesn't have anything to do with Clang at all.
>
> I saw the warning fly by for every file built, when building a project
> that explicitly enables -Wstrict-prototypes.
>
> // Martin

IMO, the patch is good.

--
O.S.


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] winpthreads: Add a missing (void) in the parameters for pthread_getevent

2022-02-17 Thread Martin Storsjö

On Thu, 17 Feb 2022, NightStrike wrote:


On Thu, Feb 17, 2022 at 8:27 AM Martin Storsjö  wrote:


This avoids warnings if building code including it, with
-Wstrict-prototypes. (Latest Clang defaults to enabling this warning
by default.)

Signed-off-by: Martin Storsjö 
---
 mingw-w64-libraries/winpthreads/include/pthread.h | 2 +-
 mingw-w64-libraries/winpthreads/src/thread.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/include/pthread.h 
b/mingw-w64-libraries/winpthreads/include/pthread.h
index fe0e821ce..5aadb1cfa 100644
--- a/mingw-w64-libraries/winpthreads/include/pthread.h
+++ b/mingw-w64-libraries/winpthreads/include/pthread.h
@@ -393,7 +393,7 @@ int WINPTHREAD_API pthread_barrierattr_getpshared(void 
**attr, int *s);
 /* Private extensions for analysis and internal use.  */
 struct _pthread_cleanup ** WINPTHREAD_API pthread_getclean (void);
 void * WINPTHREAD_API pthread_gethandle (pthread_t t);
-void * WINPTHREAD_API pthread_getevent ();
+void * WINPTHREAD_API pthread_getevent (void);

 unsigned long long WINPTHREAD_API _pthread_rel_time_in_ms(const struct 
timespec *ts);
 unsigned long long WINPTHREAD_API _pthread_time_in_ms(void);
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 55361aec9..e3edbae8a 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -1038,7 +1038,7 @@ pthread_self (void)

 /* Internal helper for getting event handle of thread T.  */
 void *
-pthread_getevent ()
+pthread_getevent (void)
 {
   _pthread_v *t = __pthread_self_lite ();
   return (!t ? NULL : t->evStart);


Adding unnecessary spam because of yet another poor choice of clang is
not something we should be catering towards.  Users can compile with
-Wno-strict-prototypes if it bothers them that much.


Actually, my comment about Clang was wrong, I was misinformed - this 
doesn't have anything to do with Clang at all.


I saw the warning fly by for every file built, when building a project 
that explicitly enables -Wstrict-prototypes.


// Martin

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] winpthreads: Add a missing (void) in the parameters for pthread_getevent

2022-02-17 Thread Martin Storsjö

On Thu, 17 Feb 2022, NightStrike wrote:


On Thu, Feb 17, 2022 at 8:27 AM Martin Storsjö  wrote:


This avoids warnings if building code including it, with
-Wstrict-prototypes. (Latest Clang defaults to enabling this warning
by default.)

Signed-off-by: Martin Storsjö 
---
 mingw-w64-libraries/winpthreads/include/pthread.h | 2 +-
 mingw-w64-libraries/winpthreads/src/thread.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/include/pthread.h 
b/mingw-w64-libraries/winpthreads/include/pthread.h
index fe0e821ce..5aadb1cfa 100644
--- a/mingw-w64-libraries/winpthreads/include/pthread.h
+++ b/mingw-w64-libraries/winpthreads/include/pthread.h
@@ -393,7 +393,7 @@ int WINPTHREAD_API pthread_barrierattr_getpshared(void 
**attr, int *s);
 /* Private extensions for analysis and internal use.  */
 struct _pthread_cleanup ** WINPTHREAD_API pthread_getclean (void);
 void * WINPTHREAD_API pthread_gethandle (pthread_t t);
-void * WINPTHREAD_API pthread_getevent ();
+void * WINPTHREAD_API pthread_getevent (void);

 unsigned long long WINPTHREAD_API _pthread_rel_time_in_ms(const struct 
timespec *ts);
 unsigned long long WINPTHREAD_API _pthread_time_in_ms(void);
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 55361aec9..e3edbae8a 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -1038,7 +1038,7 @@ pthread_self (void)

 /* Internal helper for getting event handle of thread T.  */
 void *
-pthread_getevent ()
+pthread_getevent (void)
 {
   _pthread_v *t = __pthread_self_lite ();
   return (!t ? NULL : t->evStart);


Adding unnecessary spam because of yet another poor choice of clang is
not something we should be catering towards.  Users can compile with
-Wno-strict-prototypes if it bothers them that much.


Sorry, but in what way is declaring a correct function prototype "spam"? 
We already do that for some other functions right above, see e.g. 
pthread_getclean 2 lines above in the header.


// Martin

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] winpthreads: Add a missing (void) in the parameters for pthread_getevent

2022-02-17 Thread NightStrike
On Thu, Feb 17, 2022 at 8:27 AM Martin Storsjö  wrote:
>
> This avoids warnings if building code including it, with
> -Wstrict-prototypes. (Latest Clang defaults to enabling this warning
> by default.)
>
> Signed-off-by: Martin Storsjö 
> ---
>  mingw-w64-libraries/winpthreads/include/pthread.h | 2 +-
>  mingw-w64-libraries/winpthreads/src/thread.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mingw-w64-libraries/winpthreads/include/pthread.h 
> b/mingw-w64-libraries/winpthreads/include/pthread.h
> index fe0e821ce..5aadb1cfa 100644
> --- a/mingw-w64-libraries/winpthreads/include/pthread.h
> +++ b/mingw-w64-libraries/winpthreads/include/pthread.h
> @@ -393,7 +393,7 @@ int WINPTHREAD_API pthread_barrierattr_getpshared(void 
> **attr, int *s);
>  /* Private extensions for analysis and internal use.  */
>  struct _pthread_cleanup ** WINPTHREAD_API pthread_getclean (void);
>  void * WINPTHREAD_API pthread_gethandle (pthread_t t);
> -void * WINPTHREAD_API pthread_getevent ();
> +void * WINPTHREAD_API pthread_getevent (void);
>
>  unsigned long long WINPTHREAD_API _pthread_rel_time_in_ms(const 
> struct timespec *ts);
>  unsigned long long WINPTHREAD_API _pthread_time_in_ms(void);
> diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
> b/mingw-w64-libraries/winpthreads/src/thread.c
> index 55361aec9..e3edbae8a 100644
> --- a/mingw-w64-libraries/winpthreads/src/thread.c
> +++ b/mingw-w64-libraries/winpthreads/src/thread.c
> @@ -1038,7 +1038,7 @@ pthread_self (void)
>
>  /* Internal helper for getting event handle of thread T.  */
>  void *
> -pthread_getevent ()
> +pthread_getevent (void)
>  {
>_pthread_v *t = __pthread_self_lite ();
>return (!t ? NULL : t->evStart);

Adding unnecessary spam because of yet another poor choice of clang is
not something we should be catering towards.  Users can compile with
-Wno-strict-prototypes if it bothers them that much.


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] winpthreads: Add a missing (void) in the parameters for pthread_getevent

2022-02-17 Thread Martin Storsjö
This avoids warnings if building code including it, with
-Wstrict-prototypes. (Latest Clang defaults to enabling this warning
by default.)

Signed-off-by: Martin Storsjö 
---
 mingw-w64-libraries/winpthreads/include/pthread.h | 2 +-
 mingw-w64-libraries/winpthreads/src/thread.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/include/pthread.h 
b/mingw-w64-libraries/winpthreads/include/pthread.h
index fe0e821ce..5aadb1cfa 100644
--- a/mingw-w64-libraries/winpthreads/include/pthread.h
+++ b/mingw-w64-libraries/winpthreads/include/pthread.h
@@ -393,7 +393,7 @@ int WINPTHREAD_API pthread_barrierattr_getpshared(void 
**attr, int *s);
 /* Private extensions for analysis and internal use.  */
 struct _pthread_cleanup ** WINPTHREAD_API pthread_getclean (void);
 void * WINPTHREAD_API pthread_gethandle (pthread_t t);
-void * WINPTHREAD_API pthread_getevent ();
+void * WINPTHREAD_API pthread_getevent (void);
 
 unsigned long long WINPTHREAD_API _pthread_rel_time_in_ms(const struct 
timespec *ts);
 unsigned long long WINPTHREAD_API _pthread_time_in_ms(void);
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 55361aec9..e3edbae8a 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -1038,7 +1038,7 @@ pthread_self (void)
 
 /* Internal helper for getting event handle of thread T.  */
 void *
-pthread_getevent ()
+pthread_getevent (void)
 {
   _pthread_v *t = __pthread_self_lite ();
   return (!t ? NULL : t->evStart);
-- 
2.25.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] vsbackup.idl: set default value for InitializeForBackup() bstrXML

2022-02-17 Thread marcandre . lureau
From: Marc-André Lureau 

This fixes the compilation against the QEMU Guest Agent.

Signed-off-by: Marc-André Lureau 
---
 mingw-w64-headers/include/vsbackup.h   | 2 +-
 mingw-w64-headers/include/vsbackup.idl | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-headers/include/vsbackup.h 
b/mingw-w64-headers/include/vsbackup.h
index 0bf3ca0e9b01..30341794d0fc 100644
--- a/mingw-w64-headers/include/vsbackup.h
+++ b/mingw-w64-headers/include/vsbackup.h
@@ -989,7 +989,7 @@ IVssBackupComponents : public IUnknown
 IVssWriterComponentsExt **ppWriter) = 0;
 
 virtual HRESULT STDMETHODCALLTYPE InitializeForBackup(
-BSTR bstrXML) = 0;
+BSTR bstrXML = 0) = 0;
 
 virtual HRESULT STDMETHODCALLTYPE SetBackupState(
 boolean bSelectComponents,
diff --git a/mingw-w64-headers/include/vsbackup.idl 
b/mingw-w64-headers/include/vsbackup.idl
index 2740bb186a1f..92ac5945fae8 100644
--- a/mingw-w64-headers/include/vsbackup.idl
+++ b/mingw-w64-headers/include/vsbackup.idl
@@ -157,7 +157,7 @@ interface IVssBackupComponents : IUnknown
 [out] IVssWriterComponentsExt **ppWriter);
 
   HRESULT InitializeForBackup(
-[in] BSTR bstrXML);
+[in, defaultvalue(NULL)] BSTR bstrXML);
 
   HRESULT SetBackupState(
 [in] boolean bSelectComponents,
-- 
2.34.1.428.gdcc0cd074f0c



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] crt: Check the return value from MultiByteToWideChar in btowc

2022-02-17 Thread Martin Storsjö

On Thu, 17 Feb 2022, LIU Hao wrote:


在 2/16/22 06:09, Martin Storsjö 写道:

If MultiByteToWideChar failed, it could still have overwritten
the output variable.

Signed-off-by: Martin Storsjö 
---
  mingw-w64-crt/misc/btowc.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)




LGTM. Thanks.


Pushed, thanks!

// Martin

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public