Refactoring
[libfirm] / ir / libcore / lc_type.c
index 30eaf6b..8985c54 100644 (file)
@@ -16,8 +16,7 @@
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
-
-
+#include "config.h"
 
 #include <ctype.h>
 #include "lc_opts_t.h"
@@ -42,7 +41,7 @@ int lc_opt_type_scan(void *dest, lc_opt_type_t type, const char *str)
 
        int res = 0;
 
-       switch(type) {
+       switch (type) {
                case lc_opt_type_int:
                case lc_opt_type_double:
                case lc_opt_type_string:
@@ -55,11 +54,11 @@ int lc_opt_type_scan(void *dest, lc_opt_type_t type, const char *str)
                                char buf[10];
 
                                strncpy(buf, str, sizeof(buf));
-                               for(i = 0, n = strlen(buf); i < n; ++i)
+                               for (i = 0, n = strlen(buf); i < n; ++i)
                                        buf[i] = tolower(buf[i]);
 
-                               for(i = 0; i < LC_ARRSIZE(bool_vals); ++i) {
-                                       if(strcmp(buf, bool_vals[i].str) == 0) {
+                               for (i = 0; i < LC_ARRSIZE(bool_vals); ++i) {
+                                       if (strcmp(buf, bool_vals[i].str) == 0) {
                                                res = 1;
                                                *data = bool_vals[i].val;
                                                break;
@@ -78,7 +77,7 @@ int lc_opt_type_print(char *buf, size_t n, lc_opt_type_t type, void *data)
 {
        int res = 0;
 
-       switch(type) {
+       switch (type) {
                case lc_opt_type_int:
                        {
                                int i = *((int *) data);