/[base]/head/lib/libc/stdlib/strtol.c
ViewVC logotype

Log of /head/lib/libc/stdlib/strtol.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:

Revision 328612 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 31 03:05:14 2018 UTC (6 years, 10 months ago) by imp
File length: 4808 byte(s)
Diff to previous 326025
Move strtold wrapper from strtol.c to its own strtold.c.  This code
was written by theraven@ (David Chisnall) entirely, there's no
original Berkeley code left here so just copy his copyright over.


Revision 326025 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 20 19:49:47 2017 UTC (7 years, 1 month ago) by pfg
File length: 4939 byte(s)
Diff to previous 251672
General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


Revision 251672 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 13 00:19:30 2013 UTC (11 years, 6 months ago) by emaste
File length: 4895 byte(s)
Diff to previous 227753
Renumber clauses to reduce diffs to other versions

NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.


Revision 227753 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 20 14:45:42 2011 UTC (13 years, 1 month ago) by theraven
File length: 4895 byte(s)
Diff to previous 165903
Implement xlocale APIs from Darwin, mainly for use by libc++.  This adds a
load of _l suffixed versions of various standard library functions that use
the global locale, making them take an explicit locale parameter.  Also
adds support for per-thread locales.  This work was funded by the FreeBSD
Foundation.

Please test any code you have that uses the C standard locale functions!

Reviewed by:    das (gdtoa changes)
Approved by:    dim (mentor)


Revision 165903 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 9 00:28:16 2007 UTC (17 years, 11 months ago) by imp
File length: 4363 byte(s)
Diff to previous 140577
Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


Revision 140577 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 21 13:31:02 2005 UTC (19 years, 11 months ago) by ache
File length: 4600 byte(s)
Diff to previous 140536
Whitespace/style tweaking of prev. commit.

Noted by:       bde


Revision 140536 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 21 00:42:13 2005 UTC (19 years, 11 months ago) by ache
File length: 4607 byte(s)
Diff to previous 103012
POSIX says that 0[xX] prefix is _optional_ even in base 16 case, make it
really so.

"If the value of base is 16, the characters 0x or 0X may optionally
precede the sequence of letters and digits, following the sign if
present."

Found by:       joerg


Revision 103012 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 6 11:24:06 2002 UTC (22 years, 3 months ago) by tjr
File length: 4487 byte(s)
Diff to previous 101912
Style: One space between "restrict" qualifier and "*".


Revision 101912 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 15 09:25:04 2002 UTC (22 years, 4 months ago) by robert
File length: 4485 byte(s)
Diff to previous 92986
 - Add the 'restrict' qualifier to the function prototypes and
   definitions of the functions that convert strings to numbers
   and are defined by IEEE Std 1003-1.2001.
 - Use ANSI-C function definitions for all of the functions
   mentioned above plus strtouq and strtoq.
 - Update the prototypes in the manual pages.


Revision 92986 - (view) (download) (annotate) - [select for diffs]
Modified Fri Mar 22 21:53:29 2002 UTC (22 years, 9 months ago) by obrien
File length: 4486 byte(s)
Diff to previous 87494
Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.


Revision 87494 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 7 16:33:47 2001 UTC (23 years ago) by ache
File length: 4456 byte(s)
Diff to previous 87196
Return 'c' back to signed due to potential comparison problems
Use simpler test for valid ranges

Submitted by:	bde


Revision 87196 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 2 09:15:54 2001 UTC (23 years ago) by ache
File length: 4436 byte(s)
Diff to previous 87078
Make it works for non ASCII compatible encodings too.
The only assumption left is that 'A'..'Z' 'a'..'z' both are contiguous


Revision 87078 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 29 03:03:55 2001 UTC (23 years, 1 month ago) by ache
File length: 4427 byte(s)
Diff to previous 87042
Back out national digits support, POSIX explicetely disallows it:

The definition of character class digit requires that only ten characters
-the ones defining digits- can be specified; alternate digits (for
example, Hindi or Kanji) cannot be specified here. However, the encoding
may vary if an implementation supports more than one encoding.

