From: falcovorbis <fal...@us...> - 2024-09-27 03:46:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 411641379d6ebd2f5c77a0c72b56473bfe27c37d (commit) from d1fd7dc7b7de15950eb8db99e2831a10cb872f7e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 411641379d6ebd2f5c77a0c72b56473bfe27c37d Author: Donald Haase <qu...@ya...> Date: Thu Sep 26 23:46:01 2024 -0400 Clean up usage of `INLINE` in utils (#771) * Just use c99 inline rather than the custom one. When this was originally written it wasn't as widely supported. Clean up unnessary commented out bits. * Remove copy-pasted CFLAGS define. * Clean up copy-pasted CFLAG define and commented out debug option. --------- Co-authored-by: QuzarDC <qu...@co...> Co-authored-by: Falco Girgis <gyr...@gm...> ----------------------------------------------------------------------- Summary of changes: utils/dcbumpgen/Makefile | 2 +- utils/kmgenc/Makefile | 4 ++-- utils/vqenc/Makefile | 11 +++-------- utils/vqenc/vq_internal.h | 22 +++++++++------------- utils/vqenc/vqenc.c | 2 +- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/utils/dcbumpgen/Makefile b/utils/dcbumpgen/Makefile index a681a912..33a7d7c4 100644 --- a/utils/dcbumpgen/Makefile +++ b/utils/dcbumpgen/Makefile @@ -1,7 +1,7 @@ # Makefile stolen from the kmgenc program. -CFLAGS = -O2 -Wall -DINLINE=inline -I/usr/local/include +CFLAGS = -O2 -Wall -I/usr/local/include LDFLAGS = -s -lpng -ljpeg -lm -lz -L/usr/local/lib all: dcbumpgen diff --git a/utils/kmgenc/Makefile b/utils/kmgenc/Makefile index 4f1c6ee1..53c68cae 100644 --- a/utils/kmgenc/Makefile +++ b/utils/kmgenc/Makefile @@ -1,8 +1,8 @@ # Makefile for the kmgenc program. -CFLAGS = -O2 -Wall -DINLINE=inline -I/usr/local/include #-g# -LDFLAGS = -s -lpng -ljpeg -lz -L/usr/local/lib #-g +CFLAGS = -O2 -Wall -I/usr/local/include +LDFLAGS = -s -lpng -ljpeg -lz -L/usr/local/lib all: kmgenc diff --git a/utils/vqenc/Makefile b/utils/vqenc/Makefile index 449c560f..5a0a6686 100644 --- a/utils/vqenc/Makefile +++ b/utils/vqenc/Makefile @@ -1,13 +1,8 @@ -# Makefile for the genromfs program. +# Makefile for the vqenc program. -# Use for OSX w/Fink -#CFLAGS = -O2 -Wall -DINLINE=inline -I/sw/include #-g# -#LDFLAGS = -s -L/sw/lib -lpng -ljpeg -lz #-g - -# Use for other systems -CFLAGS = -O2 -Wall -DINLINE=inline -I/usr/local/include #-g# -LDFLAGS = -lpng -ljpeg -lz -lm -L/usr/local/lib #-s -g +CFLAGS = -O2 -Wall -I/usr/local/include +LDFLAGS = -lpng -ljpeg -lz -lm -L/usr/local/lib all: vqenc diff --git a/utils/vqenc/vq_internal.h b/utils/vqenc/vq_internal.h index d633b1d3..8a82cecd 100644 --- a/utils/vqenc/vq_internal.h +++ b/utils/vqenc/vq_internal.h @@ -4,43 +4,39 @@ #include "vq_types.h" -#ifndef INLINE -#define INLINE -#endif - -static void INLINE get_color(fcolor_t *c, uint8 *pixels) { +static void inline get_color(fcolor_t *c, uint8 *pixels) { c->a = pixels[0]; c->r = pixels[1]; c->g = pixels[2]; c->b = pixels[3]; } -static void INLINE sum_colors(fcolor_t *out, fcolor_t *in) { +static void inline sum_colors(fcolor_t *out, fcolor_t *in) { out->a += in->a; out->r += in->r; out->g += in->g; out->b += in->b; } -static void INLINE div_colors(fcolor_t *out, float v) { +static void inline div_colors(fcolor_t *out, float v) { out->a /= v; out->r /= v; out->g /= v; out->b /= v; } -static void INLINE clear_quad(fquad_t *q) { +static void inline clear_quad(fquad_t *q) { memset(q, '\0', sizeof(*q)); } -static void INLINE add_quad(fquad_t *out, fquad_t *in) { +static void inline add_quad(fquad_t *out, fquad_t *in) { sum_colors(&out->p[0], &in->p[0]); sum_colors(&out->p[1], &in->p[1]); sum_colors(&out->p[2], &in->p[2]); sum_colors(&out->p[3], &in->p[3]); } -static void INLINE sub_quad(fquad_t *out, fquad_t *a, fquad_t *b) { +static void inline sub_quad(fquad_t *out, fquad_t *a, fquad_t *b) { int i; for(i = 0; i < 4; i++) { @@ -51,7 +47,7 @@ static void INLINE sub_quad(fquad_t *out, fquad_t *a, fquad_t *b) { } } -static void INLINE div_quad(fquad_t *q, float v) { +static void inline div_quad(fquad_t *q, float v) { if(v < 1.0f) { clear_quad(q); } @@ -63,8 +59,8 @@ static void INLINE div_quad(fquad_t *q, float v) { } } -static void INLINE copy_quad(fquad_t *out, fquad_t *in) { +static void inline copy_quad(fquad_t *out, fquad_t *in) { *out = *in; } -#endif +#endif /* __VQ_INTERNAL_H */ diff --git a/utils/vqenc/vqenc.c b/utils/vqenc/vqenc.c index f88933c0..5924da41 100644 --- a/utils/vqenc/vqenc.c +++ b/utils/vqenc/vqenc.c @@ -265,7 +265,7 @@ static uint16 pack(fcolor_t *c) { return PACK565(r, g, b); } -static int INLINE le16(int x) { +static int inline le16(int x) { /* Endian test added by Megan. This is probably not too efficient but it's portable and will get the job done. */ unsigned long test = 0x12345678; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |