From d5816d44f337c6eb82d937959f971fe45a5eec2a Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 7 Dec 2019 17:03:46 -0800 Subject: [PATCH 1/4] Use a third variable of XOR nonsense --- src/strcasestr.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/strcasestr.c b/src/strcasestr.c index 86c7ec5b0..4ff778bf1 100644 --- a/src/strcasestr.c +++ b/src/strcasestr.c @@ -23,13 +23,6 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define SWAP( a, b ) \ -(\ - (a) ^= (b),\ - (b) ^= (a),\ - (a) ^= (b)\ -) - static inline int trycmp (char **pp, char *cp, const char *q, size_t qn) @@ -45,8 +38,16 @@ trycmp (char **pp, char *cp, static inline void swapp (char ***ppap, char ***ppbp, char **cpap, char **cpbp) { - SWAP(*(intptr_t *)ppap, *(intptr_t *)ppbp); - SWAP(*(intptr_t *)cpap, *(intptr_t *)cpbp); + char **pp; + char *p; + + pp = *ppap; + *ppap = *ppbp; + *ppbp = pp; + + p = *cpap; + *cpap = *cpbp; + *cpbp = p; } char * From 35168ddeae00b2552a785ccc346103c4665cc36b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 8 Dec 2019 12:32:23 -0500 Subject: [PATCH 2/4] OpenGL: yflip is used to hold more then true/false --- src/hardware/r_opengl/r_opengl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 25bcf153b..7bab9d321 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -1435,7 +1435,7 @@ static const boolean gl_ext_arb_vertex_buffer_object = true; // The texture offset to be applied to the texture coordinates in SkyVertex(). static int rows, columns; -static boolean yflip; +static signed char yflip; static int texw, texh; static boolean foglayer; static float delta = 0.0f; From 623629b04ab72071e6ea4f0c4a3245e6cde72e2c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 8 Dec 2019 12:33:11 -0500 Subject: [PATCH 3/4] OpenGL: note that the Buffer API is OpenGL 1.5, so we can be used in STATIC_OPENGL --- src/hardware/r_opengl/r_opengl.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 7bab9d321..b85b75c24 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -221,11 +221,6 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...) #define pglDrawElements glDrawElements #define pglEnableClientState glEnableClientState #define pglDisableClientState glDisableClientState -#define pglClientActiveTexture glClientActiveTexture -#define pglGenBuffers glGenBuffers -#define pglBindBuffer glBindBuffer -#define pglBufferData glBufferData -#define pglDeleteBuffers glDeleteBuffers /* Lighting */ #define pglShadeModel glShadeModel @@ -331,15 +326,6 @@ typedef void (APIENTRY * PFNglEnableClientState) (GLenum cap); static PFNglEnableClientState pglEnableClientState; typedef void (APIENTRY * PFNglDisableClientState) (GLenum cap); static PFNglDisableClientState pglDisableClientState; -typedef void (APIENTRY * PFNglGenBuffers) (GLsizei n, GLuint *buffers); -static PFNglGenBuffers pglGenBuffers; -typedef void (APIENTRY * PFNglBindBuffer) (GLenum target, GLuint buffer); -static PFNglBindBuffer pglBindBuffer; -typedef void (APIENTRY * PFNglBufferData) (GLenum target, GLsizei size, const GLvoid *data, GLenum usage); -static PFNglBufferData pglBufferData; -typedef void (APIENTRY * PFNglDeleteBuffers) (GLsizei n, const GLuint *buffers); -static PFNglDeleteBuffers pglDeleteBuffers; - /* Lighting */ typedef void (APIENTRY * PFNglShadeModel) (GLenum mode); @@ -397,6 +383,17 @@ static PFNglMultiTexCoord2fv pglMultiTexCoord2fv; typedef void (APIENTRY *PFNglClientActiveTexture) (GLenum); static PFNglClientActiveTexture pglClientActiveTexture; +/* 1.5 functions for buffers */ +typedef void (APIENTRY * PFNglGenBuffers) (GLsizei n, GLuint *buffers); +static PFNglGenBuffers pglGenBuffers; +typedef void (APIENTRY * PFNglBindBuffer) (GLenum target, GLuint buffer); +static PFNglBindBuffer pglBindBuffer; +typedef void (APIENTRY * PFNglBufferData) (GLenum target, GLsizei size, const GLvoid *data, GLenum usage); +static PFNglBufferData pglBufferData; +typedef void (APIENTRY * PFNglDeleteBuffers) (GLsizei n, const GLuint *buffers); +static PFNglDeleteBuffers pglDeleteBuffers; + + /* 1.2 Parms */ /* GL_CLAMP_TO_EDGE_EXT */ #ifndef GL_CLAMP_TO_EDGE @@ -512,6 +509,8 @@ boolean SetupGLFunc13(void) pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f"); pglClientActiveTexture = GetGLFunc("glClientActiveTexture"); pglMultiTexCoord2fv = GetGLFunc("glMultiTexCoord2fv"); + + /* 1.5 funcs */ pglGenBuffers = GetGLFunc("glGenBuffers"); pglBindBuffer = GetGLFunc("glBindBuffer"); pglBufferData = GetGLFunc("glBufferData"); From 1d0cd586ba33f91aa6bedf118133b1c44cb45c38 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 8 Dec 2019 12:35:21 -0500 Subject: [PATCH 4/4] P_AddWadFile: the PK3 may not have folders --- src/p_setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 673a9024e..3c45509ee 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3380,10 +3380,10 @@ boolean P_AddWadFile(const char *wadfilename) // WADs use markers for some resources, but others such as sounds are checked lump-by-lump anyway. // UINT16 luaPos, luaNum = 0; // UINT16 socPos, socNum = 0; - UINT16 sfxPos, sfxNum = 0; + UINT16 sfxPos = 0, sfxNum = 0; UINT16 musPos = 0, musNum = 0; // UINT16 sprPos, sprNum = 0; - UINT16 texPos, texNum = 0; + UINT16 texPos = 0, texNum = 0; // UINT16 patPos, patNum = 0; // UINT16 flaPos, flaNum = 0; // UINT16 mapPos, mapNum = 0;