diff --git a/UI/obf.c b/UI/obf.c index a5bf6fe2a..895be4b68 100644 --- a/UI/obf.c +++ b/UI/obf.c @@ -1,7 +1,7 @@ #include "obf.h" #include -#define LOWER_HALFBYTE(x) ((x)&0xF) +#define LOWER_HALFBYTE(x) ((x) & 0xF) #define UPPER_HALFBYTE(x) (((x) >> 4) & 0xF) void deobfuscate_str(char *str, uint64_t val) diff --git a/libobs/graphics/math-defs.h b/libobs/graphics/math-defs.h index be724c396..f49189a0c 100644 --- a/libobs/graphics/math-defs.h +++ b/libobs/graphics/math-defs.h @@ -28,8 +28,8 @@ extern "C" { #define M_PI 3.1415926535897932384626433832795f #endif -#define RAD(val) ((val)*0.0174532925199432957692369076848f) -#define DEG(val) ((val)*57.295779513082320876798154814105f) +#define RAD(val) ((val) * 0.0174532925199432957692369076848f) +#define DEG(val) ((val) * 57.295779513082320876798154814105f) #define LARGE_EPSILON 1e-2f #define EPSILON 1e-4f #define TINY_EPSILON 1e-5f diff --git a/libobs/util/windows/obfuscate.c b/libobs/util/windows/obfuscate.c index ae19e33d1..7d665752d 100644 --- a/libobs/util/windows/obfuscate.c +++ b/libobs/util/windows/obfuscate.c @@ -6,7 +6,7 @@ #include #include "obfuscate.h" -#define LOWER_HALFBYTE(x) ((x)&0xF) +#define LOWER_HALFBYTE(x) ((x) & 0xF) #define UPPER_HALFBYTE(x) (((x) >> 4) & 0xF) static void deobfuscate_str(char *str, uint64_t val) diff --git a/plugins/mac-capture/mac-sck-audio-capture.m b/plugins/mac-capture/mac-sck-audio-capture.m index 2ad26d50f..32b39cd65 100644 --- a/plugins/mac-capture/mac-sck-audio-capture.m +++ b/plugins/mac-capture/mac-sck-audio-capture.m @@ -68,8 +68,7 @@ static bool init_audio_screen_stream(struct screen_capture *sc) sc->stream_properties = [[SCStreamConfiguration alloc] init]; os_sem_wait(sc->shareable_content_available); - SCDisplay * (^get_target_display)(void) = ^SCDisplay * - { + SCDisplayRef (^get_target_display)(void) = ^SCDisplayRef { for (SCDisplay *display in sc->shareable_content.displays) { if (display.displayID == sc->display) { return display; diff --git a/plugins/mac-capture/mac-sck-common.h b/plugins/mac-capture/mac-sck-common.h index 15ed6e583..32ca8d246 100644 --- a/plugins/mac-capture/mac-sck-common.h +++ b/plugins/mac-capture/mac-sck-common.h @@ -28,6 +28,8 @@ typedef enum { ScreenCaptureAudioApplicationStream = 1, } ScreenCaptureAudioStreamType; +typedef SCDisplay *SCDisplayRef; + @interface ScreenCaptureDelegate : NSObject @property struct screen_capture *sc; diff --git a/plugins/mac-capture/mac-sck-video-capture.m b/plugins/mac-capture/mac-sck-video-capture.m index cdb3f693c..d94a12852 100644 --- a/plugins/mac-capture/mac-sck-video-capture.m +++ b/plugins/mac-capture/mac-sck-video-capture.m @@ -86,8 +86,7 @@ static bool init_screen_stream(struct screen_capture *sc) sc->stream_properties = [[SCStreamConfiguration alloc] init]; os_sem_wait(sc->shareable_content_available); - SCDisplay * (^get_target_display)(void) = ^SCDisplay * - { + SCDisplayRef (^get_target_display)(void) = ^SCDisplayRef { for (SCDisplay *display in sc->shareable_content.displays) { if (display.displayID == sc->display) { return display; diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-rist.h b/plugins/obs-ffmpeg/obs-ffmpeg-rist.h index 215f80ae1..18326d649 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-rist.h +++ b/plugins/obs-ffmpeg/obs-ffmpeg-rist.h @@ -25,7 +25,7 @@ #define RIST_MAX_PAYLOAD_SIZE (10000 - 28) #define FF_LIBRIST_MAKE_VERSION(major, minor, patch) \ - ((patch) + ((minor)*0x100) + ((major)*0x10000)) + ((patch) + ((minor) * 0x100) + ((major) * 0x10000)) #define FF_LIBRIST_VERSION \ FF_LIBRIST_MAKE_VERSION(LIBRIST_API_VERSION_MAJOR, \ LIBRIST_API_VERSION_MINOR, \ diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-url.h b/plugins/obs-ffmpeg/obs-ffmpeg-url.h index 2dd18599c..8bf88e965 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-url.h +++ b/plugins/obs-ffmpeg/obs-ffmpeg-url.h @@ -46,7 +46,7 @@ typedef struct URLContext { //#define LOG_DEBUG 7 // issue w/ libobs #define LOG_PRIMASK 0x07 -#define LOG_PRI(p) ((p)&LOG_PRIMASK) +#define LOG_PRI(p) ((p) & LOG_PRIMASK) #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) #define LOG_KERN (0 << 3) @@ -74,7 +74,7 @@ typedef struct URLContext { #define LOG_NFACILITIES 24 #define LOG_FACMASK 0x03f8 -#define LOG_FAC(p) (((p)&LOG_FACMASK) >> 3) +#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) #endif #endif diff --git a/plugins/vlc-video/vlc-video-plugin.c b/plugins/vlc-video/vlc-video-plugin.c index 5956ba7ab..ab1b91bc2 100644 --- a/plugins/vlc-video/vlc-video-plugin.c +++ b/plugins/vlc-video/vlc-video-plugin.c @@ -179,9 +179,9 @@ static bool load_libvlc_module(void) RegCloseKey(key); #else +/* According to otoolo -L, this is what libvlc.dylib wants. */ #ifdef __APPLE__ #define LIBVLC_DIR "/Applications/VLC.app/Contents/MacOS/" -/* According to otoolo -L, this is what libvlc.dylib wants. */ #define LIBVLC_CORE_FILE LIBVLC_DIR "lib/libvlccore.dylib" #define LIBVLC_FILE LIBVLC_DIR "lib/libvlc.5.dylib" setenv("VLC_PLUGIN_PATH", LIBVLC_DIR "plugins", false); diff --git a/plugins/win-capture/graphics-hook/vulkan-capture.c b/plugins/win-capture/graphics-hook/vulkan-capture.c index 698002f0e..e6266f3e9 100644 --- a/plugins/win-capture/graphics-hook/vulkan-capture.c +++ b/plugins/win-capture/graphics-hook/vulkan-capture.c @@ -2213,6 +2213,7 @@ static void VKAPI_CALL OBS_DestroySurfaceKHR(VkInstance inst, VkSurfaceKHR surf, destroy_surface(inst, surf, ac); } +/* clang-format off */ #define GETPROCADDR(func) \ if (!strcmp(pName, "vk" #func)) \ return (PFN_vkVoidFunction)&OBS_##func; @@ -2220,6 +2221,7 @@ static void VKAPI_CALL OBS_DestroySurfaceKHR(VkInstance inst, VkSurfaceKHR surf, #define GETPROCADDR_IF_SUPPORTED(func) \ if (!strcmp(pName, "vk" #func)) \ return funcs->func ? (PFN_vkVoidFunction)&OBS_##func : NULL; +/* clang-format on */ static PFN_vkVoidFunction VKAPI_CALL OBS_GetDeviceProcAddr(VkDevice device, const char *pName) diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index fcd3c8ed7..547665655 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -1308,7 +1308,7 @@ static inline void AddCap(vector &resolutions, const VideoInfo &cap) } #define MAKE_DSHOW_FPS(fps) (10000000LL / (fps)) -#define MAKE_DSHOW_FRACTIONAL_FPS(den, num) ((num)*10000000LL / (den)) +#define MAKE_DSHOW_FRACTIONAL_FPS(den, num) ((num) * 10000000LL / (den)) static long long GetOBSFPS() {