mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
dump: Rename result variables to error
Because 0 in them means OK and nonzero (currently -1) means an error.
This commit is contained in:
parent
4f29067169
commit
417dcba57f
@ -210,16 +210,16 @@ int
|
|||||||
dump_to_file(struct document *document, int fd)
|
dump_to_file(struct document *document, int fd)
|
||||||
{
|
{
|
||||||
unsigned char *buf = mem_alloc(D_BUF);
|
unsigned char *buf = mem_alloc(D_BUF);
|
||||||
int result;
|
int error;
|
||||||
|
|
||||||
if (!buf) return -1;
|
if (!buf) return -1;
|
||||||
|
|
||||||
result = dump_nocolor(document, fd, buf);
|
error = dump_nocolor(document, fd, buf);
|
||||||
if (!result)
|
if (!error)
|
||||||
result = dump_references(document, fd, buf);
|
error = dump_references(document, fd, buf);
|
||||||
|
|
||||||
mem_free(buf);
|
mem_free(buf);
|
||||||
return result;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This dumps the given @cached's formatted output onto @fd. */
|
/* This dumps the given @cached's formatted output onto @fd. */
|
||||||
@ -252,41 +252,41 @@ dump_formatted(int fd, struct download *download, struct cache_entry *cached)
|
|||||||
|
|
||||||
buf = mem_alloc(D_BUF);
|
buf = mem_alloc(D_BUF);
|
||||||
if (buf) {
|
if (buf) {
|
||||||
int result;
|
int error;
|
||||||
|
|
||||||
switch (o.color_mode) {
|
switch (o.color_mode) {
|
||||||
case COLOR_MODE_DUMP:
|
case COLOR_MODE_DUMP:
|
||||||
case COLOR_MODE_MONO: /* FIXME: inversion */
|
case COLOR_MODE_MONO: /* FIXME: inversion */
|
||||||
result = dump_nocolor(formatted.document, fd, buf);
|
error = dump_nocolor(formatted.document, fd, buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* If the desired color mode was not compiled in,
|
/* If the desired color mode was not compiled in,
|
||||||
* use 16 colors. */
|
* use 16 colors. */
|
||||||
case COLOR_MODE_16:
|
case COLOR_MODE_16:
|
||||||
result = dump_16color(formatted.document, fd, buf);
|
error = dump_16color(formatted.document, fd, buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef CONFIG_88_COLORS
|
#ifdef CONFIG_88_COLORS
|
||||||
case COLOR_MODE_88:
|
case COLOR_MODE_88:
|
||||||
result = dump_256color(formatted.document, fd, buf);
|
error = dump_256color(formatted.document, fd, buf);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_256_COLORS
|
#ifdef CONFIG_256_COLORS
|
||||||
case COLOR_MODE_256:
|
case COLOR_MODE_256:
|
||||||
result = dump_256color(formatted.document, fd, buf);
|
error = dump_256color(formatted.document, fd, buf);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TRUE_COLOR
|
#ifdef CONFIG_TRUE_COLOR
|
||||||
case COLOR_MODE_TRUE_COLOR:
|
case COLOR_MODE_TRUE_COLOR:
|
||||||
result = dump_truecolor(formatted.document, fd, buf);
|
error = dump_truecolor(formatted.document, fd, buf);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result)
|
if (!error)
|
||||||
dump_references(formatted.document, fd, buf);
|
dump_references(formatted.document, fd, buf);
|
||||||
|
|
||||||
mem_free(buf);
|
mem_free(buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user