1 |
Author: grobian |
2 |
Date: 2009-03-21 14:55:33 +0000 (Sat, 21 Mar 2009) |
3 |
New Revision: 1646 |
4 |
|
5 |
Modified: |
6 |
trunk/toolchain-prefix-wrapper/configure.ac |
7 |
trunk/toolchain-prefix-wrapper/ld/ldwrapper.c |
8 |
trunk/toolchain-prefix-wrapper/utils/stringutil.c |
9 |
Log: |
10 |
inline some small funcs |
11 |
|
12 |
Modified: trunk/toolchain-prefix-wrapper/configure.ac |
13 |
=================================================================== |
14 |
--- trunk/toolchain-prefix-wrapper/configure.ac 2009-03-21 14:40:41 UTC (rev 1645) |
15 |
+++ trunk/toolchain-prefix-wrapper/configure.ac 2009-03-21 14:55:33 UTC (rev 1646) |
16 |
@@ -18,6 +18,8 @@ |
17 |
|
18 |
AC_DEFINE_UNQUOTED([CHOST], ["${ac_cv_host}"], [host the wrapper is running on]) |
19 |
|
20 |
+AC_C_INLINE |
21 |
+ |
22 |
AC_MSG_CHECKING([for gentoo portage eprefix]) |
23 |
AC_ARG_WITH([gentoo-portage-eprefix], |
24 |
[AC_HELP_STRING( |
25 |
|
26 |
Modified: trunk/toolchain-prefix-wrapper/ld/ldwrapper.c |
27 |
=================================================================== |
28 |
--- trunk/toolchain-prefix-wrapper/ld/ldwrapper.c 2009-03-21 14:40:41 UTC (rev 1645) |
29 |
+++ trunk/toolchain-prefix-wrapper/ld/ldwrapper.c 2009-03-21 14:55:33 UTC (rev 1646) |
30 |
@@ -53,7 +53,7 @@ |
31 |
LdPluginIn pluginIn; |
32 |
} LdWrapperData; |
33 |
|
34 |
-static void wrapper_exit(char *msg, ...) |
35 |
+static inline void wrapper_exit(char *msg, ...) |
36 |
{ |
37 |
va_list args; |
38 |
fprintf(stderr, "binutils-config error: "); |
39 |
@@ -66,7 +66,7 @@ |
40 |
/* create the string "/${CTARGET}/binutils-bin/", |
41 |
* as this is used a few times. |
42 |
*/ |
43 |
-static void setup_ctarget_binutilsbin(LdWrapperData *data) |
44 |
+static inline void setup_ctarget_binutilsbin(LdWrapperData *data) |
45 |
{ |
46 |
if (data->_ctarget_binutilsbin_ == NULL) { |
47 |
/* cache the string "/${CTARGET}/binutils-bin/" */ |
48 |
@@ -86,7 +86,7 @@ |
49 |
/* check_for_binutils checks in path for the file we are seeking |
50 |
* it returns 1 if found (with data->bin setup), 0 if not |
51 |
*/ |
52 |
-static int check_for_binutils(String const * path, LdWrapperData *data) |
53 |
+static inline int check_for_binutils(String const * path, LdWrapperData *data) |
54 |
{ |
55 |
struct stat sbuf; |
56 |
int result; |
57 |
@@ -140,7 +140,7 @@ |
58 |
return 0; |
59 |
} |
60 |
|
61 |
-static int find_binutils_in_path(LdWrapperData *data) |
62 |
+static inline int find_binutils_in_path(LdWrapperData *data) |
63 |
{ |
64 |
int i, pathcount; |
65 |
|
66 |
@@ -170,7 +170,7 @@ |
67 |
* returns NULL if line does not set expected variable. |
68 |
* returns String containing the value for expected variable. |
69 |
*/ |
70 |
-static String* parseline_shellvariable(LdWrapperData* data, |
71 |
+static inline String* parseline_shellvariable(LdWrapperData* data, |
72 |
char const *variable, int varlen, char const *line, int linelen) |
73 |
{ |
74 |
String* rv; |
75 |
@@ -225,7 +225,7 @@ |
76 |
* current BVER, then tries to parse /etc/env.d/binutils/${CTARGET}-${BVER} |
77 |
* to extract PATH, which is set to the current binutils' bin directory ... |
78 |
*/ |
79 |
-static int find_binutils_in_envd(LdWrapperData *data) |
80 |
+static inline int find_binutils_in_envd(LdWrapperData *data) |
81 |
{ |
82 |
Textfile* envfile = NULL; |
83 |
String const * thisline; |
84 |
@@ -303,7 +303,7 @@ |
85 |
return rv; |
86 |
} |
87 |
|
88 |
-static void find_wrapper_binutils(LdWrapperData *data) |
89 |
+static inline void find_wrapper_binutils(LdWrapperData *data) |
90 |
{ |
91 |
FILE *inpipe = NULL; |
92 |
String* binpath_command; |
93 |
@@ -362,7 +362,7 @@ |
94 |
pclose(inpipe); |
95 |
} |
96 |
|
97 |
-static int filterSysLibpath(LdPluginData* pluginData) |
98 |
+static inline int filterSysLibpath(LdPluginData* pluginData) |
99 |
{ |
100 |
int argc; |
101 |
String const *argString; |
102 |
@@ -423,7 +423,7 @@ |
103 |
TestLibpath |
104 |
} AddLibpathType; |
105 |
|
106 |
-static int add_libpath(LdWrapperData* data, StringList* list, AddLibpathType type, |
107 |
+static inline int add_libpath(LdWrapperData* data, StringList* list, AddLibpathType type, |
108 |
char const *diagnostics, |
109 |
char const *path, int len, |
110 |
...) |
111 |
@@ -477,7 +477,7 @@ |
112 |
* This needs to be done when whe do |
113 |
* cross-prefix or cross-triplet. |
114 |
*/ |
115 |
-static void add_target_toolchain_runpath(LdWrapperData* data) |
116 |
+static inline void add_target_toolchain_runpath(LdWrapperData* data) |
117 |
{ |
118 |
if (data->pluginIn.isCrossTriplet |
119 |
|| data->pluginIn.isCrossEprefix |
120 |
@@ -503,7 +503,7 @@ |
121 |
} |
122 |
} |
123 |
|
124 |
-static void add_target_toolchain_libpath(LdWrapperData* data) |
125 |
+static inline void add_target_toolchain_libpath(LdWrapperData* data) |
126 |
{ |
127 |
} |
128 |
|
129 |
@@ -511,11 +511,11 @@ |
130 |
* This needs to be done when we do |
131 |
* cross-triplet only. |
132 |
*/ |
133 |
-static void add_cross_toolchain_runpath(LdWrapperData* data) |
134 |
+static inline void add_cross_toolchain_runpath(LdWrapperData* data) |
135 |
{ |
136 |
} |
137 |
|
138 |
-static void add_cross_toolchain_libpath(LdWrapperData* data) |
139 |
+static inline void add_cross_toolchain_libpath(LdWrapperData* data) |
140 |
{ |
141 |
if (data->pluginIn.isCrossTriplet) { |
142 |
add_libpath(data, data->pluginIn.sysLibpath, AddLibpath, |
143 |
@@ -555,7 +555,7 @@ |
144 |
* to run even if there are dependencies missing in target eprefix, |
145 |
* as during bootstrap. |
146 |
*/ |
147 |
-static void add_host_toolchain_runpath(LdWrapperData* data) |
148 |
+static inline void add_host_toolchain_runpath(LdWrapperData* data) |
149 |
{ |
150 |
if (data->pluginIn.isCrossTriplet) { |
151 |
return; |
152 |
@@ -585,7 +585,7 @@ |
153 |
} |
154 |
} |
155 |
|
156 |
-static void add_host_toolchain_libpath(LdWrapperData* data) |
157 |
+static inline void add_host_toolchain_libpath(LdWrapperData* data) |
158 |
{ |
159 |
if (data->pluginIn.isCrossTriplet) { |
160 |
return; |
161 |
@@ -620,7 +620,7 @@ |
162 |
* This only needs to be done if we do |
163 |
* cross-eprefix or use ROOT. |
164 |
*/ |
165 |
-static void add_target_system(LdWrapperData* data) |
166 |
+static inline void add_target_system(LdWrapperData* data) |
167 |
{ |
168 |
struct libdir { |
169 |
char const *path; int len; |
170 |
@@ -676,7 +676,7 @@ |
171 |
* because it is likely that the created binaries are executed from the |
172 |
* new prefix, while still can use dependent libs from the old prefix. |
173 |
*/ |
174 |
-static void add_host_system(LdWrapperData* data) |
175 |
+static inline void add_host_system(LdWrapperData* data) |
176 |
{ |
177 |
struct libdir { |
178 |
char const *path; int len; |
179 |
@@ -716,7 +716,7 @@ |
180 |
} |
181 |
} |
182 |
|
183 |
-static void callPlugin(LdWrapperData* data, LdPluginFct plugins) |
184 |
+static inline void callPlugin(LdWrapperData* data, LdPluginFct plugins) |
185 |
{ |
186 |
LdPluginData pluginData = {0}; |
187 |
LdPluginOut pluginOut = {0}; |
188 |
@@ -753,7 +753,7 @@ |
189 |
LdPluginFct plugin; |
190 |
} KnownPlugin; |
191 |
|
192 |
-static int compareKnownPluginName(void const *v1, void const *v2) |
193 |
+static inline int compareKnownPluginName(void const *v1, void const *v2) |
194 |
{ |
195 |
KnownPlugin const* p1 = (KnownPlugin const*)v1; |
196 |
KnownPlugin const* p2 = (KnownPlugin const*)v2; |
197 |
@@ -764,7 +764,7 @@ |
198 |
} |
199 |
|
200 |
/* call the plugins from comma-separated list of plugin-names */ |
201 |
-static void callPlugins(LdWrapperData* data, char const* plugins) |
202 |
+static inline void callPlugins(LdWrapperData* data, char const* plugins) |
203 |
{ |
204 |
char const *end; |
205 |
static KnownPlugin const knownPlugins[] = { |
206 |
|
207 |
Modified: trunk/toolchain-prefix-wrapper/utils/stringutil.c |
208 |
=================================================================== |
209 |
--- trunk/toolchain-prefix-wrapper/utils/stringutil.c 2009-03-21 14:40:41 UTC (rev 1645) |
210 |
+++ trunk/toolchain-prefix-wrapper/utils/stringutil.c 2009-03-21 14:55:33 UTC (rev 1646) |
211 |
@@ -16,7 +16,7 @@ |
212 |
char *buffer; |
213 |
} Content; |
214 |
|
215 |
-static Content* ContentDestroy(Content* content) |
216 |
+static inline Content* ContentDestroy(Content* content) |
217 |
{ |
218 |
if (content == NULL) { |
219 |
return NULL; |
220 |
@@ -31,7 +31,7 @@ |
221 |
return NULL; |
222 |
} |
223 |
|
224 |
-static Content* ContentUnref(Content* content) |
225 |
+static inline Content* ContentUnref(Content* content) |
226 |
{ |
227 |
if (content == NULL) { |
228 |
return NULL; |
229 |
@@ -43,7 +43,7 @@ |
230 |
return ContentDestroy(content); |
231 |
} |
232 |
|
233 |
-static Content* ContentRef(Content* content) |
234 |
+static inline Content* ContentRef(Content* content) |
235 |
{ |
236 |
if (content != NULL) { |
237 |
++ content->referenceCount; |
238 |
@@ -51,7 +51,7 @@ |
239 |
return content; |
240 |
} |
241 |
|
242 |
-static Content* ContentCreate(int reserve) |
243 |
+static inline Content* ContentCreate(int reserve) |
244 |
{ |
245 |
Content* content = (Content*)malloc(sizeof(Content)); |
246 |
if (content == NULL) { |
247 |
@@ -72,7 +72,7 @@ |
248 |
return content; |
249 |
} |
250 |
|
251 |
-static int ContentAppend(Content* content, char const *text, int length) |
252 |
+static inline int ContentAppend(Content* content, char const *text, int length) |
253 |
{ |
254 |
if (content == NULL) return -1; |
255 |
if (text == NULL) return 0; |
256 |
@@ -85,7 +85,7 @@ |
257 |
return 0; |
258 |
} |
259 |
|
260 |
-static Content* ContentCreateVaConcat(Content *orig, char const *text, int length, va_list ap) |
261 |
+static inline Content* ContentCreateVaConcat(Content *orig, char const *text, int length, va_list ap) |
262 |
{ |
263 |
Content* content = NULL; |
264 |
int concatLength; |
265 |
@@ -157,7 +157,7 @@ |
266 |
return content; |
267 |
} |
268 |
|
269 |
-static char * ContentExtractBuffer(Content* content) |
270 |
+static inline char * ContentExtractBuffer(Content* content) |
271 |
{ |
272 |
char *ret = NULL; |
273 |
if (content == NULL) { |
274 |
@@ -169,7 +169,7 @@ |
275 |
return ret; |
276 |
} |
277 |
|
278 |
-static int ContentGetLength(Content const * content) |
279 |
+static inline int ContentGetLength(Content const * content) |
280 |
{ |
281 |
if (content == NULL) { |
282 |
return -1; |
283 |
@@ -177,7 +177,7 @@ |
284 |
return content->length; |
285 |
} |
286 |
|
287 |
-static char const* ContentGetBuffer(Content const * content) |
288 |
+static inline char const* ContentGetBuffer(Content const * content) |
289 |
{ |
290 |
if (content == NULL) { |
291 |
return NULL; |