mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-12-03 17:42:40 +00:00
Fix some warnings picked up in an optimized build
This commit is contained in:
parent
c43b9681eb
commit
7406e0308e
4 changed files with 9 additions and 9 deletions
|
@ -1787,7 +1787,7 @@ struct progs_s {
|
||||||
\return C pointer represented by the parameter. 0 offset -> NULL
|
\return C pointer represented by the parameter. 0 offset -> NULL
|
||||||
*/
|
*/
|
||||||
static inline pr_type_t *
|
static inline pr_type_t *
|
||||||
PR_GetPointer (progs_t *pr, pointer_t o)
|
PR_GetPointer (const progs_t *pr, pointer_t o)
|
||||||
{
|
{
|
||||||
return o ? pr->pr_globals + o : 0;
|
return o ? pr->pr_globals + o : 0;
|
||||||
}
|
}
|
||||||
|
@ -1798,9 +1798,9 @@ PR_GetPointer (progs_t *pr, pointer_t o)
|
||||||
\return Progs offset/pointer represented by \c p. NULL -> 0 offset
|
\return Progs offset/pointer represented by \c p. NULL -> 0 offset
|
||||||
*/
|
*/
|
||||||
static inline pointer_t
|
static inline pointer_t
|
||||||
PR_SetPointer (progs_t *pr, void *p)
|
PR_SetPointer (const progs_t *pr, const void *p)
|
||||||
{
|
{
|
||||||
return p ? (pr_type_t *) p - pr->pr_globals : 0;
|
return p ? (const pr_type_t *) p - pr->pr_globals : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
|
@ -92,7 +92,7 @@ Con_BufferAddText (con_buffer_t *buf, const char *text)
|
||||||
}
|
}
|
||||||
while (len--) {
|
while (len--) {
|
||||||
byte c = *pos++ = *text++;
|
byte c = *pos++ = *text++;
|
||||||
if ((size_t) (pos - buf->buffer) >= buf->buffer_size)
|
if (pos >= buf->buffer + buf->buffer_size)
|
||||||
pos = buf->buffer;
|
pos = buf->buffer;
|
||||||
cur_line->len++;
|
cur_line->len++;
|
||||||
if (pos == tail_line->text) {
|
if (pos == tail_line->text) {
|
||||||
|
|
|
@ -196,8 +196,8 @@ pr_debug_expression_error (script_t *script, const char *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RUP(x,a) (((x) + ((a) - 1)) & ~((a) - 1))
|
#define RUP(x,a) (((x) + ((a) - 1)) & ~((a) - 1))
|
||||||
static pr_short_t
|
static pr_short_t __attribute__((pure))
|
||||||
pr_debug_type_size (progs_t *pr, qfot_type_t *type)
|
pr_debug_type_size (const progs_t *pr, const qfot_type_t *type)
|
||||||
{
|
{
|
||||||
pr_short_t size;
|
pr_short_t size;
|
||||||
qfot_type_t *aux_type;
|
qfot_type_t *aux_type;
|
||||||
|
@ -208,7 +208,7 @@ pr_debug_type_size (progs_t *pr, qfot_type_t *type)
|
||||||
case ty_union:
|
case ty_union:
|
||||||
size = 0;
|
size = 0;
|
||||||
for (pr_int_t i = 0; i < type->t.strct.num_fields; i++) {
|
for (pr_int_t i = 0; i < type->t.strct.num_fields; i++) {
|
||||||
qfot_var_t *field = &type->t.strct.fields[i];
|
const qfot_var_t *field = &type->t.strct.fields[i];
|
||||||
aux_type = &G_STRUCT (pr, qfot_type_t, field->type);
|
aux_type = &G_STRUCT (pr, qfot_type_t, field->type);
|
||||||
size = max (size,
|
size = max (size,
|
||||||
field->offset + pr_debug_type_size (pr, aux_type));
|
field->offset + pr_debug_type_size (pr, aux_type));
|
||||||
|
@ -995,7 +995,7 @@ pr_debug_pointer_view (qfot_type_t *type, pr_type_t *value, void *_data)
|
||||||
progs_t *pr = data->pr;
|
progs_t *pr = data->pr;
|
||||||
dstring_t *dstr = data->dstr;
|
dstring_t *dstr = data->dstr;
|
||||||
pointer_t ofs = value->integer_var;
|
pointer_t ofs = value->integer_var;
|
||||||
pr_def_t *def;
|
pr_def_t *def = 0;
|
||||||
|
|
||||||
if (pr_debug->int_val && pr->debug) {
|
if (pr_debug->int_val && pr->debug) {
|
||||||
def = PR_Get_Local_Def (pr, ofs);
|
def = PR_Get_Local_Def (pr, ofs);
|
||||||
|
|
|
@ -891,7 +891,7 @@ qfo_to_progs (qfo_t *qfo, int *size)
|
||||||
int xdefs_start;
|
int xdefs_start;
|
||||||
unsigned big_locals = 0;
|
unsigned big_locals = 0;
|
||||||
int big_func = 0;
|
int big_func = 0;
|
||||||
pr_xdefs_t *xdefs;
|
pr_xdefs_t *xdefs = 0;
|
||||||
xdef_t *xdef;
|
xdef_t *xdef;
|
||||||
|
|
||||||
*size = RUP (sizeof (dprograms_t), 16);
|
*size = RUP (sizeof (dprograms_t), 16);
|
||||||
|
|
Loading…
Reference in a new issue