Remove majority of warnings
There were a *lot* of warnings, managed to remove most of them. Also, put warning flags before C_FLAGS and CXX_FLAGS, rather than after, as -Wall -Wextra was overwriting flags that came before it.
This commit is contained in:
@@ -22,22 +22,21 @@ struct desktop_tex {
|
||||
IOSurfaceRef current, prev;
|
||||
};
|
||||
|
||||
static IOSurfaceRef current = NULL,
|
||||
prev = NULL;
|
||||
static pthread_mutex_t c_mutex;
|
||||
|
||||
static const char *osx_desktop_test_getname(const char *locale)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "OSX Monitor Capture";
|
||||
}
|
||||
|
||||
static void osx_desktop_test_destroy(struct desktop_tex *rt)
|
||||
static void osx_desktop_test_destroy(void *data)
|
||||
{
|
||||
struct desktop_tex *rt = data;
|
||||
|
||||
if (rt) {
|
||||
pthread_mutex_lock(&rt->mutex);
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
if (current) {
|
||||
if (rt->current) {
|
||||
IOSurfaceDecrementUseCount(rt->current);
|
||||
CFRelease(rt->current);
|
||||
}
|
||||
@@ -54,8 +53,7 @@ static void osx_desktop_test_destroy(struct desktop_tex *rt)
|
||||
}
|
||||
}
|
||||
|
||||
static struct desktop_tex *osx_desktop_test_create(const char *settings,
|
||||
obs_source_t source)
|
||||
static void *osx_desktop_test_create(obs_data_t settings, obs_source_t source)
|
||||
{
|
||||
struct desktop_tex *rt = bzalloc(sizeof(struct desktop_tex));
|
||||
char *effect_file;
|
||||
@@ -123,6 +121,10 @@ static struct desktop_tex *osx_desktop_test_create(const char *settings,
|
||||
CFRetain(rt->current);
|
||||
IOSurfaceIncrementUseCount(rt->current);
|
||||
pthread_mutex_unlock(&rt->mutex);
|
||||
|
||||
UNUSED_PARAMETER(status);
|
||||
UNUSED_PARAMETER(displayTime);
|
||||
UNUSED_PARAMETER(updateRef);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -133,12 +135,15 @@ static struct desktop_tex *osx_desktop_test_create(const char *settings,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
UNUSED_PARAMETER(source);
|
||||
UNUSED_PARAMETER(settings);
|
||||
return rt;
|
||||
}
|
||||
|
||||
static void osx_desktop_test_video_render(struct desktop_tex *rt,
|
||||
obs_source_t filter_target)
|
||||
static void osx_desktop_test_video_render(void *data, effect_t effect)
|
||||
{
|
||||
struct desktop_tex *rt = data;
|
||||
|
||||
pthread_mutex_lock(&rt->mutex);
|
||||
|
||||
if (rt->prev != rt->current) {
|
||||
@@ -166,15 +171,19 @@ static void osx_desktop_test_video_render(struct desktop_tex *rt,
|
||||
|
||||
fail:
|
||||
pthread_mutex_unlock(&rt->mutex);
|
||||
|
||||
UNUSED_PARAMETER(effect);
|
||||
}
|
||||
|
||||
static uint32_t osx_desktop_test_getwidth(struct desktop_tex *rt)
|
||||
static uint32_t osx_desktop_test_getwidth(void *data)
|
||||
{
|
||||
struct desktop_tex *rt = data;
|
||||
return rt->width;
|
||||
}
|
||||
|
||||
static uint32_t osx_desktop_test_getheight(struct desktop_tex *rt)
|
||||
static uint32_t osx_desktop_test_getheight(void *data)
|
||||
{
|
||||
struct desktop_tex *rt = data;
|
||||
return rt->height;
|
||||
}
|
||||
|
||||
|
@@ -7,11 +7,14 @@ struct test_filter {
|
||||
|
||||
static const char *filter_getname(const char *locale)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "Test";
|
||||
}
|
||||
|
||||
static void filter_destroy(struct test_filter *tf)
|
||||
static void filter_destroy(void *data)
|
||||
{
|
||||
struct test_filter *tf = data;
|
||||
|
||||
if (tf) {
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
@@ -22,8 +25,7 @@ static void filter_destroy(struct test_filter *tf)
|
||||
}
|
||||
}
|
||||
|
||||
static struct test_filter *filter_create(obs_data_t settings,
|
||||
obs_source_t source)
|
||||
static void *filter_create(obs_data_t settings, obs_source_t source)
|
||||
{
|
||||
struct test_filter *tf = bzalloc(sizeof(struct test_filter));
|
||||
char *effect_file;
|
||||
@@ -42,13 +44,17 @@ static struct test_filter *filter_create(obs_data_t settings,
|
||||
|
||||
gs_leavecontext();
|
||||
|
||||
UNUSED_PARAMETER(settings);
|
||||
return tf;
|
||||
}
|
||||
|
||||
static void filter_render(struct test_filter *tf, effect_t effect)
|
||||
static void filter_render(void *data, effect_t effect)
|
||||
{
|
||||
struct test_filter *tf = data;
|
||||
obs_source_process_filter(tf->source, tf->whatever, 0, 0, GS_RGBA,
|
||||
ALLOW_DIRECT_RENDERING);
|
||||
|
||||
UNUSED_PARAMETER(effect);
|
||||
}
|
||||
|
||||
struct obs_source_info test_filter = {
|
||||
|
@@ -20,5 +20,6 @@ bool obs_module_load(uint32_t libobs_version)
|
||||
obs_register_source(&osx_desktop);
|
||||
#endif
|
||||
|
||||
UNUSED_PARAMETER(libobs_version);
|
||||
return true;
|
||||
}
|
||||
|
@@ -7,11 +7,14 @@ struct random_tex {
|
||||
|
||||
static const char *random_getname(const char *locale)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "20x20 Random Pixel Texture Source (Test)";
|
||||
}
|
||||
|
||||
static void random_destroy(struct random_tex *rt)
|
||||
static void random_destroy(void *data)
|
||||
{
|
||||
struct random_tex *rt = data;
|
||||
|
||||
if (rt) {
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
@@ -22,8 +25,7 @@ static void random_destroy(struct random_tex *rt)
|
||||
}
|
||||
}
|
||||
|
||||
static struct random_tex *random_create(obs_data_t settings,
|
||||
obs_source_t source)
|
||||
static void *random_create(obs_data_t settings, obs_source_t source)
|
||||
{
|
||||
struct random_tex *rt = bzalloc(sizeof(struct random_tex));
|
||||
uint32_t *pixels = bmalloc(20*20*4);
|
||||
@@ -53,23 +55,28 @@ static struct random_tex *random_create(obs_data_t settings,
|
||||
|
||||
gs_leavecontext();
|
||||
|
||||
UNUSED_PARAMETER(settings);
|
||||
UNUSED_PARAMETER(source);
|
||||
return rt;
|
||||
}
|
||||
|
||||
static void random_video_render(struct random_tex *rt, effect_t effect)
|
||||
static void random_video_render(void *data, effect_t effect)
|
||||
{
|
||||
struct random_tex *rt = data;
|
||||
eparam_t image = effect_getparambyname(effect, "image");
|
||||
effect_settexture(effect, image, rt->texture);
|
||||
gs_draw_sprite(rt->texture, 0, 0, 0);
|
||||
}
|
||||
|
||||
static uint32_t random_getwidth(struct random_tex *rt)
|
||||
static uint32_t random_getwidth(void *data)
|
||||
{
|
||||
struct random_tex *rt = data;
|
||||
return texture_getwidth(rt->texture);
|
||||
}
|
||||
|
||||
static uint32_t random_getheight(struct random_tex *rt)
|
||||
static uint32_t random_getheight(void *data)
|
||||
{
|
||||
struct random_tex *rt = data;
|
||||
return texture_getheight(rt->texture);
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,10 @@ struct sinewave_data {
|
||||
/* middle C */
|
||||
static const double rate = 261.63/48000.0;
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
|
||||
#define M_PI_X2 M_PI*2
|
||||
|
||||
static void *sinewave_thread(void *pdata)
|
||||
@@ -57,11 +60,14 @@ static void *sinewave_thread(void *pdata)
|
||||
|
||||
static const char *sinewave_getname(const char *locale)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "Sinewave Sound Source (Test)";
|
||||
}
|
||||
|
||||
static void sinewave_destroy(struct sinewave_data *swd)
|
||||
static void sinewave_destroy(void *data)
|
||||
{
|
||||
struct sinewave_data *swd = data;
|
||||
|
||||
if (swd) {
|
||||
if (swd->initialized_thread) {
|
||||
void *ret;
|
||||
@@ -74,7 +80,7 @@ static void sinewave_destroy(struct sinewave_data *swd)
|
||||
}
|
||||
}
|
||||
|
||||
static struct sinewave_data *sinewave_create(obs_data_t settings,
|
||||
static void *sinewave_create(obs_data_t settings,
|
||||
obs_source_t source)
|
||||
{
|
||||
struct sinewave_data *swd = bzalloc(sizeof(struct sinewave_data));
|
||||
@@ -86,6 +92,8 @@ static struct sinewave_data *sinewave_create(obs_data_t settings,
|
||||
goto fail;
|
||||
|
||||
swd->initialized_thread = true;
|
||||
|
||||
UNUSED_PARAMETER(settings);
|
||||
return swd;
|
||||
|
||||
fail:
|
||||
|
Reference in New Issue
Block a user