Skip to content

Commit

Permalink
vutil.c: Clean up white space/comments
Browse files Browse the repository at this point in the history
Change tabs to blanks; Fix indentation; chomp trailing white space

Remove some blank lines that don't contribute to readability

Add/change comment wording
  • Loading branch information
khwilliamson committed May 12, 2023
1 parent 1182acd commit 004f1e8
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions vutil.c
Expand Up @@ -582,7 +582,8 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
PERL_ARGS_ASSERT_UPG_VERSION;

if ( (SvUOK(ver) && SvUVX(ver) > VERSION_MAX)
|| (SvIOK(ver) && SvIVX(ver) > VERSION_MAX) ) {
|| (SvIOK(ver) && SvIVX(ver) > VERSION_MAX) )
{
/* out of bounds [unsigned] integer */
STRLEN len;
char tbuf[64];
Expand Down Expand Up @@ -623,7 +624,8 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
{
/* This may or may not be called from code that has switched
* locales without letting perl know, therefore we have to find it
* from first principals. See [perl #121930]. */
* from first principles. See [perl #121930]. This means that
* we use libc calls directly */

/* In windows, or not threaded, or not thread-safe, if it isn't C,
* set it to C. */
Expand Down Expand Up @@ -670,8 +672,8 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
else { /* This value indicates to the restore code that we
didn't change the locale */
locale_name_on_entry = NULL;
}
}
}
}
else if (locale_obj_on_entry == PL_underlying_numeric_obj) {
/* Here, the locale appears to have been changed to use the
* program's underlying locale. Just use our mechanisms to
Expand All @@ -690,21 +692,19 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
}

# endif

/* Prevent recursed calls from trying to change back */
/* Prevent recursed calls from trying to change the locale */
LOCK_LC_NUMERIC_STANDARD();

#endif

if (sv) {
/* Get the actual version */
if (sv) {
Perl_sv_setpvf(aTHX_ sv, "%.9" NVff, SvNVX(ver));
len = SvCUR(sv);
buf = SvPVX(sv);
}
else {
len = SvCUR(sv);
buf = SvPVX(sv);
}
else {
len = my_snprintf(tbuf, sizeof(tbuf), "%.9" NVff, SvNVX(ver));
buf = tbuf;
}
buf = tbuf;
}

#ifdef USE_LOCALE_NUMERIC

Expand All @@ -718,7 +718,6 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
}

LC_NUMERIC_UNLOCK; /* End critical section */

# else

if (locale_name_on_entry) {
Expand Down

0 comments on commit 004f1e8

Please sign in to comment.