… | |
… | |
183 | Marks a function or a variable as "unused", which simply suppresses a |
183 | Marks a function or a variable as "unused", which simply suppresses a |
184 | warning by GCC when it detects it as unused. This is useful when you e.g. |
184 | warning by GCC when it detects it as unused. This is useful when you e.g. |
185 | declare a variable but do not always use it: |
185 | declare a variable but do not always use it: |
186 | |
186 | |
187 | { |
187 | { |
188 | int var ecb_unused; |
188 | ecb_unused int var; |
189 | |
189 | |
190 | #ifdef SOMECONDITION |
190 | #ifdef SOMECONDITION |
191 | var = ...; |
191 | var = ...; |
192 | return var; |
192 | return var; |
193 | #else |
193 | #else |
… | |
… | |
245 | |
245 | |
246 | Example: multiply a vector, and allow the compiler to parallelise the |
246 | Example: multiply a vector, and allow the compiler to parallelise the |
247 | loop, because it knows it doesn't overwrite input values. |
247 | loop, because it knows it doesn't overwrite input values. |
248 | |
248 | |
249 | void |
249 | void |
250 | multiply (float *ecb_restrict src, |
250 | multiply (ecb_restrict float *src, |
251 | float *ecb_restrict dst, |
251 | ecb_restrict float *dst, |
252 | int len, float factor) |
252 | int len, float factor) |
253 | { |
253 | { |
254 | int i; |
254 | int i; |
255 | |
255 | |
256 | for (i = 0; i < len; ++i) |
256 | for (i = 0; i < len; ++i) |