Skip to content

Commit eb9bd69

Browse files
authored
Configure clang-format for consistent pointer alignment (esphome#1890)
1 parent 11b8210 commit eb9bd69

File tree

15 files changed

+81
-81
lines changed

15 files changed

+81
-81
lines changed

.clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
4949
ConstructorInitializerIndentWidth: 4
5050
ContinuationIndentWidth: 4
5151
Cpp11BracedListStyle: true
52-
DerivePointerAlignment: true
52+
DerivePointerAlignment: false
5353
DisableFormat: false
5454
ExperimentalAutoDetectBinPacking: false
5555
FixNamespaceComments: true

esphome/components/addressable_light/addressable_light_display.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace esphome {
55
namespace addressable_light {
66

7-
static const char* TAG = "addressable_light.display";
7+
static const char *TAG = "addressable_light.display";
88

99
int AddressableLightDisplay::get_width_internal() { return this->width_; }
1010
int AddressableLightDisplay::get_height_internal() { return this->height_; }
@@ -24,7 +24,7 @@ void AddressableLightDisplay::update() {
2424
void AddressableLightDisplay::display() {
2525
bool dirty = false;
2626
uint8_t old_r, old_g, old_b, old_w;
27-
Color* c;
27+
Color *c;
2828

2929
for (uint32_t offset = 0; offset < this->addressable_light_buffer_.size(); offset++) {
3030
c = &(this->addressable_light_buffer_[offset]);

esphome/components/b_parasite/b_parasite.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace esphome {
77
namespace b_parasite {
88

9-
static const char* TAG = "b_parasite";
9+
static const char *TAG = "b_parasite";
1010

1111
void BParasite::dump_config() {
1212
ESP_LOGCONFIG(TAG, "b_parasite");
@@ -16,25 +16,25 @@ void BParasite::dump_config() {
1616
LOG_SENSOR(" ", "Soil Moisture", this->soil_moisture_);
1717
}
1818

19-
bool BParasite::parse_device(const esp32_ble_tracker::ESPBTDevice& device) {
19+
bool BParasite::parse_device(const esp32_ble_tracker::ESPBTDevice &device) {
2020
if (device.address_uint64() != address_) {
2121
ESP_LOGVV(TAG, "parse_device(): unknown MAC address.");
2222
return false;
2323
}
2424
ESP_LOGVV(TAG, "parse_device(): MAC address %s found.", device.address_str().c_str());
25-
const auto& service_datas = device.get_service_datas();
25+
const auto &service_datas = device.get_service_datas();
2626
if (service_datas.size() != 1) {
2727
ESP_LOGE(TAG, "Unexpected service_datas size (%d)", service_datas.size());
2828
return false;
2929
}
30-
const auto& service_data = service_datas[0];
30+
const auto &service_data = service_datas[0];
3131

3232
ESP_LOGVV(TAG, "Service data:");
3333
for (const uint8_t byte : service_data.data) {
3434
ESP_LOGVV(TAG, "0x%02x", byte);
3535
}
3636

37-
const auto& data = service_data.data;
37+
const auto &data = service_data.data;
3838

3939
// Counter for deduplicating messages.
4040
uint8_t counter = data[1] & 0x0f;

esphome/components/dfplayer/dfplayer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace esphome {
55
namespace dfplayer {
66

7-
static const char* TAG = "dfplayer";
7+
static const char *TAG = "dfplayer";
88

99
void DFPlayer::play_folder(uint16_t folder, uint16_t file) {
1010
if (folder < 100 && file < 256) {

esphome/components/fingerprint_grow/fingerprint_grow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace esphome {
55
namespace fingerprint_grow {
66

7-
static const char* TAG = "fingerprint_grow";
7+
static const char *TAG = "fingerprint_grow";
88

99
// Based on Adafruit's library: https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library
1010

esphome/components/fujitsu_general/fujitsu_general.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace fujitsu_general {
88
#define SET_NIBBLE(message, nibble, value) (message[nibble / 2] |= (value & 0b00001111) << ((nibble % 2) ? 0 : 4))
99
#define GET_NIBBLE(message, nibble) ((message[nibble / 2] >> ((nibble % 2) ? 0 : 4)) & 0b00001111)
1010

11-
static const char* TAG = "fujitsu_general.climate";
11+
static const char *TAG = "fujitsu_general.climate";
1212

1313
// Common header
1414
const uint8_t FUJITSU_GENERAL_COMMON_LENGTH = 6;
@@ -202,7 +202,7 @@ void FujitsuGeneralClimate::transmit_off_() {
202202
this->power_ = false;
203203
}
204204

205-
void FujitsuGeneralClimate::transmit_(uint8_t const* message, uint8_t length) {
205+
void FujitsuGeneralClimate::transmit_(uint8_t const *message, uint8_t length) {
206206
ESP_LOGV(TAG, "Transmit message length %d", length);
207207

208208
auto transmit = this->transmitter_->transmit();
@@ -231,15 +231,15 @@ void FujitsuGeneralClimate::transmit_(uint8_t const* message, uint8_t length) {
231231
transmit.perform();
232232
}
233233

234-
uint8_t FujitsuGeneralClimate::checksum_state_(uint8_t const* message) {
234+
uint8_t FujitsuGeneralClimate::checksum_state_(uint8_t const *message) {
235235
uint8_t checksum = 0;
236236
for (uint8_t i = 7; i < FUJITSU_GENERAL_STATE_MESSAGE_LENGTH - 1; ++i) {
237237
checksum += message[i];
238238
}
239239
return 256 - checksum;
240240
}
241241

242-
uint8_t FujitsuGeneralClimate::checksum_util_(uint8_t const* message) { return 255 - message[5]; }
242+
uint8_t FujitsuGeneralClimate::checksum_util_(uint8_t const *message) { return 255 - message[5]; }
243243

244244
bool FujitsuGeneralClimate::on_receive(remote_base::RemoteReceiveData data) {
245245
ESP_LOGV(TAG, "Received IR message");

esphome/components/fujitsu_general/fujitsu_general.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ class FujitsuGeneralClimate : public climate_ir::ClimateIR {
6666
bool on_receive(remote_base::RemoteReceiveData data) override;
6767

6868
/// Transmit message as IR pulses
69-
void transmit_(uint8_t const* message, uint8_t length);
69+
void transmit_(uint8_t const *message, uint8_t length);
7070

7171
/// Calculate checksum for a state message
72-
uint8_t checksum_state_(uint8_t const* message);
72+
uint8_t checksum_state_(uint8_t const *message);
7373

7474
/// Calculate cecksum for a util message
75-
uint8_t checksum_util_(uint8_t const* message);
75+
uint8_t checksum_util_(uint8_t const *message);
7676

7777
// true if currently on - fujitsus transmit an on flag on when the remote moves from off to on
7878
bool power_{false};

esphome/components/max31855/max31855.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace esphome {
66
namespace max31855 {
77

8-
static const char* TAG = "max31855";
8+
static const char *TAG = "max31855";
99

1010
void MAX31855Sensor::update() {
1111
this->enable();

esphome/components/max31865/max31865.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace esphome {
77
namespace max31865 {
88

9-
static const char* TAG = "max31865";
9+
static const char *TAG = "max31865";
1010

1111
void MAX31865Sensor::update() {
1212
// Check new faults since last measurement
@@ -176,7 +176,7 @@ const uint16_t MAX31865Sensor::read_register_16_(uint8_t reg) {
176176
return value;
177177
}
178178

179-
float MAX31865Sensor::calc_temperature_(const float& rtd_ratio) {
179+
float MAX31865Sensor::calc_temperature_(const float &rtd_ratio) {
180180
// Based loosely on Adafruit's library: https://github.com/adafruit/Adafruit_MAX31865
181181
// Mainly based on formulas provided by Analog:
182182
// http://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf

esphome/components/max31865/max31865.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class MAX31865Sensor : public sensor::Sensor,
5151
void write_register_(uint8_t reg, uint8_t value);
5252
const uint8_t read_register_(uint8_t reg);
5353
const uint16_t read_register_16_(uint8_t reg);
54-
float calc_temperature_(const float& rtd_ratio);
54+
float calc_temperature_(const float &rtd_ratio);
5555
};
5656

5757
} // namespace max31865

esphome/components/nfc/ndef_record.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace esphome {
44
namespace nfc {
55

6-
static const char* TAG = "nfc.ndef_record";
6+
static const char *TAG = "nfc.ndef_record";
77

88
uint32_t NdefRecord::get_encoded_size() {
99
uint32_t size = 2;

esphome/components/rtttl/rtttl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace esphome {
55
namespace rtttl {
66

7-
static const char* TAG = "rtttl";
7+
static const char *TAG = "rtttl";
88

99
static const uint32_t DOUBLE_NOTE_GAP_MS = 10;
1010

0 commit comments

Comments
 (0)