Use bzalloc instead of bmalloc then memset

Reduces needless code repetition and still allows for proper memory
alignment.  Cleans up the code a bit.
This commit is contained in:
jp9000
2014-02-09 12:34:07 -07:00
parent 6ffcd5e74e
commit b067440f73
32 changed files with 58 additions and 113 deletions

View File

@@ -8,12 +8,10 @@ const char *random_getname(const char *locale)
struct random_tex *random_create(const char *settings, obs_source_t source)
{
struct random_tex *rt = bmalloc(sizeof(struct random_tex));
struct random_tex *rt = bzalloc(sizeof(struct random_tex));
uint32_t *pixels = bmalloc(20*20*4);
size_t x, y;
memset(rt, 0, sizeof(struct random_tex));
for (y = 0; y < 20; y++) {
for (x = 0; x < 20; x++) {
uint32_t pixel = 0xFF000000;