The definition of character class xdigit requires that the characters
included in character class digit are included here also and allows for
different symbols for the hexadecimal digits 10 through 15.


Revision 87042 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 28 06:06:27 2001 UTC (23 years, 1 month ago) by ache
File length: 4457 byte(s)
Diff to previous 87023
Don't ever assume that isdigit() is always subset of isxdigit()


Revision 87023 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 28 02:35:35 2001 UTC (23 years, 1 month ago) by fenner
File length: 4427 byte(s)
Diff to previous 87020
Base 36 is allowed.


Revision 87020 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 28 02:17:22 2001 UTC (23 years, 1 month ago) by ache
File length: 4427 byte(s)
Diff to previous 87016
Put back base > 35 check. If someone dislike it, plese discuss it with
standards group first.


Revision 87016 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 28 00:48:11 2001 UTC (23 years, 1 month ago) by ache
File length: 4414 byte(s)
Diff to previous 83024
Understand national (non-ASCII) digits now
Allow bases >=36 again
Misc cleanup


Revision 83024 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 4 21:28:01 2001 UTC (23 years, 3 months ago) by ache
File length: 4486 byte(s)
Diff to previous 82995
Portability fix: use unsigned cast to guaranteed positive part of expression
in case {L}LONG_MAX > abs({L}LONG_MIN).  Non-functional change - we don't
have any such platforms.


Revision 82995 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 4 17:41:20 2001 UTC (23 years, 3 months ago) by ache
File length: 4486 byte(s)
Diff to previous 82982
Remove rcsids and unneded include


Revision 82982 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 4 17:12:15 2001 UTC (23 years, 3 months ago) by ache
File length: 4532 byte(s)
Diff to previous 82975
'acc' is not initialized in one hypotetical case, fix it


Revision 82975 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 4 16:39:11 2001 UTC (23 years, 3 months ago) by ache
File length: 4532 byte(s)
Diff to previous 17141
Locale *is* used in strto*l*(), at least for isspace(), so remove
'locale not used' statement from comments and BUGS section of manpage.

strtol(): fix non-portable 'cutoff' calculation using the same method as
in strtoll().

Cleanup 'cutoff' calculation, remove unneded casts. Misc. cleanup to
make all functions looks the same.

Implement EINVAL reaction per POSIX, document it in manpage, corresponding
POSIX example quotes here:

------------------------------------------------
If the subject sequence is empty or does not have the expected form, no
conversion is performed; the value of str is stored in the object pointed
to by endptr, provided that endptr is not a null pointer.

If no conversion could be performed, 0 shall be returned and errno may be
set to [EINVAL].

[EINVAL] The value of base is not supported.

Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are
returned on error and are also valid returns on success, an application
wishing to check for error situations should set errno to 0, then call
strtol( ) or strtoll ( ), then check errno.
-----------------------------------------------------


Revision 17141 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 12 18:57:58 1996 UTC (28 years, 5 months ago) by jkh
File length: 4381 byte(s)
Diff to previous 9843
General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <[email protected]>


Revision 9843 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 1 21:38:00 1995 UTC (29 years, 5 months ago) by ache
File length: 4379 byte(s)
Diff to previous 1574
strtol and atoi VERY broken in 8bit chars locale, i.e. if you pass something
like 38400<any 8bit char, isalpha> it not detect this stuff and
produce very big number instead. Fixed by operating with unsigned char
and checking for isascii. (secure/telnetd hits by it f.e.)


Revision 1574 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 27 05:00:24 1994 UTC (30 years, 7 months ago) by rgrimes
File length: 4340 byte(s)
Copied from: vendor/CSRG/dist/lib/libc/stdlib/strtol.c revision 1573
Diff to previous 1573
This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


Revision 1573 - (view) (download) (annotate) - [select for diffs]
Added Fri May 27 05:00:24 1994 UTC (30 years, 7 months ago) by rgrimes
Original Path: vendor/CSRG/dist/lib/libc/stdlib/strtol.c
File length: 4340 byte(s)
BSD 4.4 Lite Lib Sources


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.27