Skip to content

Commit

Permalink
avoid ctd99 style
Browse files Browse the repository at this point in the history
  • Loading branch information
remicollet committed Sep 19, 2022
1 parent 3a9dd5a commit ab01a6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 9 additions & 3 deletions apc_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,13 @@ PHP_APCU_API void apc_cache_detach(apc_cache_t *cache)

/* {{{ apc_cache_wlocked_real_expunge */
static void apc_cache_wlocked_real_expunge(apc_cache_t* cache) {
size_t i;

/* increment counter */
cache->header->nexpunges++;

/* expunge */
for (size_t i = 0; i < cache->nslots; i++) {
for (i = 0; i < cache->nslots; i++) {
apc_cache_entry_t **entry = &cache->slots[i];
while (*entry) {
apc_cache_wlocked_remove_entry(cache, entry);
Expand Down Expand Up @@ -754,8 +756,10 @@ PHP_APCU_API void apc_cache_default_expunge(apc_cache_t* cache, size_t size)
} else {
/* check that expunge is necessary */
if (available < suitable) {
size_t i;

/* look for junk */
for (size_t i = 0; i < cache->nslots; i++) {
for (i = 0; i < cache->nslots; i++) {
apc_cache_entry_t **entry = &cache->slots[i];
while (*entry) {
if (apc_cache_entry_expired(cache, *entry, t)) {
Expand Down Expand Up @@ -1090,11 +1094,13 @@ PHP_APCU_API zend_bool apc_cache_info(zval *info, apc_cache_t *cache, zend_bool
#endif

if (!limited) {
size_t i;

/* For each hashtable slot */
array_init(&list);
array_init(&slots);

for (size_t i = 0; i < cache->nslots; i++) {
for (i = 0; i < cache->nslots; i++) {
p = cache->slots[i];
j = 0;
for (; p != NULL; p = p->next) {
Expand Down
4 changes: 3 additions & 1 deletion apc_iterator.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ static void apc_iterator_totals(apc_iterator_t *iterator) {
}

php_apc_try {
for (size_t i=0; i < apc_user_cache->nslots; i++) {
size_t i;

for (i=0; i < apc_user_cache->nslots; i++) {
apc_cache_entry_t *entry = apc_user_cache->slots[i];
while (entry) {
if (apc_iterator_check_expiry(apc_user_cache, entry, t)) {
Expand Down

0 comments on commit ab01a6e

Please sign in to comment.