Alex Henrie : include: Add debugstr_time to wine/strmbase.h.
Module: wine Branch: master Commit: 2e9a57a0b823140f8cf514ac7bf8812b0f15f15d URL: https://gitlab.winehq.org/wine/wine/-/commit/2e9a57a0b823140f8cf514ac7bf8812... Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sat Feb 17 23:11:27 2024 -0700 include: Add debugstr_time to wine/strmbase.h. --- dlls/evr/evr_private.h | 21 --------------------- dlls/qasf/asfreader.c | 21 --------------------- dlls/quartz/quartz_private.h | 21 --------------------- dlls/winegstreamer/gst_private.h | 21 --------------------- include/wine/strmbase.h | 22 ++++++++++++++++++++++ libs/strmbase/strmbase_private.h | 21 --------------------- 6 files changed, 22 insertions(+), 105 deletions(-) diff --git a/dlls/evr/evr_private.h b/dlls/evr/evr_private.h index 225e60348b4..c24dd01a745 100644 --- a/dlls/evr/evr_private.h +++ b/dlls/evr/evr_private.h @@ -24,27 +24,6 @@ #include "wine/strmbase.h" #include "wine/debug.h" -static inline const char *debugstr_time(LONGLONG time) -{ - ULONGLONG abstime = time >= 0 ? time : -time; - unsigned int i = 0, j = 0; - char buffer[23], rev[23]; - - while (abstime || i <= 8) - { - buffer[i++] = '0' + (abstime % 10); - abstime /= 10; - if (i == 7) buffer[i++] = '.'; - } - if (time < 0) buffer[i++] = '-'; - - while (i--) rev[j++] = buffer[i]; - while (rev[j-1] == '0' && rev[j-2] != '.') --j; - rev[j] = 0; - - return wine_dbg_sprintf("%s", rev); -} - static inline const char *debugstr_normalized_rect(const MFVideoNormalizedRect *rect) { if (!rect) return "(null)"; diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c index 4cf077e9dd3..7a832e9a718 100644 --- a/dlls/qasf/asfreader.c +++ b/dlls/qasf/asfreader.c @@ -27,27 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); -static inline const char *debugstr_time(REFERENCE_TIME time) -{ - ULONGLONG abstime = time >= 0 ? time : -time; - unsigned int i = 0, j = 0; - char buffer[23], rev[23]; - - while (abstime || i <= 8) - { - buffer[i++] = '0' + (abstime % 10); - abstime /= 10; - if (i == 7) buffer[i++] = '.'; - } - if (time < 0) buffer[i++] = '-'; - - while (i--) rev[j++] = buffer[i]; - while (rev[j-1] == '0' && rev[j-2] != '.') --j; - rev[j] = 0; - - return wine_dbg_sprintf("%s", rev); -} - struct buffer { INSSBuffer INSSBuffer_iface; diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 8a761e540b9..946709f936a 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -44,27 +44,6 @@ 0, 0, { (DWORD_PTR)(__FILE__ ": " # cs) }}; \ static CRITICAL_SECTION cs = { &cs##_debug, -1, 0, 0, 0, 0 }; -static inline const char *debugstr_time(REFERENCE_TIME time) -{ - ULONGLONG abstime = time >= 0 ? time : -time; - unsigned int i = 0, j = 0; - char buffer[23], rev[23]; - - while (abstime || i <= 8) - { - buffer[i++] = '0' + (abstime % 10); - abstime /= 10; - if (i == 7) buffer[i++] = '.'; - } - if (time < 0) buffer[i++] = '-'; - - while (i--) rev[j++] = buffer[i]; - while (rev[j-1] == '0' && rev[j-2] != '.') --j; - rev[j] = 0; - - return wine_dbg_sprintf("%s", rev); -} - /* see IAsyncReader::Request on MSDN for the explanation of this */ #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000) #define BYTES_FROM_MEDIATIME(time) ((time) / 10000000) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 5e6cbbab5d5..2374fb6fddd 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -41,27 +41,6 @@ bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size); -static inline const char *debugstr_time(REFERENCE_TIME time) -{ - ULONGLONG abstime = time >= 0 ? time : -time; - unsigned int i = 0, j = 0; - char buffer[23], rev[23]; - - while (abstime || i <= 8) - { - buffer[i++] = '0' + (abstime % 10); - abstime /= 10; - if (i == 7) buffer[i++] = '.'; - } - if (time < 0) buffer[i++] = '-'; - - while (i--) rev[j++] = buffer[i]; - while (rev[j-1] == '0' && rev[j-2] != '.') --j; - rev[j] = 0; - - return wine_dbg_sprintf("%s", rev); -} - #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000) struct wg_sample_queue; diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 1b4cc3f7657..978d1c67160 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -20,6 +20,7 @@ */ #include "dshow.h" +#include "wine/debug.h" HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc); void WINAPI FreeMediaType(AM_MEDIA_TYPE * pMediaType); @@ -28,6 +29,27 @@ void WINAPI DeleteMediaType(AM_MEDIA_TYPE * pMediaType); void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt); +static inline const char *debugstr_time(REFERENCE_TIME time) +{ + ULONGLONG abstime = time >= 0 ? time : -time; + unsigned int i = 0, j = 0; + char buffer[23], rev[23]; + + while (abstime || i <= 8) + { + buffer[i++] = '0' + (abstime % 10); + abstime /= 10; + if (i == 7) buffer[i++] = '.'; + } + if (time < 0) buffer[i++] = '-'; + + while (i--) rev[j++] = buffer[i]; + while (rev[j-1] == '0' && rev[j-2] != '.') --j; + rev[j] = 0; + + return wine_dbg_sprintf("%s", rev); +} + /* Pin functions */ struct strmbase_pin diff --git a/libs/strmbase/strmbase_private.h b/libs/strmbase/strmbase_private.h index cf702a279c2..374b10e7d51 100644 --- a/libs/strmbase/strmbase_private.h +++ b/libs/strmbase/strmbase_private.h @@ -30,25 +30,4 @@ #include "wine/list.h" #include "wine/strmbase.h" -static inline const char *debugstr_time(REFERENCE_TIME time) -{ - ULONGLONG abstime = time >= 0 ? time : -time; - unsigned int i = 0, j = 0; - char buffer[23], rev[23]; - - while (abstime || i <= 8) - { - buffer[i++] = '0' + (abstime % 10); - abstime /= 10; - if (i == 7) buffer[i++] = '.'; - } - if (time < 0) buffer[i++] = '-'; - - while (i--) rev[j++] = buffer[i]; - while (rev[j-1] == '0' && rev[j-2] != '.') --j; - rev[j] = 0; - - return wine_dbg_sprintf("%s", rev); -} - #endif /* __WINE_STRMBASE_PRIVATE_H */
participants (1)
-
Alexandre Julliard