Avoid enum portability issues
authorSam Thursfield <samthursfield@codethink.co.uk>
Thu, 7 Jul 2011 10:42:04 +0000 (11:42 +0100)
committerSam Thursfield <samthursfield@codethink.co.uk>
Thu, 7 Jul 2011 10:42:04 +0000 (11:42 +0100)
Use 'int' instead of MoonshotErrorCode in struct MoonshotError, because
the size of an enum value is technically unspecified.

libmoonshot/libmoonshot.h

index 86e6a80..a324d61 100644 (file)
@@ -55,8 +55,8 @@ typedef enum {
 } MoonshotErrorCode;
 
 typedef struct {
-    MoonshotErrorCode  code;
-    char              *message;
+    int   code;    /* A MoonshotErrorCode */
+    char *message;
 } MoonshotError;
 
 /**