From bdd913fd4a86f506a7fc42a04363c75fcb0ab093 Mon Sep 17 00:00:00 2001 From: Martin Baute Date: Fri, 25 Mar 2016 09:27:35 +0100 Subject: [PATCH] Minor fixes. --- COPYING.CC0 | 121 ++++++++++++++++++++ Readme.txt | 53 ++++----- internals/_PDCLIB_int.h | 6 +- platform/example/internals/_PDCLIB_config.h | 9 +- testing/printf_testcases.h | 2 +- 5 files changed, 156 insertions(+), 35 deletions(-) create mode 100644 COPYING.CC0 mode change 100644 => 100755 platform/example/internals/_PDCLIB_config.h diff --git a/COPYING.CC0 b/COPYING.CC0 new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/COPYING.CC0 @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/Readme.txt b/Readme.txt index 40a6e97..a17c884 100644 --- a/Readme.txt +++ b/Readme.txt @@ -4,45 +4,38 @@ PDCLib - Public Domain C Library License ------- -Permission is granted to use, modify, and / or redistribute at will. +PDCLib is distributed unter the Creative Commons CC0 License. You +should have received a copy of the full legal text of this license +as part of this distribution (COPYING.CC0). It is also available at -This includes removing authorship notices, re-use of code parts in -other software (with or without giving credit), and / or creating a -commercial product based on it. +https://creativecommons.org/publicdomain/zero/1.0/legalcode -This permission is not revocable by the author. +The following is a human-readable summary of that license. -This software is provided as-is. Use it at your own risk. There is -no warranty whatsoever, neither expressed nor implied, and by using -this software you accept that the author(s) shall not be held liable -for any loss of data, loss of service, or other damages, be they -incidental or consequential. Your only option other than accepting -this is not to use the software at all. + No Copyright -A case for Public Domain ------------------------- +The person who associated a work with this deed has dedicated the +work to the public domain by waiving all of his or her rights to +the work worldwide under copyright law, including all related and +neighboring rights, to the extent allowed by law. -There was a time when you could just post a piece of code to usenet -and say, "I give it away for free; perhaps it's useful for you." +You can copy, modify, distribute and perform the work, even for +commercial purposes, all without asking permission. See Other +Information below. -Then came the lawyers. + Other Information -There are building blocks in software engineering that are so basic -that everyone should have free access to them without having to -employ a complete legal department for advice. They should be FREE. -Available for free, free of licensing implications, free of attached -propaganda, free of everything but their useful self. +In no way are the patent or trademark rights of any person affected +by CC0, nor are the rights that other persons may have in the work +or in how the work is used, such as publicity or privacy rights. -Today, even the term "free" has to be defined by several paragraphs -of legal blah-blah. +Unless expressly stated otherwise, the person who associated a work +with this deed makes no warranties about the work, and disclaims +liability for all uses of the work, to the fullest extent permitted +by applicable law. -Sick and tired of it, the author brought you this piece of software -under a "license" that should not be neccessary in the first place: -"Free" should have been enough. - -Unfortunately, German law does not even *allow* to declare a work to -be "in the Public Domain", so the "free for all" license I intended -had to be made expressively. +When using or citing the work, you should not imply endorsement by +the author or the affirmer. What is it ---------- diff --git a/internals/_PDCLIB_int.h b/internals/_PDCLIB_int.h index e449e2d..90276c0 100644 --- a/internals/_PDCLIB_int.h +++ b/internals/_PDCLIB_int.h @@ -354,8 +354,8 @@ const char * _PDCLIB_strtox_prelim( const char * p, char * sign, int * base ); _PDCLIB_uintmax_t _PDCLIB_strtox_main( const char ** p, unsigned int base, _PDCLIB_uintmax_t error, _PDCLIB_uintmax_t limval, int limdigit, char * sign ); /* Digits arrays used by various integer conversion functions */ -extern char _PDCLIB_digits[]; -extern char _PDCLIB_Xdigits[]; +extern const char _PDCLIB_digits[]; +extern const char _PDCLIB_Xdigits[]; /* The worker for all printf() type of functions. The pointer spec should point to the introducing '%' of a conversion specifier. The status structure is to @@ -453,5 +453,7 @@ _PDCLIB_static_assert( sizeof( sizeof( int ) ) == sizeof( _PDCLIB_size ), "Compi int _PDCLIB_assert_array[2]; _PDCLIB_static_assert( sizeof( &_PDCLIB_assert_array[1] - &_PDCLIB_assert_array[0] ) == sizeof( _PDCLIB_ptrdiff ), "Compiler disagrees on _PDCLIB_ptrdiff." ); +_PDCLIB_static_assert( sizeof( void * ) == sizeof( _PDCLIB_intmax_t ), "Compiler disagrees on _PDCLIB_intmax_t." ); +_PDCLIB_static_assert( sizeof( void * ) == sizeof( _PDCLIB_uintmax_t ), "Compiler disagrees on _PDCLIB_uintmax_t." ); #endif diff --git a/platform/example/internals/_PDCLIB_config.h b/platform/example/internals/_PDCLIB_config.h old mode 100644 new mode 100755 index e9cde3c..168053f --- a/platform/example/internals/_PDCLIB_config.h +++ b/platform/example/internals/_PDCLIB_config.h @@ -219,7 +219,7 @@ struct _PDCLIB_imaxdiv_t your compiler. */ -#ifdef __i386 +#if defined( __i386 ) /* The following generic implementation works only for pure stack-based architectures, and only if arguments are aligned to pointer @@ -235,7 +235,7 @@ typedef char * _PDCLIB_va_list; #define _PDCLIB_va_end( ap ) ( (ap) = (void *)0, (void)0 ) #define _PDCLIB_va_start( ap, parmN ) ( (ap) = (char *) &parmN + ( _PDCLIB_va_round(parmN) ), (void)0 ) -#elif __x86_64 +#elif defined( __x86_64 ) /* No way to cover x86_64 with a generic implementation, as it uses register- based parameter passing. Using the GCC builtins here. @@ -384,4 +384,9 @@ typedef int _PDCLIB_fd_t; /* Default is 4 (0, ERANGE, EDOM, EILSEQ). */ #define _PDCLIB_ERRNO_MAX 4 +#ifdef __CYGWIN__ +typedef unsigned int wint_t; +#endif + + #endif diff --git a/testing/printf_testcases.h b/testing/printf_testcases.h index 461b939..6a3d57c 100644 --- a/testing/printf_testcases.h +++ b/testing/printf_testcases.h @@ -83,7 +83,7 @@ PRINTF_TEST( (int)strlen( INT_HEXDIG ) + 3, "0xf" INT_hexdig, "%#3.6x", UINT_MAX ); PRINTF_TEST( INT_DIG + 1, "-" INT_MIN_DEZ_STR, "%.6d", INT_MIN ); PRINTF_TEST( INT_DIG + 1, "-" INT_MIN_DEZ_STR, "%6.3d", INT_MIN ); - PRINTF_TEST( INT_DIG + 1., "-" INT_MIN_DEZ_STR, "%3.6d", INT_MIN ); + PRINTF_TEST( INT_DIG + 1, "-" INT_MIN_DEZ_STR, "%3.6d", INT_MIN ); PRINTF_TEST( UINT_DIG, "0xf" INT_hexdig, "%#0.6x", UINT_MAX ); PRINTF_TEST( UINT_DIG, "0xf" INT_hexdig, "%#06.3x", UINT_MAX ); PRINTF_TEST( UINT_DIG, "0xf" INT_hexdig, "%#03.6x", UINT_MAX ); -- 2.40.0