Skip to content

Commit

Permalink
misc. pointer formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 4, 2021
1 parent 98b2b45 commit 8b6718c
Show file tree
Hide file tree
Showing 23 changed files with 85 additions and 99 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/HAL/DUE/eeprom_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes
#define DEBUG_OUT ENABLED(EE_EMU_DEBUG)
#include "../../core/debug_out.h"

static void ee_Dump(const int page, const void* data) {
static void ee_Dump(const int page, const void *data) {

#ifdef EE_EMU_DEBUG

Expand Down Expand Up @@ -181,7 +181,7 @@ static void ee_Dump(const int page, const void* data) {
* @param data (pointer to the data buffer)
*/
__attribute__ ((long_call, section (".ramfunc")))
static bool ee_PageWrite(uint16_t page, const void* data) {
static bool ee_PageWrite(uint16_t page, const void *data) {

uint16_t i;
uint32_t addrflash = uint32_t(getFlashStorage(page));
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/ESP32/i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void IRAM_ATTR i2s_intr_handler_default(void *arg) {
I2S0.int_clr.val = I2S0.int_st.val; //clear pending interrupt
}

void stepperTask(void* parameter) {
void stepperTask(void *parameter) {
uint32_t remaining = 0;

while (1) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
typedef void (*usart_rx_callback_t)(serial_t * obj);

struct MarlinSerial : public HardwareSerial {
MarlinSerial(void* peripheral, usart_rx_callback_t rx_callback) :
MarlinSerial(void *peripheral, usart_rx_callback_t rx_callback) :
HardwareSerial(peripheral), _rx_callback(rx_callback)
{ }

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/onboard_sd.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ DRESULT disk_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
DRESULT disk_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
#endif
#if _DISKIO_IOCTL
DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void* buff);
DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff);
#endif

/* Disk Status Bits (DSTATUS) */
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/shared/backtrace/backtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <stdarg.h>

// Dump a backtrace entry
static bool UnwReportOut(void* ctx, const UnwReport* bte) {
static bool UnwReportOut(void *ctx, const UnwReport *bte) {
int *p = (int*)ctx;

(*p)++;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/shared/backtrace/unwinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ typedef struct {
* report function maybe called again in future. If false is returned,
* unwinding will stop with UnwindStart() returning UNWIND_TRUNCATED.
*/
typedef bool (*UnwindReportFunc)(void* data, const UnwReport* bte);
typedef bool (*UnwindReportFunc)(void *data, const UnwReport *bte);

/** Structure that holds memory callback function pointers.
*/
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/spindle_laser.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class SpindleLaser {
static inline void disable() { isReady = false; set_enabled(false); }

#if HAS_LCD_MENU
static inline void enable_with_dir(const bool reverse) {
static inline void enable_with_dir(const bool reverse) {
isReady = true;
const uint8_t ocr = TERN(SPINDLE_LASER_PWM, upower_to_ocr(menuPower), 255);
if (menuPower)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void DGUSDisplay::InitDisplay() {
RequestScreen(TERN(SHOW_BOOTSCREEN, DGUSLCD_SCREEN_BOOT, DGUSLCD_SCREEN_MAIN));
}

void DGUSDisplay::WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) {
void DGUSDisplay::WriteVariable(uint16_t adr, const void *values, uint8_t valueslen, bool isstr) {
const char* myvalues = static_cast<const char*>(values);
bool strend = !myvalues;
WriteHeader(adr, DGUS_CMD_WRITEVAR, valueslen);
Expand Down Expand Up @@ -120,7 +120,7 @@ void DGUSDisplay::WriteVariable(uint16_t adr, long value) {
WriteVariable(adr, static_cast<const void*>(&tmp), sizeof(long));
}

void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) {
void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void *values, uint8_t valueslen, bool isstr) {
const char* myvalues = static_cast<const char*>(values);
bool strend = !myvalues;
WriteHeader(adr, DGUS_CMD_WRITEVAR, valueslen);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class DGUSDisplay {
static void InitDisplay();

// Variable access.
static void WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false);
static void WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false);
static void WriteVariable(uint16_t adr, const void *values, uint8_t valueslen, bool isstr=false);
static void WriteVariablePGM(uint16_t adr, const void *values, uint8_t valueslen, bool isstr=false);
static void WriteVariable(uint16_t adr, int16_t value);
static void WriteVariable(uint16_t adr, uint16_t value);
static void WriteVariable(uint16_t adr, uint8_t value);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void DGUSScreenHandler::sendinfoscreen_en_mks(const char *line1, const char *lin
dgusdisplay.WriteVariable(VP_MSGSTR4, line4, 32, true);
}

void DGUSScreenHandler::sendinfoscreen_mks(const void* line1, const void* line2, const void* line3, const void* line4, uint16_t language) {
void DGUSScreenHandler::sendinfoscreen_mks(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language) {
if (language == MKS_English)
DGUSScreenHandler::sendinfoscreen_en_mks((char *)line1, (char *)line2, (char *)line3, (char *)line4);
else if (language == MKS_SimpleChinese)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/lib/dgus/mks/DGUSScreenHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DGUSScreenHandler {
#if 0
static void sendinfoscreen_ch_mks(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4);
static void sendinfoscreen_en_mks(const char *line1, const char *line2, const char *line3, const char *line4) ;
static void sendinfoscreen_mks(const void* line1, const void* line2, const void* line3, const void* line4,uint16_t language);
static void sendinfoscreen_mks(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language);
#endif

// "M117" Message -- msg is a RAM ptr.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void CLCD::CommandFifo::cmd(uint32_t cmd32) {
write((void*)&cmd32, sizeof(uint32_t));
}

void CLCD::CommandFifo::cmd(void* data, uint16_t len) {
void CLCD::CommandFifo::cmd(void *data, uint16_t len) {
write(data, len);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class CLCD::CommandFifo {
void execute();

void cmd(uint32_t cmd32);
void cmd(void* data, uint16_t len);
void cmd(void *data, uint16_t len);

void dlstart() {cmd(FTDI::CMD_DLSTART);}
void swap() {cmd(FTDI::CMD_SWAP);}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class CommandProcessor : public CLCD::CommandFifo {
// Wrap all the CommandFifo routines to allow method chaining

inline CommandProcessor& cmd (uint32_t cmd32) {CLCD::CommandFifo::cmd(cmd32); return *this;}
inline CommandProcessor& cmd (void* data, uint16_t len) {CLCD::CommandFifo::cmd(data, len); return *this;}
inline CommandProcessor& cmd (void *data, uint16_t len) {CLCD::CommandFifo::cmd(data, len); return *this;}
inline CommandProcessor& execute() {CLCD::CommandFifo::execute(); return *this;}

inline CommandProcessor& fgcolor (uint32_t rgb) {CLCD::CommandFifo::fgcolor(rgb); return *this;}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/sd/Sd2Card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ bool Sd2Card::readData(uint8_t *dst, const uint16_t count) {
}

/** read CID or CSR register */
bool Sd2Card::readRegister(const uint8_t cmd, void* buf) {
bool Sd2Card::readRegister(const uint8_t cmd, void *buf) {
uint8_t *dst = reinterpret_cast<uint8_t*>(buf);
if (cardCommand(cmd, 0)) {
error(SD_CARD_ERROR_READ_REG);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/sd/Sd2Card.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class Sd2Card {
uint8_t cardCommand(const uint8_t cmd, const uint32_t arg);

bool readData(uint8_t *dst, const uint16_t count);
bool readRegister(const uint8_t cmd, void* buf);
bool readRegister(const uint8_t cmd, void *buf);
void chipDeselect();
void chipSelect();
inline void type(const uint8_t value) { type_ = value; }
Expand Down

0 comments on commit 8b6718c

Please sign in to comment.