Use macros to improve safety loading callbacks

Just a minor fix mostly because I noticed that I kept accidentally
forgetting to add checks to the code properly.  This is one of those
cases where macros come in useful, as macros can automate the process
and help prevent these mistakes from happening by accident.
This commit is contained in:
jp9000
2014-01-17 06:24:34 -07:00
parent ff1afac5f8
commit 8d63845dd4
6 changed files with 72 additions and 112 deletions

View File

@@ -32,6 +32,14 @@
#include "obs-service.h"
#include "obs-encoder.h"
#define LOAD_MODULE_SUBFUNC(name, required) \
do { \
info->name = load_module_subfunc(module, module_name, \
id, #name, required); \
if (required && !info->name) \
return false; \
} while (false)
#define NUM_TEXTURES 2
struct obs_display {