Skip to content

Commit

Permalink
Fix a few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Jul 6, 2020
1 parent 2b5de6f commit 91fbd12
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 55 deletions.
4 changes: 1 addition & 3 deletions ext/intl/collator/collator_is_numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@

#include "collator_is_numeric.h"

/* {{{ collator_u_strtod
* Taken from PHP6:zend_u_strtod()
*/
/* {{{ Taken from PHP6:zend_u_strtod() */
static double collator_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */
{
const UChar *u = nptr, *nstart;
Expand Down
14 changes: 3 additions & 11 deletions ext/intl/collator/collator_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ static int collator_compare_func(Bucket *f, Bucket *s)
}
/* }}} */

/* {{{ collator_cmp_sort_keys
* Compare sort keys
*/
/* {{{ Compare sort keys */
static int collator_cmp_sort_keys( const void *p1, const void *p2 )
{
char* key1 = ((collator_sort_key_index_t*)p1)->key;
Expand All @@ -250,9 +248,7 @@ static int collator_cmp_sort_keys( const void *p1, const void *p2 )
}
/* }}} */

/* {{{ collator_get_compare_function
* Choose compare function according to sort flags.
*/
/* {{{ Choose compare function according to sort flags. */
static collator_compare_func_t collator_get_compare_function( const zend_long sort_flags )
{
collator_compare_func_t func;
Expand All @@ -277,9 +273,7 @@ static collator_compare_func_t collator_get_compare_function( const zend_long so
}
/* }}} */

/* {{{ collator_sort_internal
* Common code shared by collator_sort() and collator_asort() API functions.
*/
/* {{{ Common code shared by collator_sort() and collator_asort() API functions. */
static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
{
zval saved_collator;
Expand Down Expand Up @@ -342,8 +336,6 @@ static void collator_sortkey_swap(collator_sort_key_index_t *p, collator_sort_ke
}
/* }}} */

/* {{{ Equivalent to standard PHP sort using Collator.
* Uses ICU ucol_getSortKey for performance. }}} */
/* {{{ Equivalent to standard PHP sort using Collator.
* Uses ICU ucol_getSortKey for performance.
*/
Expand Down
6 changes: 3 additions & 3 deletions ext/intl/dateformat/dateformat_format.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "dateformat_class.h"
#include "dateformat_data.h"

/* {{{ * Internal function which calls the udat_format */
/* {{{ Internal function which calls the udat_format */
static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval *return_value)
{
UChar* formatted = NULL;
Expand All @@ -52,7 +52,7 @@ static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval
/* }}} */


/* {{{ * Internal function which fetches an element from the passed array for the key_name passed */
/* {{{ Internal function which fetches an element from the passed array for the key_name passed */
static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
HashTable* hash_arr, char* key_name, intl_error *err)
{
Expand Down Expand Up @@ -88,7 +88,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
}
/* }}} */

/* {{{ * Internal function which sets UCalendar from the passed array and retrieves timestamp */
/* {{{ Internal function which sets UCalendar from the passed array and retrieves timestamp */
static UDate internal_get_timestamp(IntlDateFormatter_object *dfo,
HashTable *hash_arr)
{
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/dateformat/dateformat_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_va
}
}

