fixed gcc 4.7 warnings about variables set but unused

This commit is contained in:
Charlie Gordon 2013-11-23 19:11:13 +00:00
commit ba06d7883e
5 changed files with 23 additions and 19 deletions

View file

@ -219,7 +219,8 @@ static const ArabicChar *find_char(int ch)
int arab_join(unsigned int *line, __unused__ unsigned int *ctog, int len)
{
int a, b, c, i, j, res;
const ArabicChar *aa, *bb, *cc;
//const ArabicChar *aa;
const ArabicChar *bb, *cc;
a = 0;
for (i = 0; i < len;) {
@ -234,7 +235,7 @@ int arab_join(unsigned int *line, __unused__ unsigned int *ctog, int len)
i++;
}
/* apply Unicode Arabic substitution rules */
aa = find_char(a); /* previous */
//aa = find_char(a); /* previous */
bb = find_char(b); /* current */
cc = find_char(c); /* next */

View file

@ -243,7 +243,7 @@ void eb_insert_buffer(EditBuffer *dest, int dest_offset,
int size)
{
Page *p, *p_start, *q;
int size_start, len, n, page_index;
int len, n, page_index;
if (dest->flags & BF_READONLY)
return;
@ -295,7 +295,6 @@ void eb_insert_buffer(EditBuffer *dest, int dest_offset,
/* compute the number of complete pages to insert */
p_start = p;
size_start = size;
while (size > 0 && p->size <= size) {
size -= p->size;
p++;

13
clang.c
View file

@ -425,9 +425,11 @@ static void do_c_indent(EditState *s)
state = INDENT_FIND_EQ;
}
} else {
/* XXX: syntax check ? */
stack_ptr--;
goto check_instr;
if (stack[--stack_ptr] != '}') {
/* XXX: syntax check ? */
goto check_instr;
}
goto check_instr;
}
break;
case ')':
@ -442,8 +444,9 @@ static void do_c_indent(EditState *s)
pos = find_pos(s, buf, p - buf) + 1;
goto end_parse;
} else {
/* XXX: syntax check ? */
stack_ptr--;
if (stack[--stack_ptr] != (c == '(' ? ')' : ']')) {
/* XXX: syntax check ? */
}
}
break;
case ' ':

View file

@ -247,8 +247,8 @@ static void latex_cmd_run(void *opaque, char *cmd)
p = strrchr(func->es->b->filename, '/');
if (p == func->es->b->filename)
p++;
len = p - func->es->b->filename + 1;
pstrcpy(dir, sizeof(dir), func->es->b->filename);
len = p - func->es->b->filename;
pstrncpy(dir, sizeof(dir), func->es->b->filename, len);
chdir(dir);
if (func->output_to_buffer) {

17
qe.c
View file

@ -542,7 +542,7 @@ void do_kill_paragraph(EditState *s, int dir)
void do_fill_paragraph(EditState *s)
{
int par_start, par_end, col;
int offset, offset1, n, c, line_count, indent_size;
int offset, offset1, n, c, indent_size;
int chunk_start, word_start, word_size, word_count, space_size;
unsigned char buf[1];
@ -566,7 +566,6 @@ void do_fill_paragraph(EditState *s)
col = 0;
offset = par_start;
word_count = 0;
line_count = 0;
while (offset < par_end) {
/* skip spaces */
chunk_start = offset;
@ -4964,7 +4963,6 @@ void do_minibuffer_exit(EditState *s, int do_abort)
static void (*cb)(void *opaque, char *buf);
static void *opaque;
char buf[4096], *retstr;
int len;
/* if completion is activated, then select current file only if
the selection is highlighted */
@ -4987,7 +4985,7 @@ void do_minibuffer_exit(EditState *s, int do_abort)
do_refresh(s);
}
len = eb_get_contents(s->b, buf, sizeof(buf));
eb_get_contents(s->b, buf, sizeof(buf));
if (hist && hist->nb_items > 0) {
/* if null string, do not insert in history */
hist->nb_items--;
@ -7110,7 +7108,7 @@ int parse_config_file(EditState *s, const char *filename)
char line[1024], str[1024];
char prompt[64], cmd[128], *q, *strp;
const char *p, *r;
int err, line_num;
int line_num;
CmdDef *d;
int nb_args, c, sep, i, skip;
CmdArg args[MAX_CMD_ARGS];
@ -7121,7 +7119,6 @@ int parse_config_file(EditState *s, const char *filename)
return -1;
ec = qs->ec;
skip = 0;
err = 0;
line_num = 0;
/* Should parse whole config file in a single read, or load it via
* a buffer */
@ -7208,7 +7205,6 @@ int parse_config_file(EditState *s, const char *filename)
/* search for command */
d = qe_find_cmd(cmd);
if (!d) {
err = -1;
put_status(s, "Unknown command '%s'", cmd);
continue;
}
@ -7698,7 +7694,10 @@ static void qe_init(void *opaque)
EditState *s;
EditBuffer *b;
QEDisplay *dpy;
int i, _optind, is_player;
int i, _optind;
#if !defined(CONFIG_TINY) && !defined(CONFIG_WIN32)
int is_player;
#endif
qs->ec.function = "qe-init";
qs->macro_key_index = -1; /* no macro executing */
@ -7749,6 +7748,7 @@ static void qe_init(void *opaque)
load_all_modules(qs);
#endif
#if !defined(CONFIG_TINY) && !defined(CONFIG_WIN32)
#if 0
/* see if invoked as player */
{
@ -7763,6 +7763,7 @@ static void qe_init(void *opaque)
#else
/* Start in dired mode when invoked with no arguments */
is_player = 1;
#endif
#endif
/* init of the editor state */