changeset 562:93219f707552

Remove one warning and remove duplicate code from tcc_add_library()
author Rob Landley <rob@landley.net>
date Tue, 11 Mar 2008 08:42:05 -0500
parents 1bca65b6262f
children 8e32c8615b39
files tcc.c
diffstat 1 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/tcc.c	Mon Mar 10 23:05:10 2008 -0500
+++ b/tcc.c	Tue Mar 11 08:42:05 2008 -0500
@@ -992,7 +992,7 @@
 /* space excluding newline */
 int is_space(int ch)
 {
-    return strchr(" \t\v\f\r", ch);
+    return strchr(" \t\v\f\r", ch) ? 1 : 0;
 }
 
 /* handle '\[\r]\n' */
@@ -9057,7 +9057,6 @@
 int tcc_add_library(TCCState *s, char *libraryname)
 {
     char buf[1024];
-    int i;
     
     /* first we look for the dynamic library if not static linking */
     if (!tccg_static_link) {
@@ -9070,14 +9069,8 @@
             return 0;
     }
 
-    /* then we look for the static library */
-    for(i = 0; i < tccg_library_paths.len; i++) {
-        snprintf(buf, sizeof(buf), "%s/lib%s.a", 
-                 tccg_library_paths.data[i], libraryname);
-        if (tcc_add_file_internal(s, buf, 0) == 0)
-            return 0;
-    }
-    return -1;
+    snprintf(buf, sizeof(buf), "lib%s.a", libraryname);
+    return tcc_add_dll(s, buf, 0);
 }
 
 int tcc_add_symbol(TCCState *s, char *name, unsigned long val)