mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 14:41:42 +00:00
- Make some string functions in g_cmds.c cleaner, by DevHC
- embed VM_FREEBUFFERS() macro in do-while-loop
This commit is contained in:
parent
544a1c0c1a
commit
e05c9ad1c2
4 changed files with 4 additions and 4 deletions
|
@ -76,7 +76,7 @@ void DeathmatchScoreboardMessage( gentity_t *ent ) {
|
||||||
perfect,
|
perfect,
|
||||||
cl->ps.persistant[PERS_CAPTURES]);
|
cl->ps.persistant[PERS_CAPTURES]);
|
||||||
j = strlen(entry);
|
j = strlen(entry);
|
||||||
if (stringlength + j > 1024)
|
if (stringlength + j >= sizeof(string))
|
||||||
break;
|
break;
|
||||||
strcpy (string + stringlength, entry);
|
strcpy (string + stringlength, entry);
|
||||||
stringlength += j;
|
stringlength += j;
|
||||||
|
|
|
@ -1112,7 +1112,7 @@ void TeamplayInfoMessage( gentity_t *ent ) {
|
||||||
i, player->client->pers.teamState.location, h, a,
|
i, player->client->pers.teamState.location, h, a,
|
||||||
player->client->ps.weapon, player->s.powerups);
|
player->client->ps.weapon, player->s.powerups);
|
||||||
j = strlen(entry);
|
j = strlen(entry);
|
||||||
if (stringlength + j > sizeof(string))
|
if (stringlength + j >= sizeof(string))
|
||||||
break;
|
break;
|
||||||
strcpy (string + stringlength, entry);
|
strcpy (string + stringlength, entry);
|
||||||
stringlength += j;
|
stringlength += j;
|
||||||
|
|
|
@ -53,7 +53,7 @@ static void VM_Destroy_Compiled(vm_t* self);
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define VMFREE_BUFFERS() {Z_Free(buf); Z_Free(jused);}
|
#define VMFREE_BUFFERS() do {Z_Free(buf); Z_Free(jused);} while(0)
|
||||||
static byte *buf = NULL;
|
static byte *buf = NULL;
|
||||||
static byte *jused = NULL;
|
static byte *jused = NULL;
|
||||||
static int compiledOfs = 0;
|
static int compiledOfs = 0;
|
||||||
|
|
|
@ -54,7 +54,7 @@ static FILE* qdasmout;
|
||||||
#define Dfprintf(args...)
|
#define Dfprintf(args...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VM_FREEBUFFERS(vm) {assembler_init(0); VM_Destroy_Compiled(vm);}
|
#define VM_FREEBUFFERS(vm) do {assembler_init(0); VM_Destroy_Compiled(vm);} while(0)
|
||||||
|
|
||||||
void assembler_set_output(char* buf);
|
void assembler_set_output(char* buf);
|
||||||
size_t assembler_get_code_size(void);
|
size_t assembler_get_code_size(void);
|
||||||
|
|
Loading…
Reference in a new issue