Compile error+warning fixes for linux

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5109 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-05-28 08:17:25 +00:00
parent 9689f7680e
commit 0fad8fe37d
6 changed files with 18 additions and 8 deletions

View File

@ -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);

View File

@ -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++)

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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};