From cc469c423c882333c3b2cede4f933e8a53cbe682 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 6 Apr 2017 03:24:03 -0400 Subject: [PATCH] Fix a few include warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- include/Makefile.am | 1 + include/babeltrace/graph/component-class.h | 3 +- include/babeltrace/graph/component-status.h | 65 +++++++++++++++++++++ include/babeltrace/graph/component.h | 28 +-------- tests/lib/test_plugin.c | 1 + 5 files changed, 70 insertions(+), 28 deletions(-) create mode 100644 include/babeltrace/graph/component-status.h diff --git a/include/Makefile.am b/include/Makefile.am index 8aef29654..cac65bb1b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -43,6 +43,7 @@ babeltracegraphinclude_HEADERS = \ babeltrace/graph/component-filter.h \ babeltrace/graph/component-sink.h \ babeltrace/graph/component-source.h \ + babeltrace/graph/component-status.h \ babeltrace/graph/component.h \ babeltrace/graph/connection.h \ babeltrace/graph/graph.h \ diff --git a/include/babeltrace/graph/component-class.h b/include/babeltrace/graph/component-class.h index c2d59da6d..fcb171fc4 100644 --- a/include/babeltrace/graph/component-class.h +++ b/include/babeltrace/graph/component-class.h @@ -25,8 +25,9 @@ * SOFTWARE. */ -#include #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/babeltrace/graph/component-status.h b/include/babeltrace/graph/component-status.h new file mode 100644 index 000000000..dca7e8aaf --- /dev/null +++ b/include/babeltrace/graph/component-status.h @@ -0,0 +1,65 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_STATUS_H +#define BABELTRACE_COMPONENT_COMPONENT_STATUS_H + +/* + * BabelTrace - Babeltrace Component Interface + * + * Copyright 2015 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Status code. Errors are always negative. + */ +enum bt_component_status { + /** No error, okay. */ + BT_COMPONENT_STATUS_OK = 0, + /** No more work to be done by this component. **/ + BT_COMPONENT_STATUS_END = 1, + /** + * Component can't process a notification at this time + * (e.g. would block), try again later. + */ + BT_COMPONENT_STATUS_AGAIN = 2, + /** Refuse port connection. */ + BT_COMPONENT_STATUS_REFUSE_PORT_CONNECTION = 3, + /** General error. */ + BT_COMPONENT_STATUS_ERROR = -1, + /** Unsupported component feature. */ + BT_COMPONENT_STATUS_UNSUPPORTED = -2, + /** Invalid arguments. */ + BT_COMPONENT_STATUS_INVALID = -3, + /** Memory allocation failure. */ + BT_COMPONENT_STATUS_NOMEM = -4, + /** Element not found. */ + BT_COMPONENT_STATUS_NOT_FOUND = -5, +}; + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_COMPONENT_COMPONENT_STATUS_H */ diff --git a/include/babeltrace/graph/component.h b/include/babeltrace/graph/component.h index 74f38345a..9dac6dec6 100644 --- a/include/babeltrace/graph/component.h +++ b/include/babeltrace/graph/component.h @@ -27,6 +27,7 @@ * SOFTWARE. */ +#include #include #include #include @@ -42,33 +43,6 @@ struct bt_component; struct bt_value; struct bt_port; -/** - * Status code. Errors are always negative. - */ -enum bt_component_status { - /** No error, okay. */ - BT_COMPONENT_STATUS_OK = 0, - /** No more work to be done by this component. **/ - BT_COMPONENT_STATUS_END = 1, - /** - * Component can't process a notification at this time - * (e.g. would block), try again later. - */ - BT_COMPONENT_STATUS_AGAIN = 2, - /** Refuse port connection. */ - BT_COMPONENT_STATUS_REFUSE_PORT_CONNECTION = 3, - /** General error. */ - BT_COMPONENT_STATUS_ERROR = -1, - /** Unsupported component feature. */ - BT_COMPONENT_STATUS_UNSUPPORTED = -2, - /** Invalid arguments. */ - BT_COMPONENT_STATUS_INVALID = -3, - /** Memory allocation failure. */ - BT_COMPONENT_STATUS_NOMEM = -4, - /** Element not found. */ - BT_COMPONENT_STATUS_NOT_FOUND = -5, -}; - /** * Create an instance of a component from a component class. * diff --git a/tests/lib/test_plugin.c b/tests/lib/test_plugin.c index 77e7840fd..1b576104c 100644 --- a/tests/lib/test_plugin.c +++ b/tests/lib/test_plugin.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include -- 2.34.1