From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2093 Path: news.gmane.org!not-for-mail From: Lloyd Zusman Newsgroups: gmane.comp.sysutils.supervision.general Subject: [skalibs] Why no negative numbers in the =?utf-8?b?Kl9mbXQ=?= routines? Date: Tue, 7 Jun 2011 09:40:02 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1307439622 23172 80.91.229.12 (7 Jun 2011 09:40:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 7 Jun 2011 09:40:22 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-2327-gcsg-supervision=m.gmane.org@list.skarnet.org Tue Jun 07 11:40:18 2011 Return-path: Envelope-to: gcsg-supervision@lo.gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QTslm-0000c4-5Z for gcsg-supervision@lo.gmane.org; Tue, 07 Jun 2011 11:40:18 +0200 Original-Received: (qmail 531 invoked by uid 76); 7 Jun 2011 09:42:55 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 523 invoked from network); 7 Jun 2011 09:42:55 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 216.27.138.103 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2093 Archived-At: I want to use skalibs to support some software that I'm writing, instead of the standard unix libraries. This is generally working well and resulting in smaller, more efficient binaries, but I have come across one issue that is giving me some difficulties: the integer-based *_fmt routines do not format negative numbers. It seems that this is due to the fact that this group of *_fmt routines are all built on top of uint64_fmt_base(), which only knows about unsigned positive values. This makes sense for routines like uint_fmt() and ulong_fmt(), but it is causes problems when passing perfectly valid integers and longs to int_fmt() and long_fmt(), when these valid values happen to be less than zero. Of course, I know how to work around this, but it seems like the most efficient solution to this problem would be for skalibs to handle negative values at the lowest level, perhaps through a new int64_fmt_base() routine that would underlie int_fmt(), long_fmt(), etc. Is there any reason for why such a routine should not be written, so that fmtscan.h could use it to build the macros for all the signed-value routines such as int_fmt() and long_fmt()? If no one has any objections, I'd be happy to write a patch to skalibs which provides this functionality. Thoughts? Thanks. -- Lloyd Zusman ljz@asfast.com God bless you.