Skip to content

Commit

Permalink
Indent PP directives
Browse files Browse the repository at this point in the history
  • Loading branch information
bengineerd committed Apr 29, 2024
1 parent 0206859 commit 641820b
Show file tree
Hide file tree
Showing 75 changed files with 140 additions and 139 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ AlignConsecutiveAssignments: true
AlignConsecutiveMacros: true
AccessModifierOffset: -2
SortIncludes: true
IndentPPDirectives: BeforeHash
IncludeBlocks: Regroup
IncludeCategories:
# Rogue Directives.h goes first
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/Directives.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define CRCPP_USE_CPP11

#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif

#endif
2 changes: 1 addition & 1 deletion include/rogue/GeneralError.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <string>

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/GilRelease.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <stdint.h>
#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/ScopedGil.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "rogue/Directives.h"
#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
24 changes: 12 additions & 12 deletions include/rogue/hardware/drivers/DmaDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#define __DMA_DRIVER_H__

#ifdef DMA_IN_KERNEL
#include <linux/types.h>
#include <linux/types.h>
#else
#include <stdint.h>
#include <stdint.h>
#endif

/* API Version */
Expand Down Expand Up @@ -130,16 +130,16 @@ struct DmaRegisterData {

// Conditional inclusion for non-kernel environments
#ifndef DMA_IN_KERNEL
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/signal.h>
#include <sys/socket.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/signal.h>
#include <sys/socket.h>
#include <unistd.h>

/**
* dmaWrite - Writes data to a DMA channel.
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/ZmqClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "rogue/Logging.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/ZmqServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "rogue/Logging.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/memory/Block.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "rogue/interfaces/memory/Master.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/memory/Emulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "rogue/interfaces/memory/Slave.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

#define MAP_TYPE std::map<uint64_t, uint8_t*>
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/memory/Hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "rogue/interfaces/memory/Slave.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/memory/Master.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "rogue/Logging.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/memory/Slave.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "rogue/interfaces/memory/Transaction.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/memory/Transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "rogue/Logging.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/memory/Variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "rogue/EnableSharedFromThis.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/stream/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "rogue/EnableSharedFromThis.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/stream/Master.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "rogue/EnableSharedFromThis.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/stream/Slave.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "rogue/interfaces/stream/Pool.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
#endif

namespace rogue {
Expand Down
98 changes: 49 additions & 49 deletions include/rogue/protocols/packetizer/CRC.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,71 +60,71 @@

#include <climits> // Includes CHAR_BIT
#ifdef CRCPP_USE_CPP11
#include <cstddef> // Includes ::std::size_t
#include <cstdint> // Includes ::std::uint8_t, ::std::uint16_t, ::std::uint32_t, ::std::uint64_t
#include <cstddef> // Includes ::std::size_t
#include <cstdint> // Includes ::std::uint8_t, ::std::uint16_t, ::std::uint32_t, ::std::uint64_t
#else
#include <stddef.h> // Includes size_t
#include <stdint.h> // Includes uint8_t, uint16_t, uint32_t, uint64_t
#include <stddef.h> // Includes size_t
#include <stdint.h> // Includes uint8_t, uint16_t, uint32_t, uint64_t
#endif
#include <limits> // Includes ::std::numeric_limits
#include <utility> // Includes ::std::move

#ifndef crcpp_uint8
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint8 ::std::uint8_t
#else
/// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint8 uint8_t
#endif
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint8 ::std::uint8_t
#else
/// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint8 uint8_t
#endif
#endif

#ifndef crcpp_uint16
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint16 ::std::uint16_t
#else
/// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint16 uint16_t
#endif
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint16 ::std::uint16_t
#else
/// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint16 uint16_t
#endif
#endif

#ifndef crcpp_uint32
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint32 ::std::uint32_t
#else
/// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint32 uint32_t
#endif
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint32 ::std::uint32_t
#else
/// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint32 uint32_t
#endif
#endif

#ifndef crcpp_uint64
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint64 ::std::uint64_t
#else
/// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint64 uint64_t
#endif
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint64 ::std::uint64_t
#else
/// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions.
#define crcpp_uint64 uint64_t
#endif
#endif

#ifndef crcpp_size
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned size definition, used for specifying data sizes.
#define crcpp_size ::std::size_t
#else
/// @brief Unsigned size definition, used for specifying data sizes.
#define crcpp_size size_t
#endif
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned size definition, used for specifying data sizes.
#define crcpp_size ::std::size_t
#else
/// @brief Unsigned size definition, used for specifying data sizes.
#define crcpp_size size_t
#endif
#endif

#ifdef CRCPP_USE_CPP11
/// @brief Compile-time expression definition.
#define crcpp_constexpr constexpr
/// @brief Compile-time expression definition.
#define crcpp_constexpr constexpr
#else
/// @brief Compile-time expression definition.
#define crcpp_constexpr const
/// @brief Compile-time expression definition.
#define crcpp_constexpr const
#endif

#ifdef CRCPP_USE_NAMESPACE
Expand Down Expand Up @@ -722,15 +722,15 @@ inline CRCType CRC::CalculateRemainder(const void* data,
if (lookupTable.GetParameters().reflectInput) {
while (size--) {
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
// Disable warning about data loss when doing (remainder >> CHAR_BIT) when
// remainder is one byte long. The algorithm is still correct in this case,
// though it's possible that one additional machine instruction will be executed.
#pragma warning(push)
#pragma warning(disable : 4333)
// Disable warning about data loss when doing (remainder >> CHAR_BIT) when
// remainder is one byte long. The algorithm is still correct in this case,
// though it's possible that one additional machine instruction will be executed.
#pragma warning(push)
#pragma warning(disable : 4333)
#endif
remainder = (remainder >> CHAR_BIT) ^ lookupTable[static_cast<unsigned char>(remainder ^ *current++)];
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
#pragma warning(pop)
#pragma warning(pop)
#endif
}
} else if (CRCWidth >= CHAR_BIT) {
Expand Down
2 changes: 1 addition & 1 deletion src/rogue/GeneralError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
namespace bp = boost::python;

PyObject* rogue::generalErrorObj = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/rogue/GilRelease.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdint.h>

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
namespace bp = boost::python;
#endif

Expand Down
6 changes: 3 additions & 3 deletions src/rogue/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
#include <memory>

#if defined(__linux__)
#include <sys/syscall.h>
#include <sys/syscall.h>
#elif defined(__APPLE__) && defined(__MACH__)
#include <pthread.h>
#include <pthread.h>
#endif

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
namespace bp = boost::python;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rogue/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "rogue/GilRelease.h"

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
namespace bp = boost::python;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rogue/hardware/MemMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace rh = rogue::hardware;
namespace rim = rogue::interfaces::memory;

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
namespace bp = boost::python;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rogue/hardware/axi/AxiMemMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace rha = rogue::hardware::axi;
namespace rim = rogue::interfaces::memory;

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
namespace bp = boost::python;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/rogue/hardware/axi/AxiStreamDma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace rha = rogue::hardware::axi;
namespace ris = rogue::interfaces::stream;

#ifndef NO_PYTHON
#include <boost/python.hpp>
#include <boost/python.hpp>
namespace bp = boost::python;
#endif

Expand Down
Loading

0 comments on commit 641820b

Please sign in to comment.