Fix the following compilation warnings:
rt-app_utils.c: In function ‘gettid’: rt-app_utils.c:150:9: warning: implicit declaration of function ‘syscall’ [-Wimplicit-function-declaration] return syscall(__NR_gettid); ^ rt-app_utils.c: In function ‘ftrace_write’: rt-app_utils.c:277:4: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration] write(mark_fd, tmp, n); ^ mv -f .deps/rt-app_utils.Tpo .deps/rt-app_utils.Po gcc -DHAVE_CONFIG_H -I. -I./../libdl/ -g -O2 -MT rt-app_args.o -MD -MP -MF .deps/rt-app_args.Tpo -c -o rt-app_args.o rt-app_args.c rt-app_args.c: In function ‘parse_command_line’: rt-app_args.c:44:3: warning: implicit declaration of function ‘parse_config’ [-Wimplicit-function-declaration] parse_config(argv[1], opts); ^ rt-app_args.c:47:3: warning: implicit declaration of function ‘parse_config_stdin’ [-Wimplicit-function-declaration] parse_config_stdin(opts); ^ mv -f .deps/rt-app_args.Tpo .deps/rt-app_args.Po gcc -DHAVE_CONFIG_H -I. -I./../libdl/ -g -O2 -MT rt-app.o -MD -MP -MF .deps/rt-app.Tpo -c -o rt-app.o rt-app.c rt-app.c:173:15: warning: return type defaults to ‘int’ [-Wimplicit-int] static inline loadwait(unsigned long exec) ^ rt-app.c: In function ‘ioload’: rt-app.c:195:9: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration] ret = write(io_fd, iomem->ptr, size); ^ rt-app.c: In function ‘run’: rt-app.c:340:4: warning: ‘return’ with no value, in function returning non-void return; ^ rt-app.c: In function ‘shutdown’: rt-app.c:381:3: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration] close(ft_data.trace_fd); ^ rt-app.c: In function ‘main’: rt-app.c:848:3: warning: implicit declaration of function ‘sleep’ [-Wimplicit-function-declaration] sleep(opts.duration);
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- src/rt-app.c | 5 +++-- src/rt-app_args.c | 1 + src/rt-app_parse_config.h | 2 ++ src/rt-app_utils.c | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/rt-app.c b/src/rt-app.c index fef12d8..c3e5df4 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define _GNU_SOURCE #include <fcntl.h> +#include <unistd.h> #include "rt-app.h" #include "rt-app_utils.h" #include <sched.h> @@ -170,7 +171,7 @@ int calibrate_cpu_cycles(int clock)
}
-static inline loadwait(unsigned long exec) +static inline unsigned long loadwait(unsigned long exec) { unsigned long load_count;
@@ -337,7 +338,7 @@ int run(int ind, event_data_t *events, for (i = 0; i < nbevents; i++) { if (!continue_running && !lock) - return; + return 0;
log_debug("[%d] runs events %d type %d ", ind, i, events[i].type); if (opts.ftrace) diff --git a/src/rt-app_args.c b/src/rt-app_args.c index e16415d..c4d56de 100644 --- a/src/rt-app_args.c +++ b/src/rt-app_args.c @@ -19,6 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+#include "rt-app_parse_config.h" #include "rt-app_args.h"
void diff --git a/src/rt-app_parse_config.h b/src/rt-app_parse_config.h index 023cabd..9b0e5fa 100644 --- a/src/rt-app_parse_config.h +++ b/src/rt-app_parse_config.h @@ -45,5 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
void parse_config(const char *filename, rtapp_options_t *opts); +void +parse_config_stdin(rtapp_options_t *opts);
#endif // _RTAPP_PARSE_CONFIG_H diff --git a/src/rt-app_utils.c b/src/rt-app_utils.c index c4840db..190affc 100644 --- a/src/rt-app_utils.c +++ b/src/rt-app_utils.c @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - +#include <unistd.h> #include "rt-app_utils.h"
unsigned long -- 1.9.1