diff options
author | Paul Smith <psmith@gnu.org> | 2013-07-14 19:18:21 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2013-07-14 19:18:21 -0400 |
commit | 1d52c4bc7d6a47b02720a26f5e580fadea958fc7 (patch) | |
tree | cfb15f1ff1dc733ffbec1d92c1c19e2fe1000d7b /filedef.h | |
parent | f3edc3f0fe69f21cf2c18d5f7482c8ece6584acb (diff) | |
download | make-1d52c4bc7d6a47b02720a26f5e580fadea958fc7.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 'filedef.h')
-rw-r--r-- | filedef.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -59,11 +59,16 @@ struct file FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating has been performed. */ int command_flags; /* Flags OR'd in for cmds; see commands.h. */ - char update_status; /* Status of the last attempt to update, - or -1 if none has been made. */ + enum update_status /* Status of the last attempt to update. */ + { + us_success = 0, /* Successfully updated. Must be 0! */ + us_none, /* No attempt to update has been made. */ + us_question, /* Needs to be updated (-q is is set). */ + us_failed /* Update failed. */ + } update_status ENUM_BITFIELD (2); enum cmd_state /* State of the commands. */ - { /* Note: It is important that cs_not_started be zero. */ - cs_not_started, /* Not yet started. */ + { + cs_not_started = 0, /* Not yet started. Must be 0! */ cs_deps_running, /* Dep commands running. */ cs_running, /* Commands running. */ cs_finished /* Commands finished. */ |