Skip to content

Commit dc150da

Browse files
morrisonleviclaude
andcommitted
style(appsec): clang-format-19 helper sources
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3ee2336 commit dc150da

File tree

16 files changed

+33
-34
lines changed

16 files changed

+33
-34
lines changed

appsec/src/extension/commands/request_shutdown.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static void _pack_headers_no_cookies_llist(
130130

131131
zend_llist_position pos;
132132
for (sapi_header_struct *header = zend_llist_get_first_ex(hl, &pos); header;
133-
header = zend_llist_get_next_ex(hl, &pos)) {
133+
header = zend_llist_get_next_ex(hl, &pos)) {
134134
const char *pcol = memchr(header->header, ':', header->header_len);
135135
if (!pcol) {
136136
continue;
@@ -172,7 +172,7 @@ static void _pack_headers_no_cookies_llist(
172172
mpack_start_array(w, zend_llist_count(coll));
173173
zend_llist_position p;
174174
for (struct _header_val *hv = zend_llist_get_first_ex(coll, &p); hv;
175-
hv = zend_llist_get_next_ex(coll, &p)) {
175+
hv = zend_llist_get_next_ex(coll, &p)) {
176176
dd_mpack_write_nullable_str_lim(
177177
w, hv->val, hv->len, DD_MPACK_DEF_STRING_LIMIT);
178178
}
@@ -189,7 +189,7 @@ static const char *nullable _header_content_type_llist(
189189
{
190190
zend_llist_position pos;
191191
for (sapi_header_struct *header = zend_llist_get_first_ex(hl, &pos); header;
192-
header = zend_llist_get_next_ex(hl, &pos)) {
192+
header = zend_llist_get_next_ex(hl, &pos)) {
193193
if (header->header_len >= LSTRLEN("content-type") &&
194194
strncasecmp(header->header, LSTRARG("content-type")) == 0) {
195195
const char *pcol = memchr(header->header, ':', header->header_len);

appsec/src/extension/commands_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ static void _dump_out_msg(dd_log_level_t lvl, zend_llist *iovecs)
805805
zend_llist_position pos;
806806
int i = 1;
807807
for (struct iovec *iov = zend_llist_get_first_ex(iovecs, &pos); iov;
808-
iov = zend_llist_get_next_ex(iovecs, &pos), i++) {
808+
iov = zend_llist_get_next_ex(iovecs, &pos), i++) {
809809
zend_string *zstr = php_base64_encode(iov->iov_base, iov->iov_len);
810810
if (ZSTR_LEN(zstr) > INT_MAX) {
811811
return;

appsec/src/extension/ddappsec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static void ddappsec_sort_modules(void *base, size_t count, size_t siz,
130130

131131
// Reorder ddappsec to ensure it's always after ddtrace
132132
for (Bucket *module = base, *end = module + count, *ddappsec_module = NULL;
133-
module < end; ++module) {
133+
module < end; ++module) {
134134
zend_module_entry *m = (zend_module_entry *)Z_PTR(module->val);
135135
if (m->name == ddappsec_module_entry.name) {
136136
ddappsec_module = module;

appsec/src/extension/entity_body.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static bool _assume_utf8(const char *ct, size_t ct_len)
192192
return true;
193193
}
194194
for (const char *end = ct + ct_len, *c = psemi + 1;
195-
c < end - LSTRLEN("charset=utf-8") + 1; c++) {
195+
c < end - LSTRLEN("charset=utf-8") + 1; c++) {
196196
if (tolower(*c) == 'c' && tolower(*(c + 1)) == 'h' &&
197197
tolower(*(c + 2)) == 'a' && tolower(*(c + 3)) == 'r' &&
198198
tolower(*(c + 4)) == 's' && tolower(*(c + 5)) == 'e' && // NOLINT

appsec/src/extension/network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static size_t _iovecs_total_size(zend_llist *nonnull iovecs)
187187
zend_llist_position pos;
188188
size_t total = 0;
189189
for (struct iovec *iov = zend_llist_get_first_ex(iovecs, &pos); iov;
190-
iov = zend_llist_get_next_ex(iovecs, &pos)) {
190+
iov = zend_llist_get_next_ex(iovecs, &pos)) {
191191
total += iov->iov_len;
192192
}
193193
return total;
@@ -212,7 +212,7 @@ dd_result dd_conn_sendv(dd_conn *nonnull conn, zend_llist *nonnull iovecs)
212212
zend_llist_position pos;
213213
size_t i = 1;
214214
for (struct iovec *iov = zend_llist_get_first_ex(iovecs, &pos); iov;
215-
iov = zend_llist_get_next_ex(iovecs, &pos), i++) {
215+
iov = zend_llist_get_next_ex(iovecs, &pos), i++) {
216216
iovs[i] = *iov;
217217
}
218218

appsec/src/extension/request_abort.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,9 @@ static void _run_rshutdowns(void)
667667

668668
mlog_g(dd_log_debug, "Running remaining extensions' RSHUTDOWN");
669669
for (zend_hash_internal_pointer_end_ex(&module_registry, &pos);
670-
(module = zend_hash_get_current_data_ptr_ex(&module_registry, &pos)) !=
671-
NULL;
672-
zend_hash_move_backwards_ex(&module_registry, &pos)) {
670+
(module = zend_hash_get_current_data_ptr_ex(&module_registry, &pos)) !=
671+
NULL;
672+
zend_hash_move_backwards_ex(&module_registry, &pos)) {
673673
if (!found_ddappsec && strcmp("ddappsec", module->name) == 0) {
674674
found_ddappsec = true;
675675
continue;

appsec/src/extension/tags.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ static zend_string *_concat_json_fragments(void)
464464

465465
zend_llist_position pos;
466466
for (zend_string **sp = zend_llist_get_first_ex(&_appsec_json_frags, &pos);
467-
sp != NULL; sp = zend_llist_get_next_ex(&_appsec_json_frags, &pos)) {
467+
sp != NULL; sp = zend_llist_get_next_ex(&_appsec_json_frags, &pos)) {
468468
zend_string *s = *sp;
469469
needed_len += ZSTR_LEN(s);
470470
}
@@ -476,8 +476,8 @@ static zend_string *_concat_json_fragments(void)
476476

477477
size_t i = 0;
478478
for (zend_string **sp = zend_llist_get_first_ex(&_appsec_json_frags, &pos);
479-
sp != NULL;
480-
sp = zend_llist_get_next_ex(&_appsec_json_frags, &pos), i++) {
479+
sp != NULL;
480+
sp = zend_llist_get_next_ex(&_appsec_json_frags, &pos), i++) {
481481
if (i != 0) {
482482
*buf++ = ',';
483483
}
@@ -791,7 +791,7 @@ static void _dd_response_headers(zend_array *meta_ht)
791791
zend_llist *l = &SG(sapi_headers).headers;
792792
zend_llist_position pos;
793793
for (sapi_header_struct *header = zend_llist_get_first_ex(l, &pos); header;
794-
header = zend_llist_get_next_ex(l, &pos)) {
794+
header = zend_llist_get_next_ex(l, &pos)) {
795795
const char *pcol = memchr(header->header, ':', header->header_len);
796796
if (!pcol) {
797797
if (header->header_len <= INT_MAX) {

appsec/src/helper/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool ensure_unique_abstract_socket(std::string_view socket_path)
104104
return false;
105105
}
106106

107-
struct sockaddr_un addr {};
107+
struct sockaddr_un addr{};
108108
addr.sun_family = AF_UNIX;
109109
addr.sun_path[0] = '\0';
110110

appsec/src/helper/network/acceptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ acceptor::acceptor(const std::string_view &sv)
2828
throw std::system_error(errno, std::generic_category());
2929
}
3030

31-
struct sockaddr_un addr {};
31+
struct sockaddr_un addr{};
3232
std::size_t addr_size;
3333
addr.sun_family = AF_UNIX;
3434
bool const is_abstract = (!sv.empty() && sv[0] == '@');
@@ -111,7 +111,7 @@ void acceptor::set_accept_timeout(std::chrono::seconds timeout)
111111

112112
std::unique_ptr<base_socket> acceptor::accept()
113113
{
114-
struct sockaddr_un addr {};
114+
struct sockaddr_un addr{};
115115
socklen_t len = sizeof(addr);
116116

117117
int s =

appsec/src/helper/rate_limit.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace dds {
1919
template <typename T> class rate_limiter {
2020
public:
2121
explicit rate_limiter(uint32_t max_per_second)
22-
: max_per_second_(max_per_second){};
22+
: max_per_second_(max_per_second) {};
2323
bool allow()
2424
{
2525
SPDLOG_TRACE("rate_limiter: allow() called");

0 commit comments

Comments
 (0)