summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-07-14 19:18:21 -0400
committerPaul Smith <psmith@gnu.org>2013-07-14 19:18:21 -0400
commit4b81f5ca920d716c08430583f5edb2c125f1f123 (patch)
treecfb15f1ff1dc733ffbec1d92c1c19e2fe1000d7b /file.c
parent5601726151b3856ad26433d632392904ec059368 (diff)
downloadgunmake-4b81f5ca920d716c08430583f5edb2c125f1f123.tar.gz
Modify the update_status field in struct file to be an enum.
Makes the code a little clearer/cleaner, and solves a problem on systems where a char is unsigned by default.
Diffstat (limited to 'file.c')
-rw-r--r--file.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/file.c b/file.c
index 284e19a..25ddde7 100644
--- a/file.c
+++ b/file.c
@@ -184,7 +184,7 @@ enter_file (const char *name)
new = xcalloc (sizeof (struct file));
new->name = new->hname = name;
- new->update_status = -1;
+ new->update_status = us_none;
if (HASH_VACANT (f))
{
@@ -378,7 +378,7 @@ remove_intermediates (int sig)
&& !f->secondary && !f->cmd_target)
{
int status;
- if (f->update_status == -1)
+ if (f->update_status == us_none)
/* If nothing would have created this file yet,
don't print an "rm" command for it. */
continue;
@@ -1000,23 +1000,18 @@ print_file (const void *item)
case cs_finished:
switch (f->update_status)
{
- case -1:
+ case us_none:
break;
- case 0:
+ case us_success:
puts (_("# Successfully updated."));
break;
- case 1:
+ case us_question:
assert (question_flag);
puts (_("# Needs to be updated (-q is set)."));
break;
- case 2:
+ case us_failed:
puts (_("# Failed to be updated."));
break;
- default:
- puts (_("# Invalid value in 'update_status' member!"));
- fflush (stdout);
- fflush (stderr);
- abort ();
}
break;
default: