Skip to content

Commit d63fb99

Browse files
thg2kGirgias
authored andcommitted
ext/session: code cleanup - use single empty line except for sections
1 parent adba504 commit d63fb99

4 files changed

Lines changed: 9 additions & 23 deletions

File tree

ext/session/mod_files.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ const ps_module ps_mod_files = {
103103
PS_MOD_UPDATE_TIMESTAMP(files)
104104
};
105105

106-
107106
static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, const zend_string *key)
108107
{
109108
const char *p;
@@ -346,10 +345,8 @@ static zend_result ps_files_key_exists(ps_files *data, const zend_string *key)
346345
return SUCCESS;
347346
}
348347

349-
350348
#define PS_FILES_DATA ps_files *data = PS_GET_MOD_DATA()
351349

352-
353350
/*
354351
* Open save handler. Setup resources that are needed by the handler.
355352
* PARAMETERS: PS_OPEN_ARGS in php_session.h
@@ -427,7 +424,6 @@ PS_OPEN_FUNC(files)
427424
return SUCCESS;
428425
}
429426

430-
431427
/*
432428
* Clean up opened resources.
433429
* PARAMETERS: PS_CLOSE_ARGS in php_session.h
@@ -456,7 +452,6 @@ PS_CLOSE_FUNC(files)
456452
return SUCCESS;
457453
}
458454

459-
460455
/*
461456
* Read session data from opened resource.
462457
* PARAMETERS: PS_READ_ARGS in php_session.h
@@ -531,7 +526,6 @@ PS_READ_FUNC(files)
531526
return SUCCESS;
532527
}
533528

534-
535529
/*
536530
* Write session data.
537531
* PARAMETERS: PS_WRITE_ARGS in php_session.h
@@ -547,7 +541,6 @@ PS_WRITE_FUNC(files)
547541
return ps_files_write(data, key, val);
548542
}
549543

550-
551544
/*
552545
* Update session data modification/access time stamp.
553546
* PARAMETERS: PS_UPDATE_TIMESTAMP_ARGS in php_session.h
@@ -582,7 +575,6 @@ PS_UPDATE_TIMESTAMP_FUNC(files)
582575
return SUCCESS;
583576
}
584577

585-
586578
/*
587579
* Delete session data.
588580
* PARAMETERS: PS_DESTROY_ARGS in php_session.h
@@ -617,7 +609,6 @@ PS_DESTROY_FUNC(files)
617609
return SUCCESS;
618610
}
619611

620-
621612
/*
622613
* Cleanup expired session data.
623614
* PARAMETERS: PS_GC_ARGS in php_session.h
@@ -646,7 +637,6 @@ PS_GC_FUNC(files)
646637
return *nrdels;
647638
}
648639

649-
650640
/*
651641
* Create session ID.
652642
* PARAMETERS: PS_CREATE_SID_ARGS in php_session.h
@@ -689,7 +679,6 @@ PS_CREATE_SID_FUNC(files)
689679
return sid;
690680
}
691681

692-
693682
/*
694683
* Check session ID existence for use_strict_mode support.
695684
* PARAMETERS: PS_VALIDATE_SID_ARGS in php_session.h

ext/session/mod_user.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const ps_module ps_mod_user = {
2222
PS_MOD_UPDATE_TIMESTAMP(user)
2323
};
2424

25-
2625
static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval)
2726
{
2827
int i;

ext/session/php_session.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ typedef struct ps_module_struct {
9595
ps_delete_##x, ps_gc_##x, ps_create_sid_##x, \
9696
ps_validate_sid_##x, ps_update_timestamp_##x
9797

98-
9998
typedef enum {
10099
php_session_disabled,
101100
php_session_none,

ext/session/session.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ zend_class_entry *php_session_update_timestamp_iface_entry;
7676

7777
#define PS_MAX_SID_LENGTH 256
7878

79+
7980
/* ***********
8081
* Helpers *
8182
*********** */
@@ -386,7 +387,6 @@ PHPAPI zend_result php_session_valid_key(const char *key)
386387
return SUCCESS;
387388
}
388389

389-
390390
static zend_long php_session_gc(bool immediate)
391391
{
392392
zend_long sessions_deleted = -1;
@@ -564,6 +564,7 @@ static void php_session_normalize_vars(void)
564564
}
565565
}
566566

567+
567568
/* *************************
568569
* INI Settings/Handlers *
569570
************************* */
@@ -664,7 +665,6 @@ static PHP_INI_MH(OnUpdateSaveDir)
664665
return OnUpdateStr(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
665666
}
666667

