[PATCH 4/6] winecoreaudio: Switch midi_in_lock() away from a syscall prototype.

Andrew Eikum aeikum at codeweavers.com
Wed Dec 1 08:45:52 CST 2021


Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>

On Tue, Nov 30, 2021 at 07:56:31AM +0000, Huw Davies wrote:
> Signed-off-by: Huw Davies <huw at codeweavers.com>
> ---
>  dlls/winecoreaudio.drv/coremidi.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/dlls/winecoreaudio.drv/coremidi.c b/dlls/winecoreaudio.drv/coremidi.c
> index ae8b71e002b..5777236bd26 100644
> --- a/dlls/winecoreaudio.drv/coremidi.c
> +++ b/dlls/winecoreaudio.drv/coremidi.c
> @@ -136,13 +136,10 @@ static struct notify_context *notify_read, *notify_write;
>  
>  #define MAX_MIDI_SYNTHS 1
>  
> -NTSTATUS midi_in_lock(void *args)
> +static void midi_in_lock(BOOL lock)
>  {
> -    BOOL lock = !!args;
> -
>      if (lock) pthread_mutex_lock(&midi_in_mutex);
>      else pthread_mutex_unlock(&midi_in_mutex);
> -    return STATUS_SUCCESS;
>  }
>  
>  static void set_in_notify(struct notify_context *notify, struct midi_src *src, WORD dev_id, WORD msg,
> @@ -228,7 +225,7 @@ static void process_sysex_packet(struct midi_src *src, MIDIPacket *packet)
>  
>      src->state |= 2;
>  
> -    midi_in_lock((void *)TRUE);
> +    midi_in_lock(TRUE);
>  
>      while (len)
>      {
> @@ -253,7 +250,7 @@ static void process_sysex_packet(struct midi_src *src, MIDIPacket *packet)
>          }
>      }
>  
> -    midi_in_lock((void *)FALSE);
> +    midi_in_lock(FALSE);
>  }
>  
>  static void process_small_packet(struct midi_src *src, MIDIPacket *packet)
> @@ -981,13 +978,13 @@ static DWORD midi_in_add_buffer(WORD dev_id, MIDIHDR *hdr, DWORD hdr_size)
>      hdr->dwBytesRecorded = 0;
>      hdr->lpNext = NULL;
>  
> -    midi_in_lock((void *)TRUE);
> +    midi_in_lock(TRUE);
>  
>      next = &srcs[dev_id].lpQueueHdr;
>      while (*next) next = &(*next)->lpNext;
>      *next = hdr;
>  
> -    midi_in_lock((void *)FALSE);
> +    midi_in_lock(FALSE);
>  
>      return MMSYSERR_NOERROR;
>  }
> @@ -1090,7 +1087,7 @@ static DWORD midi_in_reset(WORD dev_id, struct notify_context *notify)
>      }
>      src = srcs + dev_id;
>  
> -    midi_in_lock((void *)TRUE);
> +    midi_in_lock(TRUE);
>  
>      if (src->lpQueueHdr)
>      {
> @@ -1102,7 +1099,7 @@ static DWORD midi_in_reset(WORD dev_id, struct notify_context *notify)
>          if (src->lpQueueHdr) err = ERROR_RETRY; /* ask the client to call again */
>      }
>  
> -    midi_in_lock((void *)FALSE);
> +    midi_in_lock(FALSE);
>  
>      return err;
>  }
> -- 
> 2.23.0
> 
> 



More information about the wine-devel mailing list