From 0fad8fe37d64532f6df103c60762b76a16236ab5 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 28 May 2017 08:17:25 +0000 Subject: [PATCH] Compile error+warning fixes for linux git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5109 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_pred.c | 1 + engine/client/image.c | 2 -- engine/client/sys_linux.c | 2 ++ engine/common/net_ssl_gnutls.c | 16 +++++++++++++--- engine/qclib/qcc_pr_comp.c | 2 +- engine/vk/vk_init.c | 3 +-- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/engine/client/cl_pred.c b/engine/client/cl_pred.c index d6ce621aa..65043586e 100644 --- a/engine/client/cl_pred.c +++ b/engine/client/cl_pred.c @@ -830,6 +830,7 @@ void CL_PredictEntityMovement(entity_state_t *estate, float age) { VectorClear(startstate.velocity); startstate.onground = false; + startstate.jump_held = false; CL_EntStateToPlayerState(&startstate, estate); CL_EntStateToPlayerCommand(&cmd, estate, age); diff --git a/engine/client/image.c b/engine/client/image.c index 711fc8ac0..a8ab49c9d 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -1673,7 +1673,6 @@ qboolean screenshotJPEG(char *filename, enum fs_relative fsroot, int compression size_t ps = (fmt == TF_BGR24)?3:4; qbyte *in=screendata, *out=rgbdata=Hunk_TempAlloc(screenwidth*screenheight*3); size_t y, x; - size_t sz = screenwidth*screenheight; for (y = 0; y < screenheight; y++) { for (x = 0; x < screenwidth; x++) @@ -1699,7 +1698,6 @@ qboolean screenshotJPEG(char *filename, enum fs_relative fsroot, int compression size_t ps = (fmt == TF_RGB24)?3:4; qbyte *in=screendata, *out=rgbdata=Hunk_TempAlloc(screenwidth*screenheight*3); size_t y, x; - size_t sz = screenwidth*screenheight; for (y = 0; y < screenheight; y++) { for (x = 0; x < screenwidth; x++) diff --git a/engine/client/sys_linux.c b/engine/client/sys_linux.c index e1a4ba772..996dad91c 100644 --- a/engine/client/sys_linux.c +++ b/engine/client/sys_linux.c @@ -952,12 +952,14 @@ int main (int c, const char **v) fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY); #endif +#ifndef CLIENTONLY #ifdef SUBSERVERS if (COM_CheckParm("-clusterslave")) isDedicated = nostdout = isClusterSlave = true; #endif if (COM_CheckParm("-dedicated")) isDedicated = true; +#endif if (COM_CheckParm("-nostdout")) nostdout = 1; diff --git a/engine/common/net_ssl_gnutls.c b/engine/common/net_ssl_gnutls.c index bd3469c9a..9f46c975d 100644 --- a/engine/common/net_ssl_gnutls.c +++ b/engine/common/net_ssl_gnutls.c @@ -340,7 +340,9 @@ typedef struct neterr_t(*cbpush)(void *cbctx, const qbyte *data, size_t datasize); qbyte *readdata; size_t readsize; +#ifdef HAVE_DTLS gnutls_dtls_prestate_st prestate; +#endif // int mtu; } gnutlsfile_t; @@ -687,19 +689,23 @@ static ssize_t DTLS_Pull(gnutls_transport_ptr_t p, void *data, size_t size) return size; } } +#ifdef HAVE_DTLS static int DTLS_Pull_Timeout(gnutls_transport_ptr_t p, unsigned int timeout) { //gnutls (pointlessly) requires this function for dtls. gnutlsfile_t *f = p; // Sys_Printf("DTLS_Pull_Timeout %i, %i\n", timeout, f->readsize); return f->readsize>0?1:0; } +#endif #ifdef USE_ANON static gnutls_anon_client_credentials_t anoncred[2]; #else static gnutls_certificate_credentials_t xcred[2]; #endif +#ifdef HAVE_DTLS static gnutls_datum_t cookie_key; +#endif qboolean SSL_InitGlobal(qboolean isserver) { @@ -714,8 +720,10 @@ qboolean SSL_InitGlobal(qboolean isserver) initstatus[isserver] = true; qgnutls_global_init (); +#ifdef HAVE_DTLS if (isserver) qgnutls_key_generate(&cookie_key, GNUTLS_COOKIE_KEY_SIZE); +#endif #ifdef USE_ANON @@ -736,9 +744,9 @@ qboolean SSL_InitGlobal(qboolean isserver) char keyfile[MAX_OSPATH]; char certfile[MAX_OSPATH]; *keyfile = *certfile = 0; - if (FS_NativePath("key.pem", FS_ROOT, keyfile, sizeof(keyfile)) - if (FS_NativePath("cert.pem", FS_ROOT, certfile, sizeof(certfile)) - ret = qgnutls_certificate_set_x509_key_file(xcred[isserver], certfile, keyfile, GNUTLS_X509_FMT_PEM); + if (FS_NativePath("key.pem", FS_ROOT, keyfile, sizeof(keyfile))) + if (FS_NativePath("cert.pem", FS_ROOT, certfile, sizeof(certfile))) + ret = qgnutls_certificate_set_x509_key_file(xcred[isserver], certfile, keyfile, GNUTLS_X509_FMT_PEM); if (ret < 0) { Con_Printf("No certificate or key were found in %s and %s\n", certfile, keyfile); @@ -783,8 +791,10 @@ qboolean SSL_InitConnection(gnutlsfile_t *newf, qboolean isserver, qboolean data qgnutls_transport_set_push_function(newf->session, datagram?DTLS_Push:SSL_Push); //qgnutls_transport_set_vec_push_function(newf->session, SSL_PushV); qgnutls_transport_set_pull_function(newf->session, datagram?DTLS_Pull:SSL_Pull); +#ifdef HAVE_DTLS if (datagram) qgnutls_transport_set_pull_timeout_function(newf->session, DTLS_Pull_Timeout); +#endif // if (isserver) //don't bother to auth any client certs // qgnutls_certificate_server_set_request(newf->session, GNUTLS_CERT_IGNORE); diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index 37597d42b..4420d6f38 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -9956,7 +9956,7 @@ void QCC_PR_ParseStatement (void) { //optres_compound_jumps++; QCC_FreeTemp(e); - if (!eval->_float != wasuntil) + if ((!eval->_float) != wasuntil) QCC_FreeTemp(QCC_PR_Statement (&pr_opcodes[OP_GOTO], nullsref, nullsref, &patch1)); else patch1 = NULL; diff --git a/engine/vk/vk_init.c b/engine/vk/vk_init.c index a889d01d7..3fc3f7033 100644 --- a/engine/vk/vk_init.c +++ b/engine/vk/vk_init.c @@ -251,7 +251,7 @@ static qboolean VK_CreateSwapChain(void) uint32_t i, curpri; VkSwapchainKHR newvkswapchain; VkImage *images; - VkImage *memories; + VkDeviceMemory *memories; VkImageView attachments[2]; VkFramebufferCreateInfo fb_info = {VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO}; @@ -1977,7 +1977,6 @@ void VKVID_QueueGetRGBData (void (*gotrgbdata) (void *rgbdata, intptr_t bytest vkscreencapture_t *capt; VkBufferImageCopy icpy; - VkImageSubresource subres = {0}; VkMemoryRequirements mem_reqs; VkMemoryAllocateInfo memAllocInfo = {VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO};