Skip to content

Commit

Permalink
Merge pull request #1000 from slaclab/lint6
Browse files Browse the repository at this point in the history
Re-run clang-format on C++ code
  • Loading branch information
bengineerd authored Apr 29, 2024
2 parents b0bc15b + 641820b commit 5b5a167
Show file tree
Hide file tree
Showing 78 changed files with 537 additions and 523 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
30 changes: 15 additions & 15 deletions include/rogue/hardware/drivers/AxisDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "DmaDriver.h"

// Command definitions
#define AXIS_Read_Ack 0x2001 // Command to acknowledge read
#define AXIS_Write_ReqMissed 0x2002 // Command to indicate a missed write request
#define AXIS_Read_Ack 0x2001 // Command to acknowledge read
#define AXIS_Write_ReqMissed 0x2002 // Command to indicate a missed write request

// Only define the following if not compiling for kernel space
#ifndef DMA_IN_KERNEL
Expand All @@ -41,14 +41,14 @@
* @return The combined flags value.
*/
static inline uint32_t axisSetFlags(uint32_t fuser, uint32_t luser, uint32_t cont) {
uint32_t flags;
uint32_t flags;

// Set flags based on input parameters, ensuring each is in its correct position
flags = fuser & 0xFF; // First user-defined flag
flags |= (luser << 8) & 0xFF00; // Last user-defined flag
flags |= (cont << 16) & 0x10000; // Continuation flag
// Set flags based on input parameters, ensuring each is in its correct position
flags = fuser & 0xFF; // First user-defined flag
flags |= (luser << 8) & 0xFF00; // Last user-defined flag
flags |= (cont << 16) & 0x10000; // Continuation flag

return flags;
return flags;
}

/**
Expand All @@ -59,7 +59,7 @@ static inline uint32_t axisSetFlags(uint32_t fuser, uint32_t luser, uint32_t con
* @return The first user-defined flag.
*/
static inline uint32_t axisGetFuser(uint32_t flags) {
return flags & 0xFF;
return flags & 0xFF;
}

/**
Expand All @@ -70,7 +70,7 @@ static inline uint32_t axisGetFuser(uint32_t flags) {
* @return The last user-defined flag.
*/
static inline uint32_t axisGetLuser(uint32_t flags) {
return (flags >> 8) & 0xFF;
return (flags >> 8) & 0xFF;
}

/**
Expand All @@ -81,7 +81,7 @@ static inline uint32_t axisGetLuser(uint32_t flags) {
* @return The continuation flag.
*/
static inline uint32_t axisGetCont(uint32_t flags) {
return (flags >> 16) & 0x1;
return (flags >> 16) & 0x1;
}

/**
Expand All @@ -90,7 +90,7 @@ static inline uint32_t axisGetCont(uint32_t flags) {
* @param fd File descriptor for the AXIS device.
*/
static inline void axisReadAck(int32_t fd) {
ioctl(fd, AXIS_Read_Ack, 0);
ioctl(fd, AXIS_Read_Ack, 0);
}

/**
Expand All @@ -99,8 +99,8 @@ static inline void axisReadAck(int32_t fd) {
* @param fd File descriptor for the AXIS device.
*/
static inline void axisWriteReqMissed(int32_t fd) {
ioctl(fd, AXIS_Write_ReqMissed, 0);
ioctl(fd, AXIS_Write_ReqMissed, 0);
}

#endif // !DMA_IN_KERNEL
#endif // __ASIS_DRIVER_H__
#endif // !DMA_IN_KERNEL
#endif // __ASIS_DRIVER_H__
Loading

0 comments on commit 5b5a167

Please sign in to comment.