Module: wine Branch: stable Commit: edf4aac3d2c0757c0975b8cdabc1d1488efb68d3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=edf4aac3d2c0757c0975b8cdab...
Author: Ken Thomases ken@codeweavers.com Date: Wed Nov 6 06:59:00 2013 -0600
winemac: Reduce duplicated code by consolidating exit paths from format_for_type().
(cherry picked from commit aa53603135fa8699b1465dca40556c14ed332551)
---
dlls/winemac.drv/clipboard.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c index 5d765f4..f97faea 100644 --- a/dlls/winemac.drv/clipboard.c +++ b/dlls/winemac.drv/clipboard.c @@ -361,10 +361,7 @@ static WINE_CLIPFORMAT* format_for_type(WINE_CLIPFORMAT *current, CFStringRef ty { format = LIST_ENTRY(ptr, WINE_CLIPFORMAT, entry); if (CFEqual(format->type, type)) - { - TRACE(" -> %p/%s\n", format, debugstr_format(format->format_id)); - return format; - } + goto done; }
format = NULL; @@ -376,7 +373,7 @@ static WINE_CLIPFORMAT* format_for_type(WINE_CLIPFORMAT *current, CFStringRef ty { ERR("Shouldn't happen. Built-in type %s should have matched something in format list.\n", debugstr_cf(type)); - return NULL; + goto done; } else if (CFStringHasPrefix(type, registered_name_type_prefix)) { @@ -403,6 +400,7 @@ static WINE_CLIPFORMAT* format_for_type(WINE_CLIPFORMAT *current, CFStringRef ty HeapFree(GetProcessHeap(), 0, name); }
+done: TRACE(" -> %p/%s\n", format, debugstr_format(format ? format->format_id : 0)); return format; }