[media] fix up oiio/null implementations

This commit is contained in:
nick black 2021-03-20 09:08:25 -04:00
parent fceb0b5182
commit 7bcc68136d
2 changed files with 6 additions and 3 deletions

View File

@ -79,7 +79,7 @@ void none_printbanner(const notcurses* nc){
fprintf(stderr, "\n Warning! Notcurses was built without multimedia support.\n");
}
const static ncvisual_implementation none_impl = {
static const ncvisual_implementation none_impl = {
.visual_init = none_init,
.visual_printbanner = none_printbanner,
.visual_blit = none_blit,

View File

@ -18,7 +18,10 @@ typedef struct ncvisual_details {
auto oiio_details_init(void) -> ncvisual_details* {
auto deets = static_cast<ncvisual_details*>(malloc(sizeof(ncvisual_details)));
if(deets){
memset(deets, 0, sizeof(*deets));
deets->image = nullptr;
deets->frame = nullptr;
deets->ibuf = nullptr;
deets->framenum = 0;
}
return deets;
}
@ -31,7 +34,7 @@ auto oiio_details_destroy(ncvisual_details* deets) -> void {
}
auto oiio_create() -> ncvisual* {
auto nc = static_cast<ncvisual*>(malloc(sizeof(*nc)));
auto nc = static_cast<ncvisual*>(malloc(sizeof(ncvisual)));
if(nc){
memset(nc, 0, sizeof(*nc));
if((nc->details = oiio_details_init()) == nullptr){