]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
col: use typedef and enum to clarify struct
authorSami Kerola <kerolasa@iki.fi>
Sat, 27 Jun 2020 17:57:48 +0000 (18:57 +0100)
committerSami Kerola <kerolasa@iki.fi>
Fri, 11 Sep 2020 19:55:02 +0000 (20:55 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/col.c

index f286de809f296b6dbbf1a78b17f676a08a741382..5a58d810e7424ebba90a3f21e857c02862f616e4 100644 (file)
 /* number of lines to allocate */
 #define        NALLOC                  64
 
-typedef char CSET;
+typedef enum {
+       CS_NORMAL,
+       CS_ALTERNATE
+} CSET;
 
 typedef struct char_str {
-#define        CS_NORMAL       1
-#define        CS_ALTERNATE    2
        int             c_column;       /* column character is in */
-       CSET            c_set;          /* character set (currently only 2) */
        wchar_t         c_char;         /* character in question */
        int             c_width;        /* character width */
+       CSET            c_set;          /* character set (currently only 2) */
 } CHAR;
 
 typedef struct line_str LINE;