diff options
author | 2009-02-28 22:10:06 +0000 | |
---|---|---|
committer | 2009-02-28 22:10:06 +0000 | |
commit | e2757c60d2fa5e74909eff1e7a48ce5841ad47e5 (patch) | |
tree | b30bddf750ef14f54e147b8d214d693af27f5d33 /src/lib/util/palette.c | |
parent | 42004cf3baf9c0307775c43096df36c1d5884bf4 (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/palette.c')
-rw-r--r-- | src/lib/util/palette.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/util/palette.c b/src/lib/util/palette.c index e553157d614..e0854d820eb 100644 --- a/src/lib/util/palette.c +++ b/src/lib/util/palette.c @@ -107,7 +107,7 @@ palette_t *palette_alloc(UINT32 numcolors, UINT32 numgroups) UINT32 index; /* allocate memory */ - palette = malloc(sizeof(*palette)); + palette = (palette_t *)malloc(sizeof(*palette)); if (palette == NULL) goto error; memset(palette, 0, sizeof(*palette)); @@ -120,8 +120,8 @@ palette_t *palette_alloc(UINT32 numcolors, UINT32 numgroups) palette->gamma_map[index] = index; /* allocate an array of palette entries and individual contrasts for each */ - palette->entry_color = malloc(sizeof(*palette->entry_color) * numcolors); - palette->entry_contrast = malloc(sizeof(*palette->entry_contrast) * numcolors); + palette->entry_color = (rgb_t *)malloc(sizeof(*palette->entry_color) * numcolors); + palette->entry_contrast = (float *)malloc(sizeof(*palette->entry_contrast) * numcolors); if (palette->entry_color == NULL || palette->entry_contrast == NULL) goto error; @@ -133,8 +133,8 @@ palette_t *palette_alloc(UINT32 numcolors, UINT32 numgroups) } /* allocate an array of brightness and contrast for each group */ - palette->group_bright = malloc(sizeof(*palette->group_bright) * numgroups); - palette->group_contrast = malloc(sizeof(*palette->group_contrast) * numgroups); + palette->group_bright = (float *)malloc(sizeof(*palette->group_bright) * numgroups); + palette->group_contrast = (float *)malloc(sizeof(*palette->group_contrast) * numgroups); if (palette->group_bright == NULL || palette->group_contrast == NULL) goto error; @@ -146,8 +146,8 @@ palette_t *palette_alloc(UINT32 numcolors, UINT32 numgroups) } /* allocate arrays for the adjusted colors */ - palette->adjusted_color = malloc(sizeof(*palette->adjusted_color) * (numcolors * numgroups + 2)); - palette->adjusted_rgb15 = malloc(sizeof(*palette->adjusted_rgb15) * (numcolors * numgroups + 2)); + palette->adjusted_color = (rgb_t *)malloc(sizeof(*palette->adjusted_color) * (numcolors * numgroups + 2)); + palette->adjusted_rgb15 = (rgb_t *)malloc(sizeof(*palette->adjusted_rgb15) * (numcolors * numgroups + 2)); if (palette->adjusted_color == NULL || palette->adjusted_rgb15 == NULL) goto error; @@ -280,14 +280,14 @@ palette_client *palette_client_alloc(palette_t *palette) palette_client *client; /* allocate memory for the client */ - client = malloc(sizeof(*client)); + client = (palette_client *)malloc(sizeof(*client)); if (client == NULL) goto error; memset(client, 0, sizeof(*client)); /* allocate dirty lists */ - client->live.dirty = malloc(dirty_dwords * sizeof(UINT32)); - client->previous.dirty = malloc(dirty_dwords * sizeof(UINT32)); + client->live.dirty = (UINT32 *)malloc(dirty_dwords * sizeof(UINT32)); + client->previous.dirty = (UINT32 *)malloc(dirty_dwords * sizeof(UINT32)); if (client->live.dirty == NULL || client->previous.dirty == NULL) goto error; |