summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/avcomp.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-02-28 22:10:06 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-02-28 22:10:06 +0000
commite2757c60d2fa5e74909eff1e7a48ce5841ad47e5 (patch)
treeb30bddf750ef14f54e147b8d214d693af27f5d33 /src/lib/util/avcomp.c
parent42004cf3baf9c0307775c43096df36c1d5884bf4 (diff)
Modified the makefile to support experimental optional C++
compilation: - new option CPP_COMPILE to trigger this (off by default) - split CFLAGS into common, C-only, and C++-only flags - when enabled, CPP_COMPILE causes 'pp' to be appended to the target name NOTE THAT THE SYSTEM CANNOT ACTUALLY BE COMPILED THIS WAY YET. IT IS JUST AN EXPERIMENT. Modified lib.mak to always build zlib/expat as C regardless of CPP_COMPILE. Modified windows.mak to fix warnings with MAXOPT=1, and to leverage the new CFLAGs definitions. Modified vconv.c to do appropriate conversions for new C++ options. Updated sources so that libutil, libocore (Windows), and libosd (Windows) can be cleanly compiled as C or C++. This was mostly adding some casts against void *. Fixed a few more general obvious problems at random locations in the source: - device->class is now device->devclass - TYPES_COMPATIBLE uses typeid() when compiled for C++ - some functions with reserved names ('xor' in particular) were renamed - nested enums and structs were pulled out into separate definitions (under C++ these would need to be scoped to be referenced) - TOKEN_VALUE cannot use .field=x initialization in C++ :(
Diffstat (limited to 'src/lib/util/avcomp.c')
-rw-r--r--src/lib/util/avcomp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/util/avcomp.c b/src/lib/util/avcomp.c
index c42d100d888..ad3f4fefeee 100644
--- a/src/lib/util/avcomp.c
+++ b/src/lib/util/avcomp.c
@@ -139,7 +139,7 @@ avcomp_state *avcomp_init(UINT32 maxwidth, UINT32 maxheight, UINT32 maxchannels)
return NULL;
/* allocate memory for state block */
- state = malloc(sizeof(*state));
+ state = (avcomp_state *)malloc(sizeof(*state));
if (state == NULL)
return NULL;
@@ -152,7 +152,7 @@ avcomp_state *avcomp_init(UINT32 maxwidth, UINT32 maxheight, UINT32 maxchannels)
state->maxchannels = maxchannels;
/* now allocate data buffers */
- state->audiodata = malloc(65536 * state->maxchannels * 2);
+ state->audiodata = (UINT8 *)malloc(65536 * state->maxchannels * 2);
if (state->audiodata == NULL)
goto cleanup;
@@ -300,7 +300,7 @@ avcomp_error avcomp_encode_data(avcomp_state *state, const UINT8 *source, UINT8
videostride = width = height = 0;
if (state->compress.video != NULL)
{
- videostart = state->compress.video->base;
+ videostart = (const UINT8 *)state->compress.video->base;
videostride = state->compress.video->rowpixels * 2;
width = state->compress.video->width;
height = state->compress.video->height;
@@ -455,7 +455,7 @@ avcomp_error avcomp_decode_data(avcomp_state *state, const UINT8 *source, UINT32
metastart = state->decompress.metadata;
for (chnum = 0; chnum < channels; chnum++)
audiostart[chnum] = (UINT8 *)state->decompress.audio[chnum];
- videostart = (state->decompress.video != NULL) ? state->decompress.video->base : NULL;
+ videostart = (state->decompress.video != NULL) ? (UINT8 *)state->decompress.video->base : NULL;
videostride = (state->decompress.video != NULL) ? state->decompress.video->rowpixels * 2 : 0;
/* data is assumed to be native-endian */