Bug 51209 - [libc] [patch] new feature: add a64l()/l64a/l64a_r functions (obtained from NetBSD)
Summary: [libc] [patch] new feature: add a64l()/l64a/l64a_r functions (obtained from N...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 5.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Tom Rhodes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-21 12:00 UTC by osa
Modified: 2006-04-15 08:56 UTC (History)
0 users

See Also:


Attachments
file.diff (9.85 KB, patch)
2003-04-21 12:00 UTC, osa
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description osa 2003-04-21 12:00:18 UTC
	add a64l()/l64a/l64a_r functions (obtained from NetBSD)
	From SUSv3 documentation:
	Issue 5: Moved from X/OPEN UNIX extension to BASE.
Comment 1 Stefan Farfeleder 2003-04-21 12:52:01 UTC
On Mon, Apr 21, 2003 at 02:59:46PM +0400, Sergey A.Osokin wrote:

> +int
> +l64a_r (long value, char *buffer, int buflen)
> +{
> +	char *s = buffer;
> +	int digit;
> +	unsigned long v = value;
	^^^^^^^^^^^^^
Shouldn't this be 'uint32_t'?  According to SUSv3:

"If the type long contains more than 32 bits, only the low-order 32 bits
shall be used for these operations."

> +
> +	_DIAGASSERT(buffer != NULL);
> +
> +	if (value == 0UL) 
> +		goto out;
> +
> +	for (; v != 0 && buflen > 1; s++, buflen--) {
> +		digit = (int)(v & 0x3f);
> +
> +		if (digit < 2) 
> +			*s = digit + '.';
> +		else if (digit < 12)
> +			*s = digit + '0' - 2;
> +		else if (digit < 38)
> +			*s = digit + 'A' - 12;
> +		else
> +			*s = digit + 'a' - 38;
> +		v >>= 6;
> +	}
> +
> +out:
> +	*s = '\0';
> +
> +	return (v == 0UL ? 0 : -1);
> +}
Comment 2 osa 2003-04-21 12:55:16 UTC
On Mon, Apr 21, 2003 at 04:00:18AM -0700, FreeBSD-gnats-submit@FreeBSD.org wrote:
> Thank you very much for your problem report.
> It has the internal identification `standards/51209'.
> The individual assigned to look at your
> report is: freebsd-standards. 
> 
> You can access the state of your problem report at any time
> via this link:
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=51209
> 
> >Category:       standards
> >Responsible:    freebsd-standards
> >Synopsis:       [PATCH] add a64l()/l64a/l64a_r functions (obtained from NetBSD)
> >Arrival-Date:   Mon Apr 21 04:00:18 PDT 2003

New version of this patch avaliable at 
http://ozz.pp.ru/patches/patch-libc

Thanks ru@.

-- 

Rgdz,                        /"\  ASCII RIBBON CAMPAIGN
Sergey Osokin aka oZZ,       \ /    AGAINST HTML MAIL
http://ozz.pp.ru/             X          AND NEWS
                             / \
Comment 3 Tom Rhodes freebsd_committer freebsd_triage 2005-12-24 23:25:41 UTC
State Changed
From-To: open->patched

I've modified the patch heavily and committed a different version 
based on this.  Thanks! 


Comment 4 Tom Rhodes freebsd_committer freebsd_triage 2005-12-24 23:25:41 UTC
Responsible Changed
From-To: freebsd-standards->trhodes

I've modified the patch heavily and committed a different version 
based on this.  Thanks!
Comment 5 Tom Rhodes freebsd_committer freebsd_triage 2006-04-15 08:55:27 UTC
State Changed
From-To: patched->closed

Merge to RELENG_6 complete, close this PR.  Thanks!