mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-30 07:41:16 +00:00
Fix compiler warnings (#4887)
This commit is contained in:
parent
e2e8b566e7
commit
92495a70bc
1 changed files with 10 additions and 1 deletions
|
@ -20,6 +20,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
===========================================================================
|
===========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define _ISOC99_SOURCE
|
||||||
|
|
||||||
|
#include "vm_local.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -238,9 +241,15 @@ static void hash_add_label(const char* label, unsigned address)
|
||||||
{
|
{
|
||||||
struct hashentry* h;
|
struct hashentry* h;
|
||||||
unsigned i = hashkey(label, -1U);
|
unsigned i = hashkey(label, -1U);
|
||||||
|
int labellen;
|
||||||
|
|
||||||
i %= sizeof(labelhash)/sizeof(labelhash[0]);
|
i %= sizeof(labelhash)/sizeof(labelhash[0]);
|
||||||
h = malloc(sizeof(struct hashentry));
|
h = malloc(sizeof(struct hashentry));
|
||||||
h->label = strdup(label);
|
|
||||||
|
labellen = strlen(label);
|
||||||
|
h->label = malloc(labellen);
|
||||||
|
Com_sprintf(h->label, labellen, "%s", label);
|
||||||
|
|
||||||
h->address = address;
|
h->address = address;
|
||||||
h->next = labelhash[i];
|
h->next = labelhash[i];
|
||||||
labelhash[i] = h;
|
labelhash[i] = h;
|
||||||
|
|
Loading…
Reference in a new issue