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 | 4b81f5ca920d716c08430583f5edb2c125f1f123 (patch) | |
tree | cfb15f1ff1dc733ffbec1d92c1c19e2fe1000d7b /filedef.h | |
parent | 5601726151b3856ad26433d632392904ec059368 (diff) | |
download | gunmake-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 '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. */ |