Skip to content

Commit

Permalink
sort includes system (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Walker authored May 14, 2020
1 parent 7c4babc commit d0789c9
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 61 deletions.
12 changes: 8 additions & 4 deletions src/system/SystemClock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@
#define __STDC_CONSTANT_MACROS
#endif // __STDC_CONSTANT_MACROS

#include <stdint.h>
#include <stdlib.h>

// config
#include <system/SystemConfig.h>

#if !CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME

// module header
#include <system/SystemClock.h>
// common private
#include "SystemLayerPrivate.h"

#include <support/CodeUtils.h>
#include <system/SystemError.h>
#include "SystemLayerPrivate.h"

#if CHIP_SYSTEM_CONFIG_USE_POSIX_TIME_FUNCTS
#include <time.h>
Expand All @@ -56,6 +57,9 @@
#include <lwip/sys.h>
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#include <stdint.h>
#include <stdlib.h>

namespace chip {
namespace System {
namespace Platform {
Expand Down
8 changes: 4 additions & 4 deletions src/system/SystemError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
* error strings.
*/

#include <stddef.h>

// Include module header
#include <system/SystemError.h>

// Include common private header
#include "SystemLayerPrivate.h"

#include <support/DLLUtil.h>
#include <support/ErrorStr.h>

// Include local headers
#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/err.h>
Expand All @@ -41,8 +42,7 @@
#include <string.h>
#endif // !CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_POSIX_ERROR_FUNCTIONS

#include <support/ErrorStr.h>
#include <support/DLLUtil.h>
#include <stddef.h>

#if !CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_POSIX_ERROR_FUNCTIONS

Expand Down
10 changes: 5 additions & 5 deletions src/system/SystemFaultInjection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
* @file
* Implementation of the fault-injection utilities for CHIP System Layer.
*/

#include <string.h>
#include <nlassert.h>
#include <system/SystemFaultInjection.h>

#if CHIP_SYSTEM_CONFIG_TEST
/* module header, also carries config, comes first */
#include <system/SystemFaultInjection.h>

#include "SystemLayerPrivate.h"

#include <nlassert.h>
#include <string.h>

namespace chip {
namespace System {
namespace FaultInjection {
Expand Down
9 changes: 4 additions & 5 deletions src/system/SystemLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,17 @@
#include <system/SystemTimer.h>

// Include additional CHIP headers
#include <support/logging/CHIPLogging.h>

#include <support/DLLUtil.h>
#include <support/CodeUtils.h>
#include <support/DLLUtil.h>
#include <support/logging/CHIPLogging.h>

// Include system and language headers
#include <stddef.h>

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS

#if CHIP_SYSTEM_CONFIG_USE_LWIP
Expand Down
11 changes: 5 additions & 6 deletions src/system/SystemLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
// Include configuration headers
#include <system/SystemConfig.h>

#include <support/DLLUtil.h>
#include <system/SystemError.h>
#include <system/SystemEvent.h>
#include <system/SystemObject.h>

// Include dependent headers
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <sys/select.h>
Expand All @@ -38,12 +43,6 @@
#include <pthread.h>
#endif // CHIP_SYSTEM_CONFIG_POSIX_LOCKING

#include <support/DLLUtil.h>

#include <system/SystemError.h>
#include <system/SystemObject.h>
#include <system/SystemEvent.h>

#if CHIP_SYSTEM_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES

namespace chip {
Expand Down
2 changes: 1 addition & 1 deletion src/system/SystemMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

#if CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING
#include <FreeRTOS.h>
#include <task.h>
#include <semphr.h>
#include <task.h>
#endif // CHIP_SYSTEM_CONFIG_FREERTOS_LOCKING

namespace chip {
Expand Down
4 changes: 2 additions & 2 deletions src/system/SystemObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
#include "SystemLayerPrivate.h"

// Include local headers
#include <system/SystemLayer.h>
#include <support/CodeUtils.h>
#include <system/SystemLayer.h>

// Include local headers
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>

namespace chip {
namespace System {
Expand Down
20 changes: 9 additions & 11 deletions src/system/SystemPacketBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
* mechanisms for manipulating packets of octet-serialized
* data.
*/

// Include standard C library limit macros
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include <stdint.h>

// Include module header
#include <system/SystemPacketBuffer.h>
Expand All @@ -37,23 +35,23 @@
#include "SystemLayerPrivate.h"

// Include local headers
#include <system/SystemMutex.h>
#include <support/CodeUtils.h>
#include <support/logging/CHIPLogging.h>
#include <system/SystemFaultInjection.h>
#include <system/SystemMutex.h>
#include <system/SystemStats.h>

#include <stdint.h>

#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/pbuf.h>
#include <lwip/mem.h>
#include <lwip/pbuf.h>
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#include <support/logging/CHIPLogging.h>
#include <support/CodeUtils.h>

#include <system/SystemStats.h>

namespace chip {
namespace System {

Expand Down
9 changes: 4 additions & 5 deletions src/system/SystemPacketBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@
#include <system/SystemConfig.h>

// Include dependent headers
#include <stddef.h>

#include "support/DLLUtil.h"

#include <support/DLLUtil.h>
#include <system/SystemAlignSize.h>
#include <system/SystemError.h>

#include <stddef.h>

#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/pbuf.h>
#include <lwip/mem.h>
#include <lwip/memp.h>
#include <lwip/pbuf.h>
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

namespace chip {
Expand Down
5 changes: 3 additions & 2 deletions src/system/SystemStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include <stdint.h>

// Include configuration headers
#include <core/CHIPConfig.h>
Expand All @@ -37,11 +36,13 @@
#include <support/DLLUtil.h>

#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/mem.h>
#include <lwip/opt.h>
#include <lwip/pbuf.h>
#include <lwip/mem.h>
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#include <stdint.h>

namespace chip {
namespace System {
namespace Stats {
Expand Down
2 changes: 1 addition & 1 deletion src/system/SystemTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <string.h>

#include <system/SystemError.h>
#include <system/SystemLayer.h>
#include <system/SystemFaultInjection.h>
#include <system/SystemLayer.h>

#include <support/CodeUtils.h>

Expand Down
4 changes: 2 additions & 2 deletions src/system/tests/TestSystemPacketBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

#include "TestSystemLayer.h"

#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>

#include <system/SystemPacketBuffer.h>

Expand Down
25 changes: 12 additions & 13 deletions src/system/tests/TestSystemTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,31 @@
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
// config
#include <system/SystemConfig.h>

// module header
#include "TestSystemLayer.h"

#include <stdint.h>
#include <string.h>
#include <errno.h>

#include <system/SystemConfig.h>
#include <nlunit-test.h>
#include <support/ErrorStr.h>
#include <system/SystemError.h>
#include <system/SystemLayer.h>
#include <system/SystemTimer.h>

#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/init.h>
#include <lwip/tcpip.h>
#include <lwip/sys.h>
#include <lwip/tcpip.h>
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <sys/select.h>
#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS

#include <system/SystemError.h>
#include <system/SystemLayer.h>
#include <system/SystemTimer.h>

#include <support/ErrorStr.h>

#include <nlunit-test.h>
#include <errno.h>
#include <stdint.h>
#include <string.h>

using chip::ErrorStr;
using namespace chip::System;
Expand Down

0 comments on commit d0789c9

Please sign in to comment.