667-
668668
static PHP_INI_MH(OnUpdateName)
669669
{
670670
SESSION_CHECK_ACTIVE_STATE;
@@ -695,7 +695,6 @@ static PHP_INI_MH(OnUpdateName)
695695
return OnUpdateStrNotEmpty(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
696696
}
697697

698-
699698
static PHP_INI_MH(OnUpdateCookieLifetime)
700699
{
701700
SESSION_CHECK_ACTIVE_STATE;
@@ -716,7 +715,6 @@ static PHP_INI_MH(OnUpdateCookieLifetime)
716715
return OnUpdateLongGEZero(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
717716
}
718717

719-
720718
static PHP_INI_MH(OnUpdateSessionLong)
721719
{
722720
SESSION_CHECK_ACTIVE_STATE;
@@ -731,15 +729,13 @@ static PHP_INI_MH(OnUpdateSessionStr)
731729
return OnUpdateStr(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
732730
}
733731

734-
735732
static PHP_INI_MH(OnUpdateSessionBool)
736733
{
737734
SESSION_CHECK_ACTIVE_STATE;
738735
SESSION_CHECK_OUTPUT_STATE;
739736
return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
740737
}
741738

742-
743739
static PHP_INI_MH(OnUpdateSidLength)
744740
{
745741
zend_long val;
@@ -917,9 +913,11 @@ PHP_INI_BEGIN()
917913
/* PHP_INI_ENTRY("session.encode_sources", "globals,track", PHP_INI_ALL, NULL) */
918914
PHP_INI_END()
919915

916+
920917
/* ***************
921918
* Serializers *
922919
*************** */
920+
923921
PS_SERIALIZER_ENCODE_FUNC(php_serialize)
924922
{
925923
smart_str buf = {0};
@@ -1130,6 +1128,7 @@ PHPAPI zend_result php_session_register_serializer(const char *name, zend_string
11301128
return ret;
11311129
}
11321130

1131+
11331132
/* *******************
11341133
* Storage Modules *
11351134
******************* */
@@ -1311,6 +1310,7 @@ static int php_session_cache_limiter(void)
13111310
return -1;
13121311
}
13131312

1313+
13141314
/* *********************
13151315
* Cookie Management *
13161316
********************* */
@@ -1548,7 +1548,6 @@ static void proposed_session_id_to_session_id(const zval *proposed_session_id) {
15481548
}
15491549
}
15501550

1551-
15521551
PHPAPI zend_result php_session_reset_id(void)
15531552
{
15541553
int module_number = PS(module_number);
@@ -1627,7 +1626,6 @@ PHPAPI zend_result php_session_reset_id(void)
16271626
return SUCCESS;
16281627
}
16291628

1630-
16311629
PHPAPI zend_result php_session_start(void)
16321630
{
16331631
switch (PS(session_status)) {
@@ -1738,6 +1736,7 @@ static bool php_session_reset(void)
17381736
return PS(session_status) == php_session_active && php_session_initialize() == SUCCESS;
17391737
}
17401738

1739+
17411740
/* ********************************
17421741
* Userspace exported functions *
17431742
******************************** */
@@ -2676,7 +2675,6 @@ PHP_FUNCTION(session_gc)
26762675
RETURN_LONG(num);
26772676
}
26782677

2679-
26802678
PHP_FUNCTION(session_write_close)
26812679
{
26822680
ZEND_PARSE_PARAMETERS_NONE();
@@ -2740,6 +2738,7 @@ PHP_FUNCTION(session_register_shutdown)
27402738
}
27412739
}
27422740

2741+
27432742
/* ********************************
27442743
* Module Setup and Destruction *
27452744
******************************** */
@@ -2787,7 +2786,6 @@ static PHP_RINIT_FUNCTION(session)
27872786
ZVAL_UNDEF(&PS(mod_user_names).struct_name); \
27882787
}
27892788

2790-
27912789
static PHP_RSHUTDOWN_FUNCTION(session)
27922790
{
27932791
if (PS(session_status) == php_session_active) {
@@ -2958,6 +2956,7 @@ static PHP_MINFO_FUNCTION(session)
29582956
DISPLAY_INI_ENTRIES();
29592957
}
29602958

2959+
29612960
/* ************************
29622961
* Upload hook handling *
29632962
************************ */

0 commit comments

Comments
 (0)