Update source code formatting with clang-format 17.0.3

Added SCDisplayRef type alias to fix a quirk of this specific
clang-format version with ObjC block syntax.
This commit is contained in:
PatTheMav 2024-02-28 21:45:32 +01:00 committed by Ryan Foster
parent dd3255815c
commit f4733ec6a2
11 changed files with 15 additions and 13 deletions

View file

@ -1,7 +1,7 @@
#include "obf.h"
#include <stdbool.h>
#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)

View file

@ -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

View file

@ -6,7 +6,7 @@
#include <windows.h>
#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)

View file

@ -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;

View file

@ -28,6 +28,8 @@ typedef enum {
ScreenCaptureAudioApplicationStream = 1,
} ScreenCaptureAudioStreamType;
typedef SCDisplay *SCDisplayRef;
@interface ScreenCaptureDelegate : NSObject <SCStreamOutput, SCStreamDelegate>
@property struct screen_capture *sc;

View file

@ -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;

View file

@ -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, \

View file

@ -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

View file

@ -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);

View file

@ -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)

View file

@ -1308,7 +1308,7 @@ static inline void AddCap(vector<Resolution> &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()
{