diff options
author | Peter Ammon <corydoras@ridiculousfish.com> | 2012-01-14 22:32:45 -0800 |
---|---|---|
committer | Peter Ammon <corydoras@ridiculousfish.com> | 2012-01-14 22:32:45 -0800 |
commit | 9b133a978d5f33985a9b66d3a75165e3d50cdfa3 (patch) | |
tree | e846e195756904d8c007ae1f33e77a53d696102c /set_color.cpp | |
parent | 203c749e6cc2d5ac0e9e8e240c77d94e179c60d0 (diff) |
Improve const and signed/unsigned correctness
Diffstat (limited to 'set_color.cpp')
-rw-r--r-- | set_color.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/set_color.cpp b/set_color.cpp index 8def213e..61c6312f 100644 --- a/set_color.cpp +++ b/set_color.cpp @@ -63,7 +63,7 @@ #define _(string) (string) #endif -char *col[]= +const char *col[]= { "black", "red", @@ -79,7 +79,7 @@ char *col[]= } ; -int col_idx[]= +const int col_idx[]= { 0, 1, @@ -108,7 +108,7 @@ int translate_color( char *str ) if( *endptr || color<0 || errno ) { - int i; + size_t i; color = -1; for( i=0; i<COLORS; i++ ) { @@ -126,7 +126,7 @@ int translate_color( char *str ) void print_colors() { - int i; + size_t i; for( i=0; i<COLORS; i++ ) { printf( "%s\n", col[i] ); |