summaryrefslogtreecommitdiff
path: root/filedef.h
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 /filedef.h
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 'filedef.h')
-rw-r--r--filedef.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/filedef.h b/filedef.h
index 73dc037..f458551 100644
--- a/filedef.h
+++ b/filedef.h
@@ -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. */