/* {{{ * Internal function which calls the udat_parseCalendar */
/* {{{ Internal function which calls the udat_parseCalendar */
static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, size_t text_len, int32_t *parse_pos, zval *return_value)
{
UCalendar *parsed_calendar = NULL;
Expand Down
50 changes: 14 additions & 36 deletions ext/intl/intl_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ ZEND_EXTERN_MODULE_GLOBALS( intl )

zend_class_entry *IntlException_ce_ptr;

/* {{{ intl_error* intl_g_error_get()
* Return global error structure.
*/
/* {{{ Return global error structure. */
static intl_error* intl_g_error_get( void )
{
return &INTL_G( g_error );
}
/* }}} */

/* {{{ void intl_free_custom_error_msg( intl_error* err )
* Free mem.
*/
/* {{{ Free mem. */
static void intl_free_custom_error_msg( intl_error* err )
{
if( !err && !( err = intl_g_error_get( ) ) )
Expand All @@ -55,9 +51,7 @@ static void intl_free_custom_error_msg( intl_error* err )
}
/* }}} */

/* {{{ intl_error* intl_error_create()
* Create and initialize internals of 'intl_error'.
*/
/* {{{ Create and initialize internals of 'intl_error'. */
intl_error* intl_error_create( void )
{
intl_error* err = ecalloc( 1, sizeof( intl_error ) );
Expand All @@ -68,9 +62,7 @@ intl_error* intl_error_create( void )
}
/* }}} */

/* {{{ void intl_error_init( intl_error* coll_error )
* Initialize internals of 'intl_error'.
*/
/* {{{ Initialize internals of 'intl_error'. */
void intl_error_init( intl_error* err )
{
if( !err && !( err = intl_g_error_get( ) ) )
Expand All @@ -82,9 +74,7 @@ void intl_error_init( intl_error* err )
}
/* }}} */

/* {{{ void intl_error_reset( intl_error* err )
* Set last error code to 0 and unset last error message
*/
/* {{{ Set last error code to 0 and unset last error message */
void intl_error_reset( intl_error* err )
{
if( !err && !( err = intl_g_error_get( ) ) )
Expand All @@ -96,9 +86,7 @@ void intl_error_reset( intl_error* err )
}
/* }}} */

/* {{{ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg )
* Set last error message to msg copying it if needed.
*/
/* {{{ Set last error message to msg copying it if needed. */
void intl_error_set_custom_msg( intl_error* err, const char* msg, int copyMsg )
{
if( !msg )
Expand All @@ -124,9 +112,7 @@ void intl_error_set_custom_msg( intl_error* err, const char* msg, int copyMsg )
}
/* }}} */

/* {{{ const char* intl_error_get_message( intl_error* err )
* Create output message in format "<intl_error_text>: <extra_user_error_text>".
*/
/* {{{ Create output message in format "<intl_error_text>: <extra_user_error_text>". */
zend_string * intl_error_get_message( intl_error* err )
{
const char *uErrorName = NULL;
Expand All @@ -151,9 +137,7 @@ zend_string * intl_error_get_message( intl_error* err )
}
/* }}} */

/* {{{ void intl_error_set_code( intl_error* err, UErrorCode err_code )
* Set last error code.
*/
/* {{{ Set last error code. */
void intl_error_set_code( intl_error* err, UErrorCode err_code )
{
if( !err && !( err = intl_g_error_get( ) ) )
Expand All @@ -163,9 +147,7 @@ void intl_error_set_code( intl_error* err, UErrorCode err_code )
}
/* }}} */

/* {{{ void intl_error_get_code( intl_error* err )
* Return last error code.
*/
/* {{{ Return last error code. */
UErrorCode intl_error_get_code( intl_error* err )
{
if( !err && !( err = intl_g_error_get( ) ) )
Expand All @@ -175,27 +157,23 @@ UErrorCode intl_error_get_code( intl_error* err )
}
/* }}} */

/* {{{ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
* Set error code and message.
*/
/* {{{ Set error code and message. */
void intl_error_set( intl_error* err, UErrorCode code, const char* msg, int copyMsg )
{
intl_error_set_code( err, code );
intl_error_set_custom_msg( err, msg, copyMsg );
}
/* }}} */

/* {{{ void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
* Set error code and message.
*/
/* {{{ Set error code and message. */
void intl_errors_set( intl_error* err, UErrorCode code, const char* msg, int copyMsg )
{
intl_errors_set_code( err, code );
intl_errors_set_custom_msg( err, msg, copyMsg );
}
/* }}} */

/* {{{ void intl_errors_reset( intl_error* err ) */
/* {{{ */
void intl_errors_reset( intl_error* err )
{
if(err) {
Expand All @@ -205,7 +183,7 @@ void intl_errors_reset( intl_error* err )
}
/* }}} */

/* {{{ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg ) */
/* {{{ */
void intl_errors_set_custom_msg( intl_error* err, const char* msg, int copyMsg )
{
if(err) {
Expand All @@ -215,7 +193,7 @@ void intl_errors_set_custom_msg( intl_error* err, const char* msg, int copyMsg )
}
/* }}} */

/* {{{ intl_errors_set_code( intl_error* err, UErrorCode err_code ) */
/* {{{ */
void intl_errors_set_code( intl_error* err, UErrorCode err_code )
{
if(err) {
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/locale/locale_methods.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ PHP_FUNCTION(locale_get_all_variants)
}
/* }}} */

/* {{{ * Converts to lower case and also replaces all hyphens with the underscore */
/* {{{ Converts to lower case and also replaces all hyphens with the underscore */
static int strToMatch(const char* str ,char *retstr)
{
char* anchor = NULL;
Expand Down

0 comments on commit 91fbd12

Please sign in to